Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -7,20 +7,13 @@
 # to install directory is available..
 # In that case, the call,
-#    env TEST_INSTALL=true make testing
-# will force the test to be run with install directory
+#    make tests_with_install
+# will force the testing to be run with install directory
 #
 
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
+include abac.mk
 
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-PERL_ENV = PERLLIB=$(abs_top_builddir)/swig/perl:$(abs_top_builddir)/swig/perl/.libs
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-
-MY_SH_ENV = env $(CREDDY_ENV) $(PROVER_ENV) 
-MY_PY_ENV = env $(PROVER_ENV) $(PYTHON_ENV)
-MY_PL_ENV = env $(PERL_ENV)
+MY_SH_ENV = env $(ABAC_BUILD_CREDDY_VAL) $(ABAC_BUILD_PROVER_VAL) 
+MY_PY_ENV = env $(ABAC_BUILD_PROVER_VAL) $(ABAC_BUILD_PYTHON_VAL)
+MY_PL_ENV = env $(ABAC_BUILD_PERL_VAL)
 
 DIRECTORY = example_scripts python_tests scaling_tests \
@@ -29,10 +22,13 @@
 SUBDIRS = $(DIRECTORY)
 
-.PHONY: clean clean-local check_sh_env check_py_env tests
-all: check_pl_env check_sh_env check_py_env tests
+.PHONY: tests tests_with_install clean clean-local check_sh_env check_py_env 
+all: tests
 
 tests:
-	@touch result
+	@export RUN_WITH_BUILD=1
+	@export TESTDIR=$(abs_top_builddir)/tests
 	@for i in $(DIRECTORY); do \
+	  export RUN_WITH_BUILD=1; \
+	  export TESTDIR=$(abs_top_builddir)/tests; \
 	  here=`pwd`; \
 	  cd $$i; \
@@ -40,4 +36,15 @@
 	  cd $$here; \
 	done
+
+tests_with_install:
+	@touch result
+	@for i in $(DIRECTORY); do \
+	  export TESTDIR=$(abs_top_builddir)/tests; \
+	  here=`pwd`; \
+	  cd $$i; \
+	  make -s runcheck | tee -a $$here/result; \
+	  cd $$here; \
+	done
+
 
 check_sh_env:
@@ -70,14 +77,15 @@
 	
 clean:
+	@export TESTDIR=$(abs_top_builddir)/tests; \
 	for i in $(DIRECTORY); do \
 	  here=`pwd`; \
 	  cd $$i; \
-	  make clean; \
+	  make -s clean; \
 	  cd $$here; \
 	done
-	rm -rf result error
+	rm -rf result
 	rm -rf test_util.pyc
 
 clean-local:
-	rm -rf result error
+	rm -rf result
 	rm -rf test_util.pyc
Index: tests/abac.mk
===================================================================
--- tests/abac.mk	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
+++ tests/abac.mk	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -0,0 +1,32 @@
+#
+# abac.mk
+#
+ABAC_BUILD_CREDDY_VAL = CREDDY_LOCATION=$(abs_top_builddir)/creddy
+ABAC_BUILD_PROVER_VAL = PROVER_LOCATION=$(abs_top_builddir)/libabac
+ABAC_BUILD_PYTHON_VAL = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
+ABAC_BUILD_PERL_VAL = PERLLIB=$(abs_top_builddir)/swig/perl:$(abs_top_builddir)/swig/perl/.libs
+ABAC_BUILD_INCLUDES_VAL = -I$(abs_top_srcdir)/libabac
+ABAC_BUILD_LDFLAGS_VAL = -L$(abs_top_srcdir)/libabac/.libs -labac -lm -lpthread -Wl,-rpath
+
+ABAC_INSTALL_CREDDY_VAL = CREDDY_LOCATION=$(bindir)
+ABAC_INSTALL_PROVER_VAL = PROVER_LOCATION=$(bindir)
+ABAC_INSTALL_PYTHON_VAL = PYTHONPATH=$(pythondir):$(abs_top_builddir)/tests
+ABAC_INSTALL_PERL_VAL = PERLLIB=$(SITE_PERL)
+ABAC_INSTALL_INCLUDES_VAL = -I$(includedir)
+ABAC_INSTALL_LDFLAGS_VAL = -L$(libdir) -labac -lm -lpthread -Wl,-rpath
+
+TESTDIR = $(abs_top_builddir)/tests
+
+MY_LDFLAGS_VAL=$(if $(RUN_WITH_BUILD),$(ABAC_BUILD_LDFLAGS_VAL),$(ABAC_INSTALL_LDFLAGS_VAL))
+
+MY_INCLUDES_VAL=$(if $(RUN_WITH_BUILD),$(ABAC_BUILD_INCLUDES_VAL),$(ABAC_INSTALL_INCLUDES_VAL))
+
+MY_BUILD_ENV=env $(ABAC_BUILD_CREDDY_VAL) $(ABAC_BUILD_PROVER_VAL) $(ABAC_BUILD_PYTHON_VAL) $(ABAC_BUILD_PERL_VAL)
+
+MY_INSTALL_ENV=env $(ABAC_INSTALL_CREDDY_VAL) $(ABAC_INSTALL_PROVER_VAL) $(ABAC_INSTALL_PYTHON_VAL) $(ABAC_INSTALL_PERL_VAL)
+
+MY_ENV=$(if $(RUN_WITH_BUILD), $(MY_BUILD_ENV), $(MY_INSTALL_ENV))
+
+
+
+
Index: tests/attr_tests/Makefile.am
===================================================================
--- tests/attr_tests/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/attr_tests/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,14 +3,10 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
+EXPECTED_OKAY=3
+
 .PHONY: runcheck clean-local setup
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV)
-
-all:runcheck
+all: runcheck
 
 runcheck: setup.sh
@@ -19,11 +15,15 @@
 	@touch error
 	@$(MY_ENV) ./setup.sh 
-	@($(MY_ENV) ./show.sh |tee -a result |grep BAD >> ../error; cd .)
+	@($(MY_ENV) ./show.sh |tee -a result |grep BAD >> error; cd .)
 	@if test -f error ; \
-	  then \
-	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
-	      else (echo "   ERROR!!!"; cat error;); \
-	    fi); \
+          then \
+            (if test `cat error | wc -l ` -eq 0 ; \
+              then \
+                (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+                  then echo "   PASSED!!!"; \
+                  else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
+              else (echo "   ERROR!!!"; cat error;); \
+            fi); \
 	  else echo "   PASSED"; \
 	fi
Index: tests/creddy_prover_tests/Makefile.am
===================================================================
--- tests/creddy_prover_tests/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/creddy_prover_tests/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,18 +2,16 @@
 # creddy_prover_tests
 #
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV)
+
+include  ${TESTDIR}/abac.mk
+
+EXPECTED_OKAY=14
 
 DIRECTORY=acme_rockets_intersection_rt0 acme_rockets_rt0 \
           experiment_create_rt0 ice_cream_rt0
 
-.PHONY : clean clean-local runcheck
+.PHONY: clean clean-local runcheck
 all: runcheck
 
-runcheck :
+runcheck:
 	@echo 'running libabac CREDDY_PROVER testing...' | tee result
 	@touch error
@@ -27,14 +25,17 @@
 	done
 	@if test -f error ; \
-	  then \
-	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
-	      else (echo "   ERROR!!!"; cat error;) \
-	    fi) \
-	  else echo "   PASSED"; \
-	fi
+          then \
+            (if test `cat error | wc -l ` -eq 0 ; \
+              then \
+                (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+                  then echo "   PASSED!!!"; \
+                  else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
+              else (echo "   ERROR!!!"; cat error;); \
+            fi); \
+          else echo "   PASSED"; \
+        fi
 
-
-clean :
+clean:
 	@for i in $(DIRECTORY); do \
 	  here=`pwd`; \
Index: tests/creddy_tests/Makefile.am
===================================================================
--- tests/creddy_tests/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/creddy_tests/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,13 +2,10 @@
 # creddy_tests
 #
+include  ${TESTDIR}/abac.mk
+
+EXPECTED_OKAY=50
+all: runcheck
 
 .PHONY: runcheck clean-local setup
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV)
 
 SCRIPT=verify roles attribute keyid generate display attribute_rule 
@@ -24,12 +21,15 @@
 	done
 	@if test -f error ; \
-	  then \
-	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
-	      else (echo "   ERROR!!!"; cat error;) \
-	    fi) \
-	  else echo "   PASSED"; \
-	fi
-
+          then \
+            (if test `cat error | wc -l ` -eq 0 ; \
+              then \
+                (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+                  then echo "   PASSED!!!"; \
+                  else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
+              else (echo "   ERROR!!!"; cat error;); \
+            fi); \
+          else echo "   PASSED"; \
+        fi
 
 clean:
Index: tests/example_scripts/Makefile.am
===================================================================
--- tests/example_scripts/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,15 +2,15 @@
 # example_scripts
 #
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
+
+EXPECTED_OKAY = 23
 
 DIRECTORY = c perl python wiki
 SUBDIRS = $(DIRECTORY)
 
-.PHONY : runcheck clean-local
-
+.PHONY : runcheck clean-local clean
 all: runcheck
 
 clean-local:
+clean:
 	@for i in $(DIRECTORY); do \
 	  here=`pwd`; \
@@ -34,5 +34,9 @@
 	  then \
 	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
+	      then \
+	        (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+	          then echo "   PASSED!!!"; \
+	          else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
 	      else (echo "   ERROR!!!"; cat error;); \
 	    fi); \
Index: tests/example_scripts/c/Makefile.am
===================================================================
--- tests/example_scripts/c/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/c/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,38 +3,31 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: clean-local 
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV) LD_LIBRARY_PATH=$(abs_top_builddir)/libabac/.libs
-
-LDFLAGS =-L$(abs_top_builddir)/libabac/.libs -labac -lm -lpthread -Wl,-rpath
 
 all: attr prove 
 
 abac_attr.o: abac_attr.c
-	@gcc -g $(INCLUDES) -c abac_attr.c -o abac_attr.o
+	gcc -g $(MY_INCLUDES_VAL) -c abac_attr.c -o abac_attr.o
 
 abac_attr: abac_attr.o
-	@gcc -g -o abac_attr abac_attr.o $(LDFLAGS)
+	gcc -g -o abac_attr abac_attr.o $(MY_LDFLAGS_VAL)
 
 abac_prover.o: abac_prover.c
-	@gcc -g $(INCLUDES) -c abac_prover.c -o abac_prover.o
+	gcc -g $(MY_INCLUDES_VAL) -c abac_prover.c -o abac_prover.o
 
 abac_prover: abac_prover.o
-	@gcc -g -o abac_prover abac_prover.o $(LDFLAGS)
+	gcc -g -o abac_prover abac_prover.o $(MY_LDFLAGS_VAL)
 
 tchunk: tchunk.c
-	gcc -g $(INCLUDES) -c tchunk.c -o tchunk.o
-	gcc -g -o tchunk tchunk.o $(LDFLAGS)
+	gcc -g $(MY_INCLUDES_VAL) -c tchunk.c -o tchunk.o
+	gcc -g -o tchunk tchunk.o $(MY_LDFLAGS_VAL)
 	./tchunk 0 IceCream_ID.pem IceCream_private.pem
 	./tchunk 1 IceCream_ID.pem IceCream_private.pem
 
 tt: tbasic.c
-	gcc -g $(INCLUDES) -c tbasic.c -o tbasic.o
-	gcc -g -o tt tbasic.o $(LDFLAGS)
+	gcc -g $(MY_INCLUDES_VAL) -c tbasic.c -o tbasic.o
+	gcc -g -o tt tbasic.o $(MY_LDFLAGS_VAL)
 	./tt
 
@@ -47,8 +40,8 @@
 
 attr: 
-	@echo '---running (c) attr script'
-	@$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
-	@make abac_attr
-	@(rc=`$(MY_ENV) ./abac_attr IceCream_ID.pem  IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem 2>/dev/null 2>/dev/null | grep "attr success"` ; \
+	echo '---running (c) attr script'
+	$(MY_ENV) ./setup.sh 1>/dev/null 2>&1
+	make abac_attr
+	(rc=`$(MY_ENV) ./abac_attr IceCream_ID.pem  IceCream_private.pem IceCream_attr.xml Chocolate_ID.pem 2>/dev/null 2>/dev/null | grep "attr success"` ; \
 	if [ -z "$$rc" ]; then \
 	  echo "BAD:example_scripts/c/abac_attr:using libabac c to make attributes"; \
@@ -73,5 +66,5 @@
 
 mattr: attr.c
-	gcc -g -o mattr attr.c $(LDFLAGS)
+	gcc -g -o mattr attr.c $(MY_LDFLAGS_VAL)
 mload: loader.c
-	gcc -g -o mload loader.c $(LDFLAGS)
+	gcc -g -o mload loader.c $(MY_LDFLAGS_VAL)
Index: tests/example_scripts/perl/Makefile.am
===================================================================
--- tests/example_scripts/perl/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/perl/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,13 +3,7 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: clean-local
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-PERL_ENV = PERLLIB=$(abs_top_builddir)/swig/perl:$(abs_top_builddir)/swig/perl/.libs
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV) $(PERL_ENV)
 
 all: run bad prove
Index: tests/example_scripts/python/Makefile.am
===================================================================
--- tests/example_scripts/python/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/python/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,14 +3,7 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: clean-local
-
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(PYTHON_ENV) $(TEST_ENV)
 
 all: run_attr run_id run_id2 run_id3 run_prove
Index: tests/example_scripts/wiki/Makefile.am
===================================================================
--- tests/example_scripts/wiki/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/example_scripts/wiki/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,14 +3,7 @@
 #
 
+include  ${TESTDIR}/abac.mk
+
 .PHONY: runcheck clean-local
-
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(PYTHON_ENV) $(TEST_ENV)
-
 
 TESTS=id1 id2 id3 id4 id5 attr1 attr2 attr3 attr4 ctxtQuery1 ctxtQuery2 ctxtQuery3 ctxtQuery4
Index: tests/python_tests/Makefile.am
===================================================================
--- tests/python_tests/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/python_tests/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -3,19 +3,15 @@
 #
 
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-TEST_ENV = TESTDIR=$(abs_top_builddir)/tests
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(TEST_ENV) $(PYTHON_ENV)
+include  ${TESTDIR}/abac.mk
 
-DIRECTORY= acme_rockets_intersection_rt0 acme_rockets_rt0 experiment_create_rt0
+EXPECTED_OKAY=11
+
+DIRECTORY=acme_rockets_intersection_rt0 acme_rockets_rt0 experiment_create_rt0
 OTHER=basic_attribute basic_id 
 
-.PHONY : clean-local runcheck clean
+.PHONY: clean-local runcheck clean
 all: runcheck
 
-clean :
+clean:
 	@for i in $(DIRECTORY); do \
 	  here=`pwd`; \
@@ -44,11 +40,15 @@
 	make attrs
 	@if test -f error ; \
-	  then \
-	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
-	      else (echo "   ERROR!!!"; cat error;) \
-	    fi) \
-	  else echo "   PASSED"; \
-	fi
+          then \
+            (if test `cat error | wc -l ` -eq 0 ; \
+              then \
+                (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+                  then echo "   PASSED!!!"; \
+                  else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
+              else (echo "   ERROR!!!"; cat error;); \
+            fi); \
+          else echo "   PASSED"; \
+        fi
 
 ids:
Index: tests/scaling_tests/Makefile.am
===================================================================
--- tests/scaling_tests/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/scaling_tests/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,4 +2,6 @@
 # scaling_tests
 #
+
+EXPECTED_OKAY=3
 
 DIRECTORY=daisychain
@@ -11,8 +13,6 @@
 
 .PHONY : runcheck clean-local plot clean
-
 all:runcheck
 
-local-clean:
 clean:
 	@for i in $(DIRECTORY); do \
@@ -25,22 +25,30 @@
 	rm -rf jpegs
 
+local-clean:
+	rm -rf error result
+	rm -rf jpegs
+
 runcheck: 
 	@echo 'running libabac SCALING testing...' | tee result
-	touch error
+	@touch error
 	@for i in $(DIRECTORY); do \
 	  here=`pwd`; \
 	  printf "\n ==> RUN on %s\n" "$$i" >> result; \
 	  cd $$i; \
-	  make -s runcheck | tee -a $$here/result |grep BAD >> $$here/error; \
+	  make  runcheck | tee -a $$here/result |grep BAD >> $$here/error; \
 	  cd $$here; \
 	done; 
 	@if test -f error ; \
-	  then \
-	    (if test `cat error | wc -l ` -eq 0 ; \
-	      then echo "   PASSED"; \
-	      else (echo "   ERROR!!!"; cat error;) \
-	    fi) \
-	  else echo "   PASSED"; \
-	fi
+          then \
+            (if test `cat error | wc -l ` -eq 0 ; \
+              then \
+                (if test `grep GOOD result | wc -l ` -eq $(EXPECTED_OKAY) ; \
+                  then echo "   PASSED!!!"; \
+                  else echo "   ERROR, no error but not enough good results!!!"; \
+                fi); \
+              else (echo "   ERROR!!!"; cat error;); \
+            fi); \
+          else echo "   PASSED"; \
+        fi
 
 plot:
Index: tests/scaling_tests/daisychain/Makefile.am
===================================================================
--- tests/scaling_tests/daisychain/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/scaling_tests/daisychain/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,13 +2,12 @@
 # daisychain
 #
-.PHONY : runcheck clean-local
 
 DIRECTORY=likes_python
-
 SUBDIRS=$(DIRECTORY)
 
+.PHONY : runcheck clean
 all: runcheck
 
-clean-local:
+clean:
 	@for i in $(DIRECTORY); do \
 	here=`pwd`; \
@@ -20,7 +19,7 @@
 runcheck: 
 	@for i in $(DIRECTORY); do \
-	here=`pwd`; \
-	cd $$i; \
-	make -s test; \
-	cd $$here;\
+	  here=`pwd`; \
+	  cd $$i; \
+	  make -s test; \
+	  cd $$here;\
 	done;
Index: tests/scaling_tests/daisychain/likes_python/Makefile.am
===================================================================
--- tests/scaling_tests/daisychain/likes_python/Makefile.am	(revision 1bf0f0357330a24d5a3c9b7f2a5d904dac71603c)
+++ tests/scaling_tests/daisychain/likes_python/Makefile.am	(revision 2d56f83c081f3e09645b806a636dfd0f2613fe79)
@@ -2,18 +2,11 @@
 # daisychain/likes_python
 #
-.PHONY : test clean-local
 
-INCLUDES = -I$(abs_top_srcdir)/libabac
-LDADD = $(abs_top_builddir)/libabac/libabac.la
-CREDDY_ENV = CREDDY_LOCATION=$(abs_top_builddir)/creddy
-PROVER_ENV = PROVER_LOCATION=$(abs_top_builddir)/libabac
-PYTHON_ENV = PYTHONPATH=$(abs_top_builddir)/swig/python:$(abs_top_builddir)/swig/python/.libs:$(abs_top_builddir)/tests
-MY_ENV = env $(CREDDY_ENV) $(PROVER_ENV) $(PYTHON_ENV)
+include  ${TESTDIR}/abac.mk
 
 TEST=likes_0 likes_10 likes_20
 TIMING=likes_30 likes_40 likes_50 likes_100 likes_150 likes_200
 
-.PHONY : test timing plot 
-
+.PHONY : test clean timing plot 
 all: test
 
@@ -29,5 +22,5 @@
 	@$(MY_ENV) ./run_one 20
 
-clean-local: 
+clean:
 	@rm -rf likes_* run_plot plot timing
 
