diff options
| author | J08nY | 2024-05-20 12:26:26 +0200 |
|---|---|---|
| committer | J08nY | 2024-05-20 12:26:26 +0200 |
| commit | b6ea0edd26ff6873d3596c68523d27c6e528a034 (patch) | |
| tree | fdfbb5ff289bd511124655254ff8b0479ac083b4 /standalone/src | |
| parent | e72ea6b90f236927c8f43da3e296290222e46f7b (diff) | |
| download | ECTester-b6ea0edd26ff6873d3596c68523d27c6e528a034.tar.gz ECTester-b6ea0edd26ff6873d3596c68523d27c6e528a034.tar.zst ECTester-b6ea0edd26ff6873d3596c68523d27c6e528a034.zip | |
Diffstat (limited to 'standalone/src')
| -rw-r--r-- | standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java b/standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java index 6ef1be7..2b9a853 100644 --- a/standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java +++ b/standalone/src/main/java/cz/crcs/ectester/standalone/ECTesterStandalone.java @@ -785,7 +785,40 @@ public class ECTesterStandalone { private void test() throws TestException, ParserConfigurationException, FileNotFoundException { TestWriter writer = new FileTestWriter(cli.getOptionValue("test.format", "text"), !cli.hasOption("test.quiet"), cli.getOptionValues("test.output")); StandaloneTestSuite suite; - switch (cli.getArg(0).toLowerCase()) { + String suiteOpt = cli.getArg(0) != null ? cli.getArg(0).toLowerCase() : "default"; + String testSuite; + int testFrom; + int testTo; + if (suiteOpt.contains(":")) { + String[] parts = suiteOpt.split(":"); + if (parts.length < 2 || parts.length > 3) { + System.err.println("Invalid test suite selection."); + return; + } + testSuite = parts[0]; + try { + testFrom = Integer.parseInt(parts[1]); + } catch (NumberFormatException nfe) { + System.err.println("Invalid test_from number: " + parts[1] + "."); + return; + } + if (parts.length == 3) { + try { + testTo = Integer.parseInt(parts[2]); + } catch (NumberFormatException nfe) { + System.err.println("Invalid test_to number: " + parts[2] + "."); + return; + } + } else { + testTo = -1; + } + } else { + testSuite = suiteOpt; + testFrom = 0; + testTo = -1; + } + + switch (testSuite) { case "test-vectors": suite = new StandaloneTestVectorSuite(writer, cfg, cli); break; @@ -824,7 +857,7 @@ public class ECTesterStandalone { break; } - suite.run(); + suite.run(testFrom, testTo); } /** |
