source: tests/Makefile.am @ 3f21704

abac0-leak
Last change on this file since 3f21704 was 831da18, checked in by Mei <mei@…>, 11 years ago

1) getting ready to for 0.1.6

  • Property mode set to 100644
File size: 2.6 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# special note: for Cento5 machines that is tightly coupled with
13# python 2.4, need to sed out the invocation python to python2.6
14# (the required version) with
15# find . -type f -print | xargs sed -i 's/env python$/env python2.6/'
16
17include abac.mk
18
19MY_SH_ENV = env $(ABAC_BUILD_CREDDY_VAL) $(ABAC_BUILD_PROVER_VAL)
20MY_PY_ENV = env $(ABAC_BUILD_PROVER_VAL) $(ABAC_BUILD_PYTHON_VAL)
21MY_PL_ENV = env $(ABAC_BUILD_PERL_VAL)
22
23DIRECTORY = example_scripts python_tests scaling_tests \
24          creddy_tests creddy_prover_tests attr_tests
25
26SUBDIRS = $(DIRECTORY)
27
28.PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env
29all: tests
30
31tests:
32        @for i in $(DIRECTORY); do \
33          here=`pwd`; \
34          export RUN_WITH_BUILD=1; \
35          export TESTDIR=$(abs_top_builddir)/tests; \
36          export MY_ENV="$(MY_BUILD_ENV)"; \
37          export MY_LDFLAGS_VAL="$(ABAC_BUILD_LDFLAGS_VAL)"; \
38          export MY_INCLUDES_VAL="$(ABAC_BUILD_INCLUDES_VAL)"; \
39          cd $$i; \
40          make -i -s runcheck | tee -a $$here/result; \
41          cd $$here; \
42        done
43
44tests_with_install:
45        @touch result
46        @for i in $(DIRECTORY); do \
47          export TESTDIR=$(abs_top_builddir)/tests; \
48          export MY_ENV="$(MY_INSTALL_ENV)"; \
49          export MY_LDFLAGS_VAL="$(ABAC_INSTALL_LDFLAGS_VAL)"; \
50          export MY_INCLUDES_VAL="$(ABAC_INSTALL_INCLUDES_VAL)"; \
51          here=`pwd`; \
52          cd $$i; \
53          make -i -s runcheck | tee -a $$here/result; \
54          cd $$here; \
55        done
56
57
58check_sh_env:
59        @rc=`$(MY_SH_ENV) ./test_util.sh`; \
60        if [ $$? -eq 0 ]; then \
61          echo "sh_env, okay"; \
62        else \
63          echo "sh_env, not okay"; \
64          echo "perhap you did not configure&build libabac's c api??"; \
65        fi
66
67check_py_env:
68        @rc=`$(MY_PY_ENV) ./test_util.py`; \
69        if [ $$? -eq 0 ]; then \
70          echo "py_env, okay"; \
71        else \
72          echo "py_env, not okay"; \
73          echo "perhap you did not configure&build libabac's swig/python api??"; \
74        fi
75
76check_pl_env:
77        @rc=`$(MY_PL_ENV) ./test_util.pl`; \
78        if [ $$? -eq 0 ]; then \
79          echo "pl_env, okay"; \
80        else \
81          echo "pl_env, not okay"; \
82          echo "perhap you did not configure&build libabac's swig/perl api??"; \
83        fi
84       
85       
86clean:
87        @export TESTDIR=$(abs_top_builddir)/tests; \
88        for i in $(DIRECTORY); do \
89          here=`pwd`; \
90          cd $$i; \
91          make -s clean; \
92          cd $$here; \
93        done
94        rm -rf result
95        rm -rf test_util.pyc
96
97clean-local:
98        rm -rf result
99        rm -rf test_util.pyc
Note: See TracBrowser for help on using the repository browser.