Skip to content

Commit

Permalink
[PEx] Changes return codes
Browse files Browse the repository at this point in the history
0: ok, 2: bug, 3: bug (too_many_choices), 4: timeout, 5: memout, 6: error
  • Loading branch information
aman-goel committed Sep 5, 2024
1 parent 7a0a39c commit 4c15796
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Src/PRuntimes/PExRuntime/src/main/java/pex/PEx.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import pex.runtime.logger.StatWriter;
import pex.runtime.machine.PTestDriver;
import pex.utils.exceptions.BugFoundException;
import pex.utils.exceptions.TooManyChoicesException;
import pex.utils.monitor.MemoryMonitor;
import pex.utils.monitor.TimeMonitor;
import pex.utils.random.RandomNumberGenerator;
Expand Down Expand Up @@ -67,19 +68,21 @@ public static void main(String[] args) {

// run the analysis
RuntimeExecutor.run();
} catch (TooManyChoicesException e) {
exit_code = 3;
} catch (BugFoundException e) {
exit_code = 2;
} catch (InvocationTargetException ex) {
ex.printStackTrace();
exit_code = 5;
exit_code = 6;
} catch (Exception ex) {
if (ex.getMessage().equals("TIMEOUT")) {
exit_code = 3;
} else if (ex.getMessage().equals("MEMOUT")) {
exit_code = 4;
} else if (ex.getMessage().equals("MEMOUT")) {
exit_code = 5;
} else {
ex.printStackTrace();
exit_code = 5;
exit_code = 6;
}
} finally {
// log end-of-run metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ 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 == 4) {
} else if (resultCode == 5) {
PExTestLogger.log(" memout");
} else {
PExTestLogger.log(" error");
Expand Down

0 comments on commit 4c15796

Please sign in to comment.