8 # test suite formatted output
12 TEST_DIR := $(shell mktemp --directory )
14 SHASUM := $(shell which $(SHA) )
15 HDR_ORIG := header_test.bin
16 HDR_TEST := $(TEST_DIR)/header_test.bin
17 CHK_HDR_ORIG=$(shell $(SHASUM) $(HDR_TEST) )
19 tests: banner test_nochange test_man_nomatch test_man_match
23 @echo "Starting tests"
25 tests_dir: $(TEST_DIR)
26 @echo "Tests directory: $(TEST_DIR)"
29 @echo "Testing $(EXE)"
30 @test -e $(EXE) || ( echo "executable $(EXE) does not exist" && /bin/false )
31 @test -f $(EXE) || ( echo "executable $(EXE) is not a file" && /bin/false )
32 @test -x $(EXE) || ( echo "executable $(EXE) is not executable" && /bin/false )
33 @echo "Checking for $(SHA)"
34 @test -x $(SHASUM) || ( echo "$(SHA) not found" && /bin/false )
37 echo $(CHK_HDR_ORIG) | $(SHASUM) --check --quiet
40 cp $(HDR_ORIG) $(HDR_TEST)
42 test_nochange: exe tests_dir hdr_duplicate checksum
43 $(EXE) $(OPTS) $(HDR_TEST) 2>/dev/null