Changed how MaxScale unit test works.
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.
This commit is contained in:
parent
b9a8f2ce65
commit
7b40c1ee70
@ -5,6 +5,7 @@
|
||||
|
||||
include ../../build_gateway.inc
|
||||
include ../../makefile.inc
|
||||
include ../../test.inc
|
||||
|
||||
CC = gcc
|
||||
CPP = g++
|
||||
@ -43,7 +44,7 @@ buildtests:
|
||||
|
||||
|
||||
runtests:
|
||||
@echo "" >> $(TESTLOG)
|
||||
@echo "" > $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo $(shell date) >> $(TESTLOG)
|
||||
@echo "Test Log Manager" >> $(TESTLOG)
|
||||
@ -62,3 +63,5 @@ runtests:
|
||||
@-$(LAUNCH_DEBUGGER) $(TESTAPP) "-t 16" 2>>$(TESTLOG)
|
||||
@echo "Log Manager PASSED" >> $(TESTLOG)
|
||||
@echo "" >> $(TESTLOG)
|
||||
|
||||
# @cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG)
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
include ../../build_gateway.inc
|
||||
include ../../makefile.inc
|
||||
include ../../test.inc
|
||||
|
||||
CC = gcc
|
||||
CPP = g++
|
||||
@ -48,7 +49,7 @@ buildtests:
|
||||
$(LDLIBS) $(LDMYSQL)
|
||||
|
||||
runtests:
|
||||
@echo "" >> $(TESTLOG)
|
||||
@echo "" > $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo $(shell date) >> $(TESTLOG)
|
||||
@echo "Test Query Classifier" >> $(TESTLOG)
|
||||
@ -59,3 +60,4 @@ ifeq ($?, 0)
|
||||
else
|
||||
@echo "Query Classifier FAILED" >> $(TESTLOG)
|
||||
endif
|
||||
@cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG)
|
@ -5,6 +5,7 @@
|
||||
|
||||
include ../../../build_gateway.inc
|
||||
include ../../../makefile.inc
|
||||
include ../../../test.inc
|
||||
|
||||
CC=cc
|
||||
TESTLOG := $(shell pwd)/testhash.log
|
||||
@ -26,7 +27,7 @@ buildtests :
|
||||
testhash.c ../hashtable.o ../atomic.o ../spinlock.o -o testhash
|
||||
|
||||
runtests:
|
||||
@echo "" >> $(TESTLOG)
|
||||
@echo "" > $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo $(shell date) >> $(TESTLOG)
|
||||
@echo "Test MaxScale core" >> $(TESTLOG)
|
||||
@ -38,3 +39,4 @@ else
|
||||
@echo "MaxScale core FAILED" >> $(TESTLOG)
|
||||
endif
|
||||
@echo "" >> $(TESTLOG)
|
||||
@cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG)
|
@ -8,7 +8,7 @@ include $(ROOT_PATH)/makefile.inc
|
||||
include $(ROOT_PATH)/test.inc
|
||||
|
||||
CC=cc
|
||||
TESTLOG := $(shell pwd)/testrouters.log
|
||||
TESTLOG := $(shell pwd)/testrwsplit.log
|
||||
RET := -1
|
||||
|
||||
cleantests:
|
||||
@ -25,12 +25,11 @@ buildtests:
|
||||
|
||||
|
||||
runtests:
|
||||
@echo "" >> $(TESTLOG)
|
||||
@echo "" > $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo $(shell date) >> $(TESTLOG)
|
||||
@echo "Test Read/Write split router" >> $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
./rwsplit.sh $(TESTLOG) $(THOST) $(TPORT_RW) $(TMASTER_ID) $(TUSER) $(TPWD)
|
||||
@echo "" >> $(TESTLOG)
|
||||
|
||||
|
||||
@cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG)
|
@ -5,6 +5,7 @@
|
||||
|
||||
include ../../build_gateway.inc
|
||||
include ../../makefile.inc
|
||||
include ../../test.inc
|
||||
|
||||
TEST_ROOT := $(ROOT_PATH)/test
|
||||
PARENT_DIR := $(ROOT_PATH)/server
|
||||
@ -58,7 +59,7 @@ else
|
||||
endif
|
||||
|
||||
runtests:
|
||||
@echo "" >> $(TESTLOG)
|
||||
@echo "" > $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo $(shell date) >> $(TESTLOG)
|
||||
@echo "Test MaxScale server" >> $(TESTLOG)
|
||||
@ -70,4 +71,4 @@ runtests:
|
||||
@sleep 5
|
||||
@echo "MaxScale server PASSED" >> $(TESTLOG)
|
||||
@echo "" >> $(TESTLOG)
|
||||
|
||||
@cat $(TESTLOG) >> $(TEST_MAXSCALE_LOG)
|
||||
|
8
test.inc
8
test.inc
@ -32,4 +32,10 @@ TPWD :=
|
||||
# master's server_id, for example:
|
||||
# TMASTER_ID := 2
|
||||
#
|
||||
TMASTER_ID :=
|
||||
TMASTER_ID :=
|
||||
|
||||
#
|
||||
# Global test log where all log is gathered
|
||||
# TEST_MAXSCALE_LOG := $(ROOT_PATH)/test/test_maxscale.log
|
||||
#
|
||||
TEST_MAXSCALE_LOG :=
|
||||
|
@ -5,11 +5,12 @@
|
||||
|
||||
include ../build_gateway.inc
|
||||
include ../makefile.inc
|
||||
include ../test.inc
|
||||
|
||||
export MAXSCALE_HOME=$(shell pwd)/MaxScale
|
||||
|
||||
CC=cc
|
||||
TESTLOG := $(shell pwd)/testmaxscale.log
|
||||
TESTLOG := $(TEST_MAXSCALE_LOG)
|
||||
|
||||
testall:
|
||||
$(MAKE) cleantests
|
||||
@ -55,9 +56,10 @@ buildtests:
|
||||
$(MAKE) -C $(ROOT_PATH)/utils buildtests
|
||||
|
||||
runtests:
|
||||
@echo "" >> $(TESTLOG)
|
||||
@echo "" > $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo $(shell date) >> $(TESTLOG)
|
||||
@echo "Test MaxScale root" >> $(TESTLOG)
|
||||
@echo "-------------------------------" >> $(TESTLOG)
|
||||
@echo "Nothing to run here so far" >> $(TESTLOG)
|
||||
|
Loading…
x
Reference in New Issue
Block a user