1275793eaSopenharmony_ciCFLAGS=-O
2275793eaSopenharmony_ci
3275793eaSopenharmony_cipuff: puff.o pufftest.o
4275793eaSopenharmony_ci
5275793eaSopenharmony_cipuff.o: puff.h
6275793eaSopenharmony_ci
7275793eaSopenharmony_cipufftest.o: puff.h
8275793eaSopenharmony_ci
9275793eaSopenharmony_citest: puff
10275793eaSopenharmony_ci	puff zeros.raw
11275793eaSopenharmony_ci
12275793eaSopenharmony_cipuft: puff.c puff.h pufftest.o
13275793eaSopenharmony_ci	cc -fprofile-arcs -ftest-coverage -o puft puff.c pufftest.o
14275793eaSopenharmony_ci
15275793eaSopenharmony_ci# puff full coverage test (should say 100%)
16275793eaSopenharmony_cicov: puft
17275793eaSopenharmony_ci	@rm -f *.gcov *.gcda
18275793eaSopenharmony_ci	@puft -w zeros.raw 2>&1 | cat > /dev/null
19275793eaSopenharmony_ci	@echo '04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
20275793eaSopenharmony_ci	@echo '00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
21275793eaSopenharmony_ci	@echo '00 00 00 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 254
22275793eaSopenharmony_ci	@echo '00 01 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
23275793eaSopenharmony_ci	@echo '01 01 00 fe ff 0a' | xxd -r -p | puft -f 2>&1 | cat > /dev/null
24275793eaSopenharmony_ci	@echo '02 7e ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246
25275793eaSopenharmony_ci	@echo '02' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
26275793eaSopenharmony_ci	@echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 2
27275793eaSopenharmony_ci	@echo '04 80 49 92 24 49 92 24 71 ff ff 93 11 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 249
28275793eaSopenharmony_ci	@echo '04 c0 81 08 00 00 00 00 20 7f eb 0b 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246
29275793eaSopenharmony_ci	@echo '0b 00 00' | xxd -r -p | puft -f 2>&1 | cat > /dev/null
30275793eaSopenharmony_ci	@echo '1a 07' | xxd -r -p | puft 2> /dev/null || test $$? -eq 246
31275793eaSopenharmony_ci	@echo '0c c0 81 00 00 00 00 00 90 ff 6b 04' | xxd -r -p | puft 2> /dev/null || test $$? -eq 245
32275793eaSopenharmony_ci	@puft -f zeros.raw 2>&1 | cat > /dev/null
33275793eaSopenharmony_ci	@echo 'fc 00 00' | xxd -r -p | puft 2> /dev/null || test $$? -eq 253
34275793eaSopenharmony_ci	@echo '04 00 fe ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 252
35275793eaSopenharmony_ci	@echo '04 00 24 49' | xxd -r -p | puft 2> /dev/null || test $$? -eq 251
36275793eaSopenharmony_ci	@echo '04 80 49 92 24 49 92 24 0f b4 ff ff c3 84' | xxd -r -p | puft 2> /dev/null || test $$? -eq 248
37275793eaSopenharmony_ci	@echo '04 00 24 e9 ff ff' | xxd -r -p | puft 2> /dev/null || test $$? -eq 250
38275793eaSopenharmony_ci	@echo '04 00 24 e9 ff 6d' | xxd -r -p | puft 2> /dev/null || test $$? -eq 247
39275793eaSopenharmony_ci	@gcov -n puff.c
40275793eaSopenharmony_ci
41275793eaSopenharmony_ciclean:
42275793eaSopenharmony_ci	rm -f puff puft *.o *.gc*
43