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 | |
---|
13 | include abac.mk |
---|
14 | |
---|
15 | MY_SH_ENV = env $(ABAC_BUILD_CREDDY_VAL) $(ABAC_BUILD_PROVER_VAL) |
---|
16 | MY_PY_ENV = env $(ABAC_BUILD_PROVER_VAL) $(ABAC_BUILD_PYTHON_VAL) |
---|
17 | MY_PL_ENV = env $(ABAC_BUILD_PERL_VAL) |
---|
18 | |
---|
19 | DIRECTORY = example_scripts python_tests scaling_tests \ |
---|
20 | creddy_tests creddy_prover_tests attr_tests |
---|
21 | |
---|
22 | SUBDIRS = $(DIRECTORY) |
---|
23 | |
---|
24 | .PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env |
---|
25 | all: tests |
---|
26 | |
---|
27 | tests: |
---|
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 | |
---|
39 | tests_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 | |
---|
50 | check_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 | |
---|
59 | check_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 | |
---|
68 | check_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 | |
---|
78 | clean: |
---|
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 | |
---|
89 | clean-local: |
---|
90 | rm -rf result |
---|
91 | rm -rf test_util.pyc |
---|