]> git.codecow.com Git - Monocypher.git/commitdiff
Explain what to do if test vectors are missing
authorLoup Vaillant <loup@loup-vaillant.fr>
Wed, 20 Sep 2017 11:59:28 +0000 (13:59 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Wed, 20 Sep 2017 19:44:53 +0000 (21:44 +0200)
Users who try to `make test` without the test vectors will have a nice
error message explaining how to actually perform the tests (either
generate those test vectors, or grab an official release.

It should thus be clear what libsodium is for, and why end users don't
need it.

makefile

index dff652588a0eaa9045e17b80d0a21b1d06903e5e..7d9b6d60ea59d7d242b508874c0aea736b2be038 100644 (file)
--- a/makefile
+++ b/makefile
@@ -19,7 +19,7 @@ CC=gcc -std=gnu99 # speed tests don't work with -std=cxx, they need the POSIX ex
 #CC = clang -std=c99 -fprofile-instr-generate -fcoverage-mapping
 
 #TODO maybe just use the environment variable?
-CFLAGS= -pedantic -Wall -Wextra -O3 -march=native -g
+CFLAGS= -pedantic -Wall -Wextra -O3 -march=native
 
 .PHONY: all clean install test speed
 
@@ -61,3 +61,20 @@ test.out : lib/test.o  lib/monocypher.o lib/sha512.o lib/utils.o
 speed.out: lib/speed.o lib/monocypher.o lib/sha512.o lib/utils.o
 test.out speed.out:
        $(CC) $(CFLAGS) -I src -o $@ $^
+
+tests/vectors.h:
+       @echo ""
+       @echo "======================================================"
+       @echo " I cannot perform the tests without the test vectors."
+       @echo " You must generate them.  This requires Libsodium."
+       @echo " The fowlowing will generate the test vectors:"
+       @echo ""
+       @echo "     $ cd tests/gen"
+       @echo "     $ make"
+       @echo ""
+       @echo " Alternatively, you can grab an official release."
+       @echo " It will include the test vectors, so you won't"
+       @echo " need libsodium"
+       @echo "======================================================"
+       @echo ""
+       return 1