Skip to content
Permalink
Browse files

[JENKINS-18154] Use correct HTML output with folderWhereYouRunDoxygen

  • Loading branch information
kbriggs committed May 30, 2013
1 parent e05b4e9 commit b5cf9da892100519873bbad5911659d1f3c6e672
@@ -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 b5cf9da

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