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