diff --git a/clean.mk b/clean.mk index cebc05a6..5832ca5a 100644 --- a/clean.mk +++ b/clean.mk @@ -14,12 +14,12 @@ .DEFAULT_GOAL := clean -D = / ifndef TEST_ROOT - TEST_ROOT := $(shell pwd)$(D).. + TEST_ROOT := $(shell pwd)/.. endif +include $(TEST_ROOT)/TKG/common.mk include settings.mk cleanBuild: diff --git a/common.mk b/common.mk new file mode 100644 index 00000000..d96fc330 --- /dev/null +++ b/common.mk @@ -0,0 +1,22 @@ +############################################################################## +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################## + +D = / +P = : +Q = " +SQ = ' + +ifneq (,$(findstring Win,$(OS))) + P=; +endif diff --git a/compile.mk b/compile.mk index 6df7e68b..b6f1809f 100644 --- a/compile.mk +++ b/compile.mk @@ -14,12 +14,11 @@ .DEFAULT_GOAL := compile -D = / - ifndef TEST_ROOT - TEST_ROOT := $(shell pwd)$(D).. + TEST_ROOT := $(shell pwd)/.. endif +include $(TEST_ROOT)/TKG/common.mk include settings.mk include moveDmp.mk @@ -34,4 +33,4 @@ compile: ($(COMPILE_CMD) 2>&1; echo $$? ) | tee $(Q)$(COMPILATION_LOG)$(Q); \ $(MOVE_TDUMP) -.PHONY: compile \ No newline at end of file +.PHONY: compile diff --git a/makeGen.mk b/makeGen.mk index e891d788..30718df6 100644 --- a/makeGen.mk +++ b/makeGen.mk @@ -23,17 +23,17 @@ help: CURRENT_DIR := $(shell pwd) OPTS= -D=/ -P=: -Q=" TKG_JAR = .$(D)bin$(D)TestKitGen.jar JSON_SIMPLE = .$(D)lib$(D)json-simple.jar -ifneq (,$(findstring Win,$(OS))) -CURRENT_DIR := $(subst \,/,$(CURRENT_DIR)) -P=; + + +ifndef TEST_ROOT + TEST_ROOT := $(shell pwd)/.. endif + +include $(TEST_ROOT)/TKG/common.mk include $(CURRENT_DIR)$(D)featureSettings.mk -include $(CURRENT_DIR)$(D)autoGenEnv.mk include $(CURRENT_DIR)$(D)envSettings.mk diff --git a/moveDmp.mk b/moveDmp.mk index 1b73a18e..e32dcf5c 100644 --- a/moveDmp.mk +++ b/moveDmp.mk @@ -12,13 +12,12 @@ # limitations under the License. ############################################################################## -D = / -Q = " - ifndef TEST_ROOT - TEST_ROOT := $(shell pwd)$(D).. + TEST_ROOT := $(shell pwd)/.. endif +include $(TEST_ROOT)/TKG/common.mk + COMPILATION_OUTPUT=$(TEST_ROOT)$(D)TKG$(D)output_compilation COMPILATION_LOG=$(COMPILATION_OUTPUT)$(D)compilation.log MOVE_TDUMP_PERL=perl scripts$(D)moveDmp.pl --compileLogPath=$(Q)$(COMPILATION_LOG)$(Q) --testRoot=$(Q)$(TEST_ROOT)$(Q) diff --git a/runtest.mk b/runtest.mk index e8e762b4..163b1235 100644 --- a/runtest.mk +++ b/runtest.mk @@ -18,12 +18,12 @@ .DEFAULT_GOAL := test -D = / SUBDIRS = .. ifndef TEST_ROOT - TEST_ROOT := $(shell pwd)$(D).. + TEST_ROOT := $(shell pwd)/.. endif +include $(TEST_ROOT)/TKG/common.mk include settings.mk diff --git a/settings.mk b/settings.mk index 722543a4..fa6c2b99 100644 --- a/settings.mk +++ b/settings.mk @@ -35,13 +35,15 @@ EXECUTABLE_SUFFIX = RUN_SCRIPT = sh RUN_SCRIPT_STRING = "sh -c" SCRIPT_SUFFIX=.sh -Q=" -SQ=' -P=: AND_IF_SUCCESS=&& PROPS_DIR=props_unix TOTALCOUNT := 0 +ifndef TEST_ROOT + TEST_ROOT := $(shell pwd)/.. +endif + +include $(TEST_ROOT)/TKG/common.mk -include $(TEST_ROOT)$(D)TKG$(D)autoGenEnv.mk include $(TEST_ROOT)$(D)TKG$(D)envSettings.mk -include $(TEST_ROOT)$(D)TKG$(D)utils.mk @@ -84,7 +86,7 @@ ifndef JVM_VERSION ifeq (hotspot, $(JDK_IMPL)) JVM_VERSION = $(OPENJDK_VERSION) -else +else JVM_VERSION = $(OPENJDK_VERSION)-$(JDK_IMPL) endif @@ -92,10 +94,9 @@ export JVM_VERSION:=$(JVM_VERSION) endif ifneq (,$(findstring win,$(SPEC))) -P=; D=\\ EXECUTABLE_SUFFIX=.exe -RUN_SCRIPT="cmd /c" +RUN_SCRIPT="cmd /c" RUN_SCRIPT_STRING=$(RUN_SCRIPT) SCRIPT_SUFFIX=.bat PROPS_DIR=props_win @@ -195,7 +196,7 @@ KEEP_REPORTDIR?=true ifeq ($(KEEP_REPORTDIR), false) RM_REPORTDIR=$(RM) -r $(REPORTDIR); endif -ifeq ($(TEST_ITERATIONS), 1) +ifeq ($(TEST_ITERATIONS), 1) TEST_STATUS=if [ $$? -eq 0 ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED$(Q); $(ECHO) $(Q)$(Q); $(CD) $(TEST_ROOT); $(RM_REPORTDIR) else $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED$(Q); $(ECHO) $(Q)$(Q); fi else TEST_STATUS=if [ $$? -eq 0 ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED(ITER_$$itercnt)$(Q); $(ECHO) $(Q)$(Q); $(CD) $(TEST_ROOT); $(RM_REPORTDIR) if [ $$itercnt -eq $(TEST_ITERATIONS) ] ; then $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_PASSED$(Q); $(ECHO) $(Q)$(Q); fi else $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED(ITER_$$itercnt)$(Q); $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$(Q); $(ECHO) $(Q)$@$(Q)$(Q)_FAILED$(Q); $(ECHO) $(Q)$(Q); exit 1; fi