]> git.codecow.com Git - Monocypher.git/commitdiff
grouped tests in one script
authorLoup Vaillant <loup@loup-vaillant.fr>
Thu, 27 Apr 2017 17:06:27 +0000 (19:06 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Thu, 27 Apr 2017 17:09:17 +0000 (19:09 +0200)
test.sh [new file with mode: 0755]
tests/sodium.c
tests/test.c

diff --git a/test.sh b/test.sh
new file mode 100755 (executable)
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
index f2f53483ad49d2fb0934d4ec1fc2d0aba5a5d11b..00f042825edcb415ee424c5efd8d51cac1c57925 100644 (file)
@@ -157,6 +157,5 @@ int main(void)
     status |= argon2i();
     status |= x25519();
     status |= edDSA();
-    printf(status ? "TESTS FAILED\n" : "ALL TESTS OK\n");
     return status;
 }
index ace06d547a8b6b39b2c72d1997838d8fd0145ce0..50969ba0b9da36b1f1434c3e57056e733e4a13b6 100644 (file)
@@ -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;
 }