From 2690fcaea7973b0e2272b46a838c585adb3609ea Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 21 Feb 2022 22:50:44 +0100 Subject: Add tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 730da33..be1a6ca 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,8 @@ BIN =\ OBJ =\ $(BIN:=.o)\ - common.o + common.o\ + test.o HDR =\ arg.h\ @@ -21,7 +22,16 @@ ALIASES =\ b384sum\ b512sum -all: $(BIN) +# Known answers tests +KAT_FILES =\ + kat/blake2b\ + kat/blake2bp\ + kat/blake2s\ + kat/blake2sp\ + kat/blake2xb\ + kat/blake2xs + +all: $(BIN) test $(OBJ): $(HDR) .c.o: @@ -33,6 +43,12 @@ bsum: bsum.o common.o b2sum: b2sum.o common.o $(CC) -o $@ $@.o common.o $(LDFLAGS) +test: test.o + $(CC) -o $@ $@.o $(LDFLAGS) + +check: test $(BIN) $(KAT_FILES) + ./test + install: $(BIN) mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/" @@ -49,9 +65,9 @@ uninstall: clean: -rm -f -- *.o *.su *.gcov *.gcno *.gcda - -rm -f -- $(BIN) + -rm -f -- $(BIN) test .SUFFIXES: .SUFFIXES: .o .c -.PHONY: all install uninstall clean +.PHONY: all check install uninstall clean -- cgit v1.2.3-70-g09d2