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