Skip to content

Commit

Permalink
tests can not silently fail anymore if an IO error occurs while readi…
Browse files Browse the repository at this point in the history
…ng in the test code
  • Loading branch information
jurgenvinju committed Sep 19, 2023
1 parent ef50c52 commit 3a18d45
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/org/rascalmpl/test/infrastructure/RascalJUnitTestRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ public static String computeTestName(String name, ISourceLocation loc) {
public static List<String> getRecursiveModuleList(ISourceLocation root, List<String> result) throws IOException {
Queue<ISourceLocation> todo = new LinkedList<>();

// if (URIResolverRegistry.getInstance().exists(root)) {
// System.err.println("[INFO] skipping " + root + ", does not exist.");
// return result;
// }

todo.add(root);

while (!todo.isEmpty()) {
Expand Down Expand Up @@ -233,7 +228,7 @@ public Description getDescription() {

desc.addChild(modDesc);

Description testDesc = Description.createTestDescription(clazz, name + "compilation failed", new CompilationFailed() {
Description testDesc = Description.createTestDescription(clazz, name + " compilation failed", new CompilationFailed() {
@Override
public Class<? extends Annotation> annotationType() {
return getClass();
Expand All @@ -246,9 +241,18 @@ public Class<? extends Annotation> annotationType() {

return desc;
} catch (IOException e) {
Description testDesc = Description.createTestDescription(clazz, prefix + " compilation failed: " + e.getMessage(), new CompilationFailed() {
@Override
public Class<? extends Annotation> annotationType() {
return getClass();
}
});

desc.addChild(testDesc);

System.err.println("[ERROR] Could not create tests suite: " + e);
e.printStackTrace();
throw new RuntimeException("could not create test suite", e);

return desc;
}
}

Expand Down

0 comments on commit 3a18d45

Please sign in to comment.