Add/update tests.
[eruntime.git] / tests / Makefile
blob7b1851051e37a4b9f39402346d786d950373b567
1 topdir = ..
2 include $(topdir)/Makefile.top
4 all_test_NAMES = list version
5 all_test_SOURCES = $(addprefix test-,$(addsuffix .c,$(all_test_NAMES)))
7 all_TESTS = $(addsuffix .test, $(all_test_NAMES))
8 run_TESTS ?= $(all_TESTS)
10 .PHONY: all
11 all: $(all_TESTS)
13 .PHONY: deps
14 deps:
15 $(MKDEPS) $(CC) '$(CFLAGS)' '$(all_test_SOURCES)'
17 %.test: test-%.c
18 $(call wrap_LD,$@,$<,$(CFLAGS) -L$(topdir)/src -leruntime)
20 .PHONY: check
21 check: $(run_TESTS)
22 @echo; list='$^'; \
23 export LD_LIBRARY_PATH='$(topdir)/src'; \
24 for test in $$list; do \
25 unit=$$(echo $$test |sed s/.test$$//); \
26 echo -e "\\n=== Testing unit: $$unit\\n"; \
27 if $$PWD/$$test; then \
28 s=passed; \
29 else \
30 s=failed; \
31 fi; \
32 echo -ne "\\nUnit $$unit $$s\\n"; \
33 done
35 .PHONY: clean
36 clean:
37 -rm -f $(all_TESTS)
39 -include Makefile.deps
41 # vim: ts=8 sw=8 noet fdm=marker tw=80