From: Loup Vaillant Date: Wed, 20 Sep 2017 11:59:28 +0000 (+0200) Subject: Explain what to do if test vectors are missing X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=164d7de5531256a10f464bd8ba56831f3ec7e46c;p=Monocypher.git Explain what to do if test vectors are missing 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. --- diff --git a/makefile b/makefile index dff6525..7d9b6d6 100644 --- 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