From: TJ Date: Tue, 29 Mar 2016 16:19:11 +0000 (+0100) Subject: tests: add checks for SHA executable X-Git-Tag: v1.3~9 X-Git-Url: https://iam.tj/gitweb/gitweb.cgi?p=firmware_header_edit.git;a=commitdiff_plain;h=4ef65518476ffe68ef426a82a119db6c1df39c4e tests: add checks for SHA executable Signed-off-by: TJ --- 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)