Skip to content

Commit

Permalink
[test] ignoring getProperty, when there are no right
Browse files Browse the repository at this point in the history
  • Loading branch information
niyaznigmatullin committed Nov 24, 2018
1 parent 63669b7 commit e2700b5
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/ru/ifmo/testlib/CheckerFramework.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.io.PrintWriter;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.AccessControlException;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
Expand Down Expand Up @@ -187,14 +188,18 @@ private static void run(String[] args, int delta, Checker checker) {
}

int theExitCode = resultAdapter.getExitCodeFor(outcome);
String expectedExitCode = System.getProperty(EXPECTED_EXIT_CODE_PROPERTY);
if (expectedExitCode != null) {
if (String.valueOf(theExitCode).equals(expectedExitCode)) {
System.exit(0); // exit codes match
} else {
System.err.println("Expected exit code is " + expectedExitCode + ", but the actual one is " + theExitCode);
System.exit(1); // exit codes did not match
try {
String expectedExitCode = System.getProperty(EXPECTED_EXIT_CODE_PROPERTY);
if (expectedExitCode != null) {
if (String.valueOf(theExitCode).equals(expectedExitCode)) {
System.exit(0); // exit codes match
} else {
System.err.println("Expected exit code is " + expectedExitCode + ", but the actual one is " + theExitCode);
System.exit(1); // exit codes did not match
}
}
} catch (AccessControlException e) {
// nop
}
System.exit(theExitCode);
}
Expand Down

0 comments on commit e2700b5

Please sign in to comment.