Files
MaxScale/server/core/test/makefile
VilhoRaatikka e8ce2268e0 Test system for MaxScale.
Every test/makefile have the following targets:
 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

Tests for directory random_dir are always in its subdirectory, in this case in random_dir/test . If random_dir has subdirectories with tests, random_dir/child_dir, for example, tests of child_dir can be started from random_dir/test/makefile where make -C child_dir/test <test target> is called.

See MAXSCALE_HOME/test/README for further information.
2014-02-07 11:06:37 +02:00

45 lines
1.2 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
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 0 1 2>> $(TESTLOG)
@./testhash 10 1 2>> $(TESTLOG)
@./testhash 1000 10 2>> $(TESTLOG)
@./testhash 10 0 2>> $(TESTLOG)
@./testhash 1500 17 2>> $(TESTLOG)
@./testhash 1 1 2>> $(TESTLOG)
@./testhash 10000 133 2>> $(TESTLOG)
@./testhash 1000 1000 2>> $(TESTLOG)
@./testhash 1000 100000 2>> $(TESTLOG)
@echo "MaxScale core PASSED" >> $(TESTLOG)
@echo "" >> $(TESTLOG)