diff options
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"}) |
