# _,.---._ .-._ .--.-. ,--.--------. # _,..---._ ,-.' , - `. /==/ \ .-._/==/ //==/, - , -\ # /==/, - \ /==/_, , - \|==|, \/ /, |==\ -\\==\.-. - ,-./ # |==| _ _\==| .=. |==|- \| | \==\- \`--`\==\- \ # |==| .=. |==|_ : ;=: - |==| , | -| `--`-' \==\_ \ # |==|,| | -|==| , '=' |==| - _ | |==|- | # |==| '=' /\==\ - ,_ /|==| /\ , | |==|, | # |==|-, _`/ '.='. - .' /==/, | |- | /==/ -/ # `-.`.____.' `--`--'' `--`./ `--` `--`--` # _ __ ,---. .-._ .=-.-. _,.----. # .-`.' ,`..--.' \ /==/ \ .-._ /==/_ /.' .' - \ # /==/, - \==\-/\ \ |==|, \/ /, /==|, |/==/ , ,-' # |==| _ .=. /==/-|_\ | |==|- \| ||==| ||==|- | . # |==| , '=',\==\, - \ |==| , | -||==|- ||==|_ `-' \ # |==|- '..'/==/ - ,| |==| - _ ||==| ,||==| _ , | # |==|, | /==/- /\ - \|==| /\ , ||==|- |\==\. / # /==/ - | \==\ _.\=\.-'/==/, | |- |/==/. / `-.`.___.-' # `--`---' `--` `--`./ `--``--`-` # # @(#)Copyright (c) 2023, Nathan D. Fisher. # # This is free software. It comes with NO WARRANTY. # Permission to use, modify and distribute this source code # is granted subject to the following conditions. # 1/ that the above copyright notice and this notice # are preserved in all copies and that due credit be given # to the author. # 2/ that any changes to this code are clearly commented # as such so that the author does not get blamed for bugs # other than his own. # CFLAGS += -I../include LIBS += ../libhaggis.a LIBS += -lmd tests += store_device tests += load_device tests += store_md5 tests += load_md5 tests += store_sha1 tests += load_sha1 total = 6 .PHONY: test test: $(tests) @printf "\n\tRunning %i tests\n\n" $(total) @idx=1 ; success=0 ; fail=0; for t in $(tests) ; \ do printf "[%i/$(total)] \"$${t}\"\t" $${idx} ; \ idx=$$(expr $${idx} + 1) ; \ ./$${t} ; \ if [ $$? -eq 0 ] ; \ then echo -e '\e[0;32mSuccess\e[0m' ; \ success=$$(expr $${success} + 1) ; \ else echo -e '\e[0;31mFailure\e[0m' ; \ fail=$$(expr $${fail} + 1) ; \ fi ; done ; \ printf "\nResults: %i succeeded, %i failed\n" $${success} $${fail} output: @ [-d $@ ] 2>/dev/null || install -d $@ store_device: store_device.c haggis_private.h output $(CC) $(CFLAGS) -o $@ $< $(LIBS) load_device: load_device.c haggis_private.h output $(CC) $(CFLAGS) -o $@ $< $(LIBS) store_md5: store_md5.c haggis_private.h output $(CC) $(CFLAGS) -o $@ $< $(LIBS) load_md5: load_md5.c haggis_private.h output $(CC) $(CFLAGS) -o $@ $< $(LIBS) store_sha1: store_sha1.c haggis_private.h output $(CC) $(CFLAGS) -o $@ $< $(LIBS) load_sha1: load_sha1.c haggis_private.h output $(CC) $(CFLAGS) -o $@ $< $(LIBS) .PHONY: clean clean: rm -rf $(tests) output/*