source: 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: 2.1 KB
Line 
1
2#
3# tests directory for libabac
4#
5# default, executable/lib are accessed from build directory but
6# in case where rpm/debian binary packages were used, only access
7# to install directory is available..
8# In that case, the call,
9#    make tests_with_install
10# will force the testing to be run with install directory
11#
12
13include abac.mk
14
15MY_SH_ENV = env $(ABAC_BUILD_CREDDY_VAL) $(ABAC_BUILD_PROVER_VAL)
16MY_PY_ENV = env $(ABAC_BUILD_PROVER_VAL) $(ABAC_BUILD_PYTHON_VAL)
17MY_PL_ENV = env $(ABAC_BUILD_PERL_VAL)
18
19DIRECTORY = example_scripts python_tests scaling_tests \
20          creddy_tests creddy_prover_tests attr_tests
21
22SUBDIRS = $(DIRECTORY)
23
24.PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env
25all: tests
26
27tests:
28        @export RUN_WITH_BUILD=1
29        @export TESTDIR=$(abs_top_builddir)/tests
30        @for i in $(DIRECTORY); do \
31          export RUN_WITH_BUILD=1; \
32          export TESTDIR=$(abs_top_builddir)/tests; \
33          here=`pwd`; \
34          cd $$i; \
35          make -s runcheck | tee -a $$here/result; \
36          cd $$here; \
37        done
38
39tests_with_install:
40        @touch result
41        @for i in $(DIRECTORY); do \
42          export TESTDIR=$(abs_top_builddir)/tests; \
43          here=`pwd`; \
44          cd $$i; \
45          make -s runcheck | tee -a $$here/result; \
46          cd $$here; \
47        done
48
49
50check_sh_env:
51        @rc=`$(MY_SH_ENV) ./test_util.sh`; \
52        if [ $$? -eq 0 ]; then \
53          echo "sh_env, okay"; \
54        else \
55          echo "sh_env, not okay"; \
56          echo "perhap you did not configure&build libabac's c api??"; \
57        fi
58
59check_py_env:
60        @rc=`$(MY_PY_ENV) ./test_util.py`; \
61        if [ $$? -eq 0 ]; then \
62          echo "py_env, okay"; \
63        else \
64          echo "py_env, not okay"; \
65          echo "perhap you did not configure&build libabac's swig/python api??"; \
66        fi
67
68check_pl_env:
69        @rc=`$(MY_PL_ENV) ./test_util.pl`; \
70        if [ $$? -eq 0 ]; then \
71          echo "pl_env, okay"; \
72        else \
73          echo "pl_env, not okay"; \
74          echo "perhap you did not configure&build libabac's swig/perl api??"; \
75        fi
76       
77       
78clean:
79        @export TESTDIR=$(abs_top_builddir)/tests; \
80        for i in $(DIRECTORY); do \
81          here=`pwd`; \
82          cd $$i; \
83          make -s clean; \
84          cd $$here; \
85        done
86        rm -rf result
87        rm -rf test_util.pyc
88
89clean-local:
90        rm -rf result
91        rm -rf test_util.pyc
Note: See TracBrowser for help on using the repository browser.