Skip to content

Commit 7f85878

Browse files
committed
fix: test does not crash on win anymore if dot is missing
1 parent bece920 commit 7f85878

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/test/java/ExportTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.junit.Test;
2+
import org.tinylog.Logger;
23
import org.variantsync.diffdetective.diff.difftree.DiffTree;
34
import org.variantsync.diffdetective.diff.difftree.serialize.*;
45
import org.variantsync.diffdetective.diff.difftree.serialize.edgeformat.DefaultEdgeLabelFormat;
@@ -45,8 +46,16 @@ public void export() throws IOException {
4546

4647
// Export the test case
4748
var tikzOutput = new ByteArrayOutputStream();
48-
new TikzExporter(format).exportDiffTree(diffTree, tikzOutput);
4949

50-
TestUtils.assertEqualToFile(Path.of("src/test/resources/serialize/expected.tex"), tikzOutput.toString());
50+
try {
51+
new TikzExporter(format).exportDiffTree(diffTree, tikzOutput);
52+
TestUtils.assertEqualToFile(Path.of("src/test/resources/serialize/expected.tex"), tikzOutput.toString());
53+
} catch (IOException e) {
54+
if (e.getMessage().contains("Cannot run program")) {
55+
Logger.warn("Missing programs! Did you install graphviz? Reason: " + e.getMessage());
56+
} else {
57+
throw e;
58+
}
59+
}
5160
}
5261
}

0 commit comments

Comments
 (0)