https://github.com/trahay/Generic-Trace-Generator/pull/5
---
 test/Makefile |   28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

--- a/test/Makefile
+++ b/test/Makefile
@@ -1,13 +1,20 @@
 LIB=$(LDFLAGS) -lgtg
-INC= -I../install/include/
+GTG_INC = ../inc
+GTG_LIB = ../src/.libs
+INC= -I$(GTG_INC)
 BIN=bin
 CC =mpicc
-LDFLAGS += -L../install/lib
+LDFLAGS += -L$(GTG_LIB)
+LD_LIBRARY_PATH = $(GTG_LIB)
+export LD_LIBRARY_PATH
 #-Wl,-rpath=/home/glaurt7/Bureau/carriere/projets_perso/GTG/gtg/trunk/src/.libs
 
+TESTS = testState testEvent testLink testVar testAll
+MPI_TESTS = testState_parall testEvent_parall testEvent_mpi
+
 .phony	: bin obj
 
-all	: dir testState testEvent testLink testVar testAll testState_parall testEvent_parall testEvent_mpi
+all	: dir $(TESTS) $(MPI_TESTS)
 
 dir	:
 		mkdir -p $(BIN)
@@ -36,5 +43,20 @@ testLink	: testLink.c
 testVar		: testVar.c
 		$(CC) $^ -o $(BIN)/$@ $(CFLAGS) $(INC) $(LIB)
 
+check   : all
+	for i in $(TESTS) ; do \
+		for type in 1 2 ; do \
+			echo running $$i $$type ; \
+			bin/$$i $$type ; \
+		done ; \
+	done
+
+	for i in $(MPI_TESTS) ; do \
+		for type in 1 2 ; do \
+			echo running $$i $$type ; \
+			mpirun --host localhost:6 -np 6 --bind-to none bin/$$i $$type ; \
+		done ; \
+	done
+
 clean	:
 		rm -rf $(BIN) *~
