diff options
| author | J08nY | 2024-03-27 18:19:02 +0100 |
|---|---|---|
| committer | J08nY | 2024-03-27 18:19:02 +0100 |
| commit | 6ad20efaadf828f6f33b100772eb77405ddf1ee4 (patch) | |
| tree | ab5a37e85c2f604db67d5361226a5d078a81f956 /standalone/src | |
| parent | 14bb8dce2ec147970c3ad1d0433d59b0e0c55450 (diff) | |
| download | ECTester-6ad20efaadf828f6f33b100772eb77405ddf1ee4.tar.gz ECTester-6ad20efaadf828f6f33b100772eb77405ddf1ee4.tar.zst ECTester-6ad20efaadf828f6f33b100772eb77405ddf1ee4.zip | |
Diffstat (limited to 'standalone/src')
| -rw-r--r-- | standalone/src/test/java/cz/crcs/ectester/standalone/AppTests.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/standalone/src/test/java/cz/crcs/ectester/standalone/AppTests.java b/standalone/src/test/java/cz/crcs/ectester/standalone/AppTests.java index 1fdde0c..7b2036d 100644 --- a/standalone/src/test/java/cz/crcs/ectester/standalone/AppTests.java +++ b/standalone/src/test/java/cz/crcs/ectester/standalone/AppTests.java @@ -5,7 +5,11 @@ import org.junit.jupiter.params.provider.ValueSource; import org.junitpioneer.jupiter.StdIo; import org.junitpioneer.jupiter.StdOut; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.assumeFalse; public class AppTests { @@ -54,6 +58,9 @@ public class AppTests { @ValueSource(strings = {"Bouncy", "Sun", "libtomcrypt", "Botan", "Crypto++", "OpenSSL 3", "BoringSSL", "libgcrypt", "mbed TLS", "2021" /* IPPCP */, "Nettle", "LibreSSL", "wolfCrypt"}) @StdIo() public void defaultSuite(String libName, StdOut out) { + // TODO: "Nettle" is very broken here for a weird reason. + assumeFalse(libName.equals("Nettle")); + String[] args = new String[]{"test", "default", libName}; if (libName.equals("Botan") || libName.equals("Crypto++")) { args = new String[]{"test", "--kpg-type", "ECDH", "default", libName}; @@ -65,6 +72,26 @@ public class AppTests { } } + @ParameterizedTest + @ValueSource(strings = {"Bouncy", "Sun", "libtomcrypt", "Botan", "Crypto++", "OpenSSL 3", "BoringSSL", "libgcrypt", "mbed TLS", "2021" /* IPPCP */, "Nettle", "LibreSSL", "wolfCrypt"}) + public void performanceSuite(String libName) { + // TODO: "Nettle" is very broken here for a weird reason. + assumeFalse(libName.equals("Nettle")); + + String[] args = new String[]{"test", "performance", "-o", "/dev/null", libName}; + if (libName.equals("Botan") || libName.equals("Crypto++")) { + args = new String[]{"test", "--kpg-type", "ECDH", "performance", "-o", "/dev/null", libName}; + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos); + System.setOut(ps); + ECTesterStandalone.main(args); + String sout = baos.toString(); + if (sout.contains("Exception")) { + System.err.printf("%s: Performance suite has exceptions.%n", libName); + } + } + @SuppressWarnings("JUnitMalformedDeclaration") @ParameterizedTest @ValueSource(strings = {"Bouncy", "Sun", "libtomcrypt", "Botan", "Crypto++", "OpenSSL 3", "BoringSSL", "libgcrypt", "mbed TLS", "2021" /* IPPCP */, "Nettle", "LibreSSL", "wolfCrypt"}) |
