Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 1 | # |
Daniel Lezcano | 35fb172 | 2011-10-03 13:56:11 +0200 | [diff] [blame] | 2 | # PM-QA validation test suite for the power management on Linux |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 3 | # |
| 4 | # Copyright (C) 2011, Linaro Limited. |
| 5 | # |
| 6 | # This program is free software; you can redistribute it and/or |
| 7 | # modify it under the terms of the GNU General Public License |
| 8 | # as published by the Free Software Foundation; either version 2 |
| 9 | # of the License, or (at your option) any later version. |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | # |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 19 | # |
| 20 | # Contributors: |
| 21 | # Daniel Lezcano <daniel.lezcano@linaro.org> (IBM Corporation) |
| 22 | # - initial API and implementation |
| 23 | # |
Rajagopal Venkat | a206193 | 2012-07-02 19:38:40 +0530 | [diff] [blame^] | 24 | SNT=$(wildcard *sanity.sh) |
| 25 | TST=$(wildcard *[^(sanity)].sh) |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 26 | LOG=$(TST:.sh=.log) |
zhanghongbo | 4416a52 | 2012-05-10 17:38:54 +0800 | [diff] [blame] | 27 | CFLAGS?=-g -Wall -pthread |
Daniel Lezcano | 3dd53ee | 2012-04-05 14:03:08 +0200 | [diff] [blame] | 28 | CC?=gcc |
| 29 | SRC=$(wildcard *.c) |
| 30 | EXEC=$(SRC:%.c=%) |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 31 | |
Rajagopal Venkat | a206193 | 2012-07-02 19:38:40 +0530 | [diff] [blame^] | 32 | check: run_tests |
| 33 | |
| 34 | SANITY_STATUS:= $(shell if test $(SNT) && test -f $(SNT); then \ |
| 35 | ./$(SNT); if test "$$?" -eq 0; then echo 0; else \ |
| 36 | echo 1; fi; else echo 1; fi) |
| 37 | |
| 38 | ifeq "$(SANITY_STATUS)" "1" |
| 39 | run_tests: uncheck $(EXEC) $(LOG) |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 40 | |
| 41 | %.log: %.sh |
| 42 | @echo "###" |
| 43 | @echo "### $(<:.sh=):" |
| 44 | @echo -n "### "; cat $(<:.sh=.txt); |
| 45 | @echo -n "### "; grep "URL :" ./$< | awk '/http/{print $$NF}' |
| 46 | @echo "###" |
| 47 | @./$< 2> $@ |
Rajagopal Venkat | a206193 | 2012-07-02 19:38:40 +0530 | [diff] [blame^] | 48 | else |
| 49 | run_tests: $(SNT) |
| 50 | @cat $(<:.sh=.txt) |
| 51 | endif |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 52 | |
| 53 | clean: |
Daniel Lezcano | 3dd53ee | 2012-04-05 14:03:08 +0200 | [diff] [blame] | 54 | rm -f *.o $(EXEC) |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 55 | |
Daniel Lezcano | 3dd53ee | 2012-04-05 14:03:08 +0200 | [diff] [blame] | 56 | uncheck: |
| 57 | -@test ! -z "$(LOG)" && rm -f $(LOG) |
Daniel Lezcano | beaf794 | 2011-09-22 16:19:39 +0200 | [diff] [blame] | 58 | |
| 59 | recheck: uncheck check |