Skip to content

Commit

Permalink
fail tests when javadoc fails
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldradi committed Mar 4, 2015
1 parent 5b21f00 commit 6491a08
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/test/java/cc/catalysts/cdoclet/AbstractGeneratorTest.java
@@ -1,6 +1,5 @@
package cc.catalysts.cdoclet;

import cc.catalysts.cdoclet.generator.Languages;
import com.sun.tools.javadoc.Main;
import org.apache.commons.io.FileUtils;
import org.junit.Assert;
Expand Down Expand Up @@ -47,11 +46,15 @@ public void testGeneration() throws IOException {
fileExt = "as";
}

Main.execute(new String[]{"-d", "test/results/" + fileExt, "-doclet", "cc.catalysts.cdoclet.CDoclet", "-generator", getLanguage(), inputFile});
int result = Main.execute(new String[]{"-d", "test/results/" + fileExt, "-doclet", "cc.catalysts.cdoclet.CDoclet", "-generator", getLanguage(), inputFile});

if (result > 0) {
Assert.fail("javadoc error");
}

File output = new File(getOutputDir() + fileWithoutExt + "." + fileExt);

File expected = new File("src/test/resources/expectations/" + fileExt + "/test/" + fileWithoutExt + "." + fileExt );
File expected = new File("src/test/resources/expectations/" + fileExt + "/test/" + fileWithoutExt + "." + fileExt);

if (!expected.exists()) {
System.err.println("file " + expected.getAbsolutePath() + " does not exist\nSkipping Test!");
Expand Down

0 comments on commit 6491a08

Please sign in to comment.