From c07eaf8a9e097eb0f40a389129060f77db28001d Mon Sep 17 00:00:00 2001 From: Dmitry Mikhirev Date: Sat, 15 Nov 2014 00:05:45 +0300 Subject: tests robustification --- GNUmakefile | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 038399c..fb71c7f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,39 +5,26 @@ tests = test001 test002 test003 -load pcre.so -.PHONY: check $(tests) clean +.PHONY: check clean -pcre.so: CFLAGS += -I$(MAKE_INCLUDE_DIR) pcre.so: CFLAGS += $(shell pcre-config --cflags) pcre.so: LDFLAGS += $(shell pcre-config --libs) pcre.so: pcre.c - $(CC) $(CFLAGS) -fPIC $(LDFLAGS) -shared -o $@ $< + $(CC) $(CPPFLAGS) $(CFLAGS) -I$(MAKE_INCLUDE_DIR) -fPIC $(LDFLAGS) -shared -o $@ $< check: $(tests) -test001: - @if [ '$(m ^test$,test)' = test ] ; then \ - echo '$@ PASSED'; \ - else \ - echo '$@ FAILED'; \ - return 1; \ - fi - -test002: var = st -test002: - @if [ '$(m ^te$(var)$$,test,e)' = test ] ; then \ - echo '$@ PASSED'; \ - else \ - echo '$@ FAILED'; \ - return 1; \ - fi +test001 = '$(m ^test$,test)' = test +test002: var = es +test002 = '$(m ^t$(var)t$$,test,e)' = test +test003 = '$(m ^t(es)t$,test)$0$1' = testtestes -a -z '$(m a,b)$0$1' -test003: - @if [ '$(m te(st),test)$0$1' = testtestst -a -z '$(m a,b)$0$1' ] ; then \ - echo '$@ PASSED'; \ +test%: + @if [ $($@) ] ; then \ + echo '$@ PASSED'; \ else \ - echo '$@ FAILED'; \ - return 1; \ + echo '$@ FAILED'; \ + return 1; \ fi clean: -- cgit v1.2.1