source: tests/python_tests/Makefile.am @ 2d56f83

abac0-leakabac0-mei
Last change on this file since 2d56f83 was 2d56f83, checked in by Mei <mei@…>, 11 years ago

1) overhaul the tests directory that now we can regression test against
a build directory or a installed setup

  • Property mode set to 100644
File size: 1.7 KB
Line 
1#
2# python_tests
3#
4
5include  ${TESTDIR}/abac.mk
6
7EXPECTED_OKAY=11
8
9DIRECTORY=acme_rockets_intersection_rt0 acme_rockets_rt0 experiment_create_rt0
10OTHER=basic_attribute basic_id
11
12.PHONY: clean-local runcheck clean
13all: runcheck
14
15clean:
16        @for i in $(DIRECTORY); do \
17          here=`pwd`; \
18          cd $$i; \
19          rm -rf *.pem *.xml; \
20          cd $$here; \
21        done
22        @(cd basic_id; rm -rf *.pem *.xml)
23        @(cd basic_attribute; rm -rf *.pem *.xml)
24        @rm -rf result error
25
26runcheck :
27        @touch error
28        @echo 'running libabac PYTHON testing...' | tee result
29        @make clean
30        @for i in $(DIRECTORY); do \
31          here=`pwd`; \
32          cd $$i; \
33          printf "\n ==> RUN on %s\n" "$$i" >> $$here/result ; \
34          $(MY_ENV) ./setup.py 1>/dev/null 2>&1; \
35          $(MY_ENV) ./attr.py 1>/dev/null 2>&1; \
36          $(MY_ENV) ./query.py |tee -a $$here/result |grep BAD >> $$here/error; \
37          cd $$here; \
38        done
39        make ids
40        make attrs
41        @if test -f error ; \
42          then \
43            (if test `cat error | wc -l ` -eq 0 ; \
44              then \
45                (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
46                  then echo "   PASSED!!!"; \
47                  else echo "   ERROR, no error but not enough good results!!!"; \
48                fi); \
49              else (echo "   ERROR!!!"; cat error;); \
50            fi); \
51          else echo "   PASSED"; \
52        fi
53
54ids:
55        @printf "\n ==> RUN on basic_id\n" >> result
56        @(cd basic_id; \
57        $(MY_ENV) ./setup.py 1>/dev/null 2>&1; \
58        $(MY_ENV) ./query.py |tee -a ../result |grep BAD >> ../error; \
59        cd ..)
60
61attrs:
62        @printf "\n ==> RUN on basic_attr\n" >> result
63        @(cd basic_attribute; \
64        $(MY_ENV) ./setup.py 1>/dev/null 2>&1; \
65        $(MY_ENV) ./query.py |tee -a ../result |grep BAD >> ../error; \
66        cd ..)
67
68clean-local:
69        @rm -rf result error
Note: See TracBrowser for help on using the repository browser.