source: tests/Makefile.am @ a1631e7

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

1) make the tests_with_install case work with BSD's make,
it differs from GNU's make in how conditionals are defined. So, replace
that with explicit 'export' call isolated to different types of tests

  • Property mode set to 100644
File size: 2.4 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        @for i in $(DIRECTORY); do \
29          here=`pwd`; \
30          export RUN_WITH_BUILD=1; \
31          export TESTDIR=$(abs_top_builddir)/tests; \
32          export MY_ENV="$(MY_BUILD_ENV)"; \
33          export MY_LDFLAGS_VAL="$(ABAC_BUILD_LDFLAGS_VAL)"; \
34          export MY_INCLUDES_VAL="$(ABAC_BUILD_INCLUDES_VAL)"; \
35          cd $$i; \
36          make -s runcheck | tee -a $$here/result; \
37          cd $$here; \
38        done
39
40tests_with_install:
41        @touch result
42        @for i in $(DIRECTORY); do \
43          export TESTDIR=$(abs_top_builddir)/tests; \
44          export MY_ENV="$(MY_INSTALL_ENV)"; \
45          export MY_LDFLAGS_VAL="$(ABAC_INSTALL_LDFLAGS_VAL)"; \
46          export MY_INCLUDES_VAL="$(ABAC_INSTALL_INCLUDES_VAL)"; \
47          here=`pwd`; \
48          cd $$i; \
49          make -s runcheck | tee -a $$here/result; \
50          cd $$here; \
51        done
52
53
54check_sh_env:
55        @rc=`$(MY_SH_ENV) ./test_util.sh`; \
56        if [ $$? -eq 0 ]; then \
57          echo "sh_env, okay"; \
58        else \
59          echo "sh_env, not okay"; \
60          echo "perhap you did not configure&build libabac's c api??"; \
61        fi
62
63check_py_env:
64        @rc=`$(MY_PY_ENV) ./test_util.py`; \
65        if [ $$? -eq 0 ]; then \
66          echo "py_env, okay"; \
67        else \
68          echo "py_env, not okay"; \
69          echo "perhap you did not configure&build libabac's swig/python api??"; \
70        fi
71
72check_pl_env:
73        @rc=`$(MY_PL_ENV) ./test_util.pl`; \
74        if [ $$? -eq 0 ]; then \
75          echo "pl_env, okay"; \
76        else \
77          echo "pl_env, not okay"; \
78          echo "perhap you did not configure&build libabac's swig/perl api??"; \
79        fi
80       
81       
82clean:
83        @export TESTDIR=$(abs_top_builddir)/tests; \
84        for i in $(DIRECTORY); do \
85          here=`pwd`; \
86          cd $$i; \
87          make -s clean; \
88          cd $$here; \
89        done
90        rm -rf result
91        rm -rf test_util.pyc
92
93clean-local:
94        rm -rf result
95        rm -rf test_util.pyc
Note: See TracBrowser for help on using the repository browser.