[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 | # |
---|
[831da18] | 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/' |
---|
[3c30b59] | 16 | |
---|
[2d56f83] | 17 | include abac.mk |
---|
[3c30b59] | 18 | |
---|
[2d56f83] | 19 | MY_SH_ENV = env $(ABAC_BUILD_CREDDY_VAL) $(ABAC_BUILD_PROVER_VAL) |
---|
| 20 | MY_PY_ENV = env $(ABAC_BUILD_PROVER_VAL) $(ABAC_BUILD_PYTHON_VAL) |
---|
| 21 | MY_PL_ENV = env $(ABAC_BUILD_PERL_VAL) |
---|
[3c30b59] | 22 | |
---|
| 23 | DIRECTORY = example_scripts python_tests scaling_tests \ |
---|
| 24 | creddy_tests creddy_prover_tests attr_tests |
---|
| 25 | |
---|
[1afd681] | 26 | SUBDIRS = $(DIRECTORY) |
---|
| 27 | |
---|
[2d56f83] | 28 | .PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env |
---|
| 29 | all: tests |
---|
[3c30b59] | 30 | |
---|
| 31 | tests: |
---|
[2d56f83] | 32 | @for i in $(DIRECTORY); do \ |
---|
| 33 | here=`pwd`; \ |
---|
[a1631e7] | 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)"; \ |
---|
[2d56f83] | 39 | cd $$i; \ |
---|
[831da18] | 40 | make -i -s runcheck | tee -a $$here/result; \ |
---|
[2d56f83] | 41 | cd $$here; \ |
---|
| 42 | done |
---|
| 43 | |
---|
| 44 | tests_with_install: |
---|
[3c30b59] | 45 | @touch result |
---|
| 46 | @for i in $(DIRECTORY); do \ |
---|
[2d56f83] | 47 | export TESTDIR=$(abs_top_builddir)/tests; \ |
---|
[a1631e7] | 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)"; \ |
---|
[3c30b59] | 51 | here=`pwd`; \ |
---|
| 52 | cd $$i; \ |
---|
[831da18] | 53 | make -i -s runcheck | tee -a $$here/result; \ |
---|
[3c30b59] | 54 | cd $$here; \ |
---|
| 55 | done |
---|
| 56 | |
---|
[2d56f83] | 57 | |
---|
[3c30b59] | 58 | check_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 | |
---|
| 67 | check_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 | |
---|
| 76 | check_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 | |
---|
| 86 | clean: |
---|
[2d56f83] | 87 | @export TESTDIR=$(abs_top_builddir)/tests; \ |
---|
[3c30b59] | 88 | for i in $(DIRECTORY); do \ |
---|
| 89 | here=`pwd`; \ |
---|
| 90 | cd $$i; \ |
---|
[2d56f83] | 91 | make -s clean; \ |
---|
[3c30b59] | 92 | cd $$here; \ |
---|
| 93 | done |
---|
[2d56f83] | 94 | rm -rf result |
---|
[3c30b59] | 95 | rm -rf test_util.pyc |
---|
| 96 | |
---|
| 97 | clean-local: |
---|
[2d56f83] | 98 | rm -rf result |
---|
[3c30b59] | 99 | rm -rf test_util.pyc |
---|