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
RevLine 
[3c30b59]1
2#
3# tests directory for libabac
4#
[1bf0f03]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,
[2d56f83]9#    make tests_with_install
10# will force the testing to be run with install directory
[1bf0f03]11#
[3c30b59]12
[2d56f83]13include abac.mk
[3c30b59]14
[2d56f83]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)
[3c30b59]18
19DIRECTORY = example_scripts python_tests scaling_tests \
20          creddy_tests creddy_prover_tests attr_tests
21
[1afd681]22SUBDIRS = $(DIRECTORY)
23
[2d56f83]24.PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env
25all: tests
[3c30b59]26
27tests:
[2d56f83]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:
[3c30b59]40        @touch result
41        @for i in $(DIRECTORY); do \
[2d56f83]42          export TESTDIR=$(abs_top_builddir)/tests; \
[3c30b59]43          here=`pwd`; \
44          cd $$i; \
45          make -s runcheck | tee -a $$here/result; \
46          cd $$here; \
47        done
48
[2d56f83]49
[3c30b59]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:
[2d56f83]79        @export TESTDIR=$(abs_top_builddir)/tests; \
[3c30b59]80        for i in $(DIRECTORY); do \
81          here=`pwd`; \
82          cd $$i; \
[2d56f83]83          make -s clean; \
[3c30b59]84          cd $$here; \
85        done
[2d56f83]86        rm -rf result
[3c30b59]87        rm -rf test_util.pyc
88
89clean-local:
[2d56f83]90        rm -rf result
[3c30b59]91        rm -rf test_util.pyc
Note: See TracBrowser for help on using the repository browser.