Skip to content

Commit

Permalink
[PEx] Correct return codes, [Tst] Limit choose choices
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-goel committed Sep 5, 2024
1 parent 4c15796 commit 9cfb8ef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Src/PRuntimes/PExRuntime/src/main/java/pex/PEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ public static void main(String[] args) {
// run the analysis
RuntimeExecutor.run();
} catch (TooManyChoicesException e) {
exit_code = 3;
exit_code = 2;
} catch (BugFoundException e) {
exit_code = 2;
} catch (InvocationTargetException ex) {
ex.printStackTrace();
exit_code = 6;
exit_code = 5;
} catch (Exception ex) {
if (ex.getMessage().equals("TIMEOUT")) {
exit_code = 4;
exit_code = 3;
} else if (ex.getMessage().equals("MEMOUT")) {
exit_code = 5;
exit_code = 4;
} else {
ex.printStackTrace();
exit_code = 6;
exit_code = 5;
}
} finally {
// log end-of-run metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void logEndOfRun(long timeSpent) {
PExGlobal.getMinSteps(), (PExGlobal.getTotalSteps() / PExGlobal.getTotalSchedules()), PExGlobal.getMaxSteps()));
}
log.info(String.format("... Elapsed %d seconds and used %.1f GB", timeSpent, MemoryMonitor.getMaxMemSpent() / 1000.0));
log.info(String.format(".. Result: " + PExGlobal.getResult()));
log.info(String.format(".. \033[0;30;47m Result: %s \033[m", PExGlobal.getResult()));
log.info(". Done");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@ static int runTestCase(
} else if (resultCode == 2) {
PExTestLogger.log(" bug");
} else if (resultCode == 3) {
PExTestLogger.log(" too_many_choices");
} else if (resultCode == 4) {
PExTestLogger.log(" timeout");
resultCode = 0;
} else if (resultCode == 5) {
} else if (resultCode == 4) {
PExTestLogger.log(" memout");
} else {
PExTestLogger.log(" error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ machine Main {
var x, y : int;
var z, w : float;
var ys: set[int];
x = choose(100);
x = choose(10);
ys += (113);
ys += (123);
ys += (113);
Expand Down

0 comments on commit 9cfb8ef

Please sign in to comment.