From 4ef65518476ffe68ef426a82a119db6c1df39c4e Mon Sep 17 00:00:00 2001 From: TJ Date: Tue, 29 Mar 2016 17:19:11 +0100 Subject: [PATCH] tests: add checks for SHA executable Signed-off-by: TJ --- testsuite/Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/testsuite/Makefile b/testsuite/Makefile index b13bd3d..073991e 100644 --- a/testsuite/Makefile +++ b/testsuite/Makefile @@ -10,10 +10,11 @@ OPTS = -t -q EXE := ../$(PROG) TEST_DIR := $(shell mktemp --directory ) -SHA1SUM := $(shell which sha1sum ) +SHA := sha1sum +SHASUM := $(shell which $(SHA) ) HDR_ORIG := header_test.bin HDR_TEST := $(TEST_DIR)/header_test.bin -CHK_HDR_ORIG=$(shell $(SHA1SUM) $(HDR_TEST) ) +CHK_HDR_ORIG=$(shell $(SHASUM) $(HDR_TEST) ) tests: banner test_nochange test_man_nomatch test_man_match -rm -rf $(TEST_DIR) @@ -29,9 +30,11 @@ exe: @test -e $(EXE) || ( echo "executable $(EXE) does not exist" && /bin/false ) @test -f $(EXE) || ( echo "executable $(EXE) is not a file" && /bin/false ) @test -x $(EXE) || ( echo "executable $(EXE) is not executable" && /bin/false ) + @echo "Checking for $(SHA)" + @test -x $(SHASUM) || ( echo "$(SHA) not found" && /bin/false ) checksum: - echo $(CHK_HDR_ORIG) | $(SHA1SUM) --check --quiet + echo $(CHK_HDR_ORIG) | $(SHASUM) --check --quiet hdr_duplicate: cp $(HDR_ORIG) $(HDR_TEST) -- 2.17.1