Module: kamailio
Branch: master
Commit: d1dc67417309400ea458a4d7672d97277b59e5fc
URL:
https://github.com/kamailio/kamailio/commit/d1dc67417309400ea458a4d7672d972…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2015-01-06T21:39:23+01:00
test/unit: Add TESTS vars to control wich tests to exec and exit with error if one fails
---
Modified: test/unit/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/d1dc67417309400ea458a4d7672d972…
Patch:
https://github.com/kamailio/kamailio/commit/d1dc67417309400ea458a4d7672d972…
---
diff --git a/test/unit/Makefile b/test/unit/Makefile
index e914031..83b3dba 100644
--- a/test/unit/Makefile
+++ b/test/unit/Makefile
@@ -1,19 +1,23 @@
# Makefile for running test unit
#
+TESTS_FILES ?= $(wildcard *.sh)
+TESTS_EXCLUDE ?=
+TESTS ?= $(filter-out $(patsubst %,%.sh,$(TESTS_EXCLUDE)), $(TESTS_FILES))
all:
- -@for FILE in $(wildcard *.sh) ; do \
+ @for FILE in $(TESTS) ; do \
if [ -f $$FILE ] ; then \
if [ -x $$FILE ] ; then \
echo "run test `basename $$FILE .sh`:" `head -n 2 "$$FILE" | tail
-n 1 | cut -c 3-` ; \
./$$FILE ; \
ret=$$? ; \
if [ ! "$$ret" -eq 0 ] ; then \
- echo "failed" ; \
+ echo "failed" ; RES=1;\
fi ; \
fi ; \
fi ; \
- done ;
+ done ; \
+ exit $$RES;
run:
-@if [ -f $(UNIT) ] ; then \
@@ -30,4 +34,3 @@ run:
else \
echo "Test unit file $(UNIT): not found" ; \
fi ;
-