70 lines
2.8 KiB
Makefile
70 lines
2.8 KiB
Makefile
# _,.---._ .-._ .--.-. ,--.--------.
|
|
# _,..---._ ,-.' , - `. /==/ \ .-._/==/ //==/, - , -\
|
|
# /==/, - \ /==/_, , - \|==|, \/ /, |==\ -\\==\.-. - ,-./
|
|
# |==| _ _\==| .=. |==|- \| | \==\- \`--`\==\- \
|
|
# |==| .=. |==|_ : ;=: - |==| , | -| `--`-' \==\_ \
|
|
# |==|,| | -|==| , '=' |==| - _ | |==|- |
|
|
# |==| '=' /\==\ - ,_ /|==| /\ , | |==|, |
|
|
# |==|-, _`/ '.='. - .' /==/, | |- | /==/ -/
|
|
# `-.`.____.' `--`--'' `--`./ `--` `--`--`
|
|
# _ __ ,---. .-._ .=-.-. _,.----.
|
|
# .-`.' ,`..--.' \ /==/ \ .-._ /==/_ /.' .' - \
|
|
# /==/, - \==\-/\ \ |==|, \/ /, /==|, |/==/ , ,-'
|
|
# |==| _ .=. /==/-|_\ | |==|- \| ||==| ||==|- | .
|
|
# |==| , '=',\==\, - \ |==| , | -||==|- ||==|_ `-' \
|
|
# |==|- '..'/==/ - ,| |==| - _ ||==| ,||==| _ , |
|
|
# |==|, | /==/- /\ - \|==| /\ , ||==|- |\==\. /
|
|
# /==/ - | \==\ _.\=\.-'/==/, | |- |/==/. / `-.`.___.-'
|
|
# `--`---' `--` `--`./ `--``--`-`
|
|
#
|
|
# @(#)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.
|
|
#
|
|
|
|
include ../config.mk
|
|
|
|
CFLAGS += -I../include
|
|
LDLIBS += ../libepoch.a
|
|
LDLIBS += $(LIBS)
|
|
|
|
tests += extract_hardlink_node
|
|
|
|
total != echo $(tests) | wc -w | awk '{ print $$1 }'
|
|
|
|
.PHONY: test
|
|
test: $(tests) output
|
|
@echo -e "\n\t=== \e[0;33mRunning $(total) tests\e[0m ===\n"
|
|
@idx=1 ; success=0 ; fail=0; skip=0; for t in $(tests) ; \
|
|
do printf "[%02i/$(total)] %-25s" $${idx} $${t} ; \
|
|
idx=$$(expr $${idx} + 1) ; \
|
|
./$${t} ; \
|
|
retval=$$? ; \
|
|
if [ $${retval} -eq 0 ] ; \
|
|
then echo -e '\e[0;32mSuccess\e[0m' ; \
|
|
success=$$(expr $${success} + 1) ; \
|
|
elif [ $${retval} -eq 255 ] ; \
|
|
then echo Skipped ; \
|
|
skip=$$(expr $${skip} + 1) ; \
|
|
else echo -e '\e[0;31mFailure\e[0m' ; \
|
|
fail=$$(expr $${fail} + 1) ; \
|
|
fi ; done || true ; \
|
|
if [ $${fail} == 0 ] ; \
|
|
then echo -e '\nResults: \e[0;32mOk\e[0m.' "$${success} succeeded; $${fail} failed; $${skip} skipped" ; \
|
|
else echo -e '\nResults: \e[0;31mFAILED\e[0m.' "$${success} succeeded; $${fail} failed; $${skip} skipped" ; \
|
|
fi
|
|
|
|
output:
|
|
@ [-d $@ ] 2>/dev/null || install -d $@
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf $(tests) output/*
|