[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] | 13 | include abac.mk |
---|
[3c30b59] | 14 | |
---|
[2d56f83] | 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) |
---|
[3c30b59] | 18 | |
---|
| 19 | DIRECTORY = example_scripts python_tests scaling_tests \ |
---|
| 20 | creddy_tests creddy_prover_tests attr_tests |
---|
| 21 | |
---|
[1afd681] | 22 | SUBDIRS = $(DIRECTORY) |
---|
| 23 | |
---|
[2d56f83] | 24 | .PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env |
---|
| 25 | all: tests |
---|
[3c30b59] | 26 | |
---|
| 27 | tests: |
---|
[2d56f83] | 28 | @for i in $(DIRECTORY); do \ |
---|
| 29 | here=`pwd`; \ |
---|
[a1631e7] | 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)"; \ |
---|
[2d56f83] | 35 | cd $$i; \ |
---|
| 36 | make -s runcheck | tee -a $$here/result; \ |
---|
| 37 | cd $$here; \ |
---|
| 38 | done |
---|
| 39 | |
---|
| 40 | tests_with_install: |
---|
[3c30b59] | 41 | @touch result |
---|
| 42 | @for i in $(DIRECTORY); do \ |
---|
[2d56f83] | 43 | export TESTDIR=$(abs_top_builddir)/tests; \ |
---|
[a1631e7] | 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)"; \ |
---|
[3c30b59] | 47 | here=`pwd`; \ |
---|
| 48 | cd $$i; \ |
---|
| 49 | make -s runcheck | tee -a $$here/result; \ |
---|
| 50 | cd $$here; \ |
---|
| 51 | done |
---|
| 52 | |
---|
[2d56f83] | 53 | |
---|
[3c30b59] | 54 | check_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 | |
---|
| 63 | check_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 | |
---|
| 72 | check_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 | |
---|
| 82 | clean: |
---|
[2d56f83] | 83 | @export TESTDIR=$(abs_top_builddir)/tests; \ |
---|
[3c30b59] | 84 | for i in $(DIRECTORY); do \ |
---|
| 85 | here=`pwd`; \ |
---|
| 86 | cd $$i; \ |
---|
[2d56f83] | 87 | make -s clean; \ |
---|
[3c30b59] | 88 | cd $$here; \ |
---|
| 89 | done |
---|
[2d56f83] | 90 | rm -rf result |
---|
[3c30b59] | 91 | rm -rf test_util.pyc |
---|
| 92 | |
---|
| 93 | clean-local: |
---|
[2d56f83] | 94 | rm -rf result |
---|
[3c30b59] | 95 | rm -rf test_util.pyc |
---|