
All tests are run by executing 'make testall' in root directory. As a result all directories which contain tests will be entered and tests executed. After tests, each directory have a test log including the last run's logs only. Created a global test log, which is specified in test.inc. Test logs from subdirectories are concatenated to this file.
42 lines
1.1 KiB
Makefile
42 lines
1.1 KiB
Makefile
# cleantests - clean local and subdirectories' tests
|
|
# buildtests - build all local and subdirectories' tests
|
|
# runtests - run all local tests
|
|
# testall - clean, build and run local and subdirectories' tests
|
|
|
|
include ../../../build_gateway.inc
|
|
include ../../../makefile.inc
|
|
include ../../../test.inc
|
|
|
|
CC=cc
|
|
TESTLOG := $(shell pwd)/testhash.log
|
|
|
|
cleantests:
|
|
- $(DEL) *.o
|
|
- $(DEL) testhash
|
|
- $(DEL) *~
|
|
|
|
testall:
|
|
$(MAKE) cleantests
|
|
$(MAKE) DEBUG=Y buildtests
|
|
$(MAKE) runtests
|
|
|
|
buildtests :
|
|
$(CC) $(CFLAGS) \
|
|
-I$(ROOT_PATH)/server/include \
|
|
-I$(ROOT_PATH)/utils \
|
|
testhash.c ../hashtable.o ../atomic.o ../spinlock.o -o testhash
|
|
|
|
runtests:
|
|
@echo "" > $(TESTLOG)
|
|
@echo "-------------------------------" >> $(TESTLOG)
|
|
@echo $(shell date) >> $(TESTLOG)
|
|
@echo "Test MaxScale core" >> $(TESTLOG)
|
|
@echo "-------------------------------" >> $(TESTLOG)
|
|
@ -./testhash 2>> $(TESTLOG)
|
|
ifeq ($?,0)
|
|
@echo "MaxScale core PASSED" >> $(TESTLOG)
|
|
else
|
|
@echo "MaxScale core FAILED" >> $(TESTLOG)
|
|
endif
|
|
@echo "" >> $(TESTLOG)
|
|
@cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG) |