Skip to content
Permalink
Browse files

Merge pull request #5 from kbriggs/bugfix-JENKINS-18154

[JENKINS-18154] Use correct HTML output with folderWhereYouRunDoxygen
  • Loading branch information
gboissinot committed May 31, 2013
2 parents e05b4e9 + b5cf9da commit 8a61bf917a5b9fe9cd669d4fcdc3966965e4198c
@@ -136,14 +136,10 @@ public Boolean invoke(File f, VirtualChannel channel) throws IOException, Interr
if (outputHTML == null || outputHTML.trim().length() == 0) {
outputHTML = "html";
LOGGER.log(Level.INFO, "The " + DOXYGEN_KEY_HTML_OUTPUT + " tag is not present or is left blank." + DOXYGEN_DEFAULT_HTML_OUTPUT + " will be used as the default path.");
} else {
// Check if folderWhereYouRunDoxygen is specified, because then the gen dir is calculated relative to it
if ((this.folderWhereYouRunDoxygen != null) && (!this.folderWhereYouRunDoxygen.isEmpty())) {
doxyGenDir = (folderWhereYouRunDoxygen + File.separator + outputHTML);
} else {
doxyGenDir = (doxyGenDir != null) ? (doxyGenDir + File.separator + outputHTML) : outputHTML;
}
}
doxyGenDir = (doxyGenDir != null) ? (doxyGenDir + File.separator + outputHTML) :
(this.folderWhereYouRunDoxygen != null) && (!this.folderWhereYouRunDoxygen.isEmpty()) ?
(this.folderWhereYouRunDoxygen + File.separator + outputHTML) : outputHTML;

final String finalComputedDoxygenDir = doxyGenDir.replace('\\', '/');
Boolean absolute = isDirectoryAbsolute(base, finalComputedDoxygenDir);
@@ -190,6 +190,44 @@ public void retrieveDoxygenFromLoadFileWithValidInput() throws Exception {
classContext.assertIsSatisfied();
context.assertIsSatisfied();
}


@Test
public void retrieveDoxygenFromLoadFileWithWhereRun() throws Exception {

String whereRun = "testWhereRun";

//Create the doxyfile with content in the temporary workspace
FilePath doxyfileDir = new FilePath(workspace,whereRun);
FilePath doxyfilePath = doxyfileDir.child("Doxyfile");
doxyfileDir.mkdirs();
FileOutputStream fos = new FileOutputStream(new File(doxyfilePath.toURI()));
fos.write(readAsString("Doxyfile").getBytes());
fos.close();

//Create the generated doxygen directory
String commandDoxygenGeneratedDirectoryName="html-out/html";
FilePath doxygenDir=new FilePath(doxyfileDir,commandDoxygenGeneratedDirectoryName);
doxygenDir.mkdirs();


DoxygenDirectoryParser doxygenDirectoryParser =
new DoxygenDirectoryParser(DoxygenArchiverDescriptor.DOXYGEN_DOXYFILE_PUBLISHTYPE ,doxyfilePath.toString(),"",whereRun);

classContext.checking(new Expectations() {
{
ignoring(taskListener).getLogger();
will(returnValue(new PrintStream(new ByteArrayOutputStream())));
}
});

FilePath resultDoxygenDirectory = doxygenDirectoryParser.invoke(parentFile, virtualChannel);
assertEquals("The computed doxygen directory is not correct", doxygenDir.toURI(),resultDoxygenDirectory.toURI());


classContext.assertIsSatisfied();
context.assertIsSatisfied();
}

@Test
public void pathIsRelativeWhenNoParent() throws Exception {

0 comments on commit 8a61bf9

Please sign in to comment.
You can’t perform that action at this time.