aboutsummaryrefslogtreecommitdiff
path: root/Test.mk
diff options
context:
space:
mode:
authorRajagopal Venkat <rajagopal.venkat@linaro.org>2012-07-02 19:38:40 +0530
committerhongbo.zhang <hongbo.zhang@linaro.com>2012-11-28 17:10:56 +0800
commita206193ee42984daa5b6badd2e39d8f49d8ba17b (patch)
tree6cdc25936bb74f726500920c99dbaff9e53195ad /Test.mk
parent120624474f0e6da80add1bb8a79f038e3532f545 (diff)
pm-qa: run sanity check before running test cases
run sanity test for each functionality if present. If functionality enabled, then run all respective test cases. This patch also adds sanity checks for cpuidle and sched_mc. Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Diffstat (limited to 'Test.mk')
-rw-r--r--Test.mk17
1 files changed, 14 insertions, 3 deletions
diff --git a/Test.mk b/Test.mk
index 1d69d7a..76f79b5 100644
--- a/Test.mk
+++ b/Test.mk
@@ -21,15 +21,22 @@
# Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation)
# - initial API and implementation
#
-
-TST=$(wildcard *.sh)
+SNT=$(wildcard *sanity.sh)
+TST=$(wildcard *[^(sanity)].sh)
LOG=$(TST:.sh=.log)
CFLAGS?=-g -Wall -pthread
CC?=gcc
SRC=$(wildcard *.c)
EXEC=$(SRC:%.c=%)
-check: uncheck $(EXEC) $(LOG)
+check: run_tests
+
+SANITY_STATUS:= $(shell if test $(SNT) && test -f $(SNT); then \
+ ./$(SNT); if test "$$?" -eq 0; then echo 0; else \
+ echo 1; fi; else echo 1; fi)
+
+ifeq "$(SANITY_STATUS)" "1"
+run_tests: uncheck $(EXEC) $(LOG)
%.log: %.sh
@echo "###"
@@ -38,6 +45,10 @@ check: uncheck $(EXEC) $(LOG)
@echo -n "### "; grep "URL :" ./$< | awk '/http/{print $$NF}'
@echo "###"
@./$< 2> $@
+else
+run_tests: $(SNT)
+ @cat $(<:.sh=.txt)
+endif
clean:
rm -f *.o $(EXEC)