From: Loup Vaillant Date: Thu, 27 Apr 2017 17:06:27 +0000 (+0200) Subject: grouped tests in one script X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=4aa5752c9abe08711d42e8a3318e477e56a77465;p=Monocypher.git grouped tests in one script --- diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..8fae752 --- /dev/null +++ b/test.sh @@ -0,0 +1,34 @@ +#! /bin/sh + +echo +echo "Build" +echo "-----" +make test sodium donna + +echo +echo "Independent tests (with vectors)" +echo "--------------------------------" +./test +retval_test=$? + +echo +echo "Fuzz tests (compare with libsodium)" +echo "-----------------------------------" +./sodium +retval_sodium=$? +echo +echo "Fuzz tests (compare with ed25519-donna)" +echo "---------------------------------------" +./donna +retval_donna=$? + +echo +if [ "$retval_test" -ne 0 ] ||\ + [ "$retval_sodium" -ne 0 ] ||\ + [ "$retval_donna" -ne 0 ] +then + echo "TESTS FAILED. VERIFY IMPLEMENTATION. REPORT BUG" + echo "DO. NOT. USE." +else + echo "All tests OK!" +fi diff --git a/tests/sodium.c b/tests/sodium.c index f2f5348..00f0428 100644 --- a/tests/sodium.c +++ b/tests/sodium.c @@ -157,6 +157,5 @@ int main(void) status |= argon2i(); status |= x25519(); status |= edDSA(); - printf(status ? "TESTS FAILED\n" : "ALL TESTS OK\n"); return status; } diff --git a/tests/test.c b/tests/test.c index ace06d5..50969ba 100644 --- a/tests/test.c +++ b/tests/test.c @@ -450,6 +450,5 @@ int main(void) status |= test(ed25519_sign2, "tests/vectors/ed25519_sign", 3); status |= test_x25519(); status |= test_aead(); - printf(status ? "TESTS FAILED\n" : "ALL TESTS OK\n"); return status; }