diff --git a/Makefile b/Makefile index 3be57cb4fd571d33fa46ed885af897ff2db5aa52..400fe37891c20ad2eee38db919ff051a5bfe5d56 100644 --- a/Makefile +++ b/Makefile @@ -122,25 +122,18 @@ setup: demo: test/maple_aarch64_with_whirl2mpl.sh test/c_demo printHuawei 1 1 -.PHONY: test1 -test1: libcore - python3 test/main.py test/testsuite/ouroboros/string_test/RT0001-rt-string-ReflectString/ReflectString.java --test_cfg=test/testsuite/ouroboros/test.cfg --verbose --debug - -.PHONY: test_irbuild -test_irbuild: install - python3 test/main.py test/testsuite/irbuild_test --test_cfg=test/testsuite/irbuild_test/test.cfg -j20 -pFAIL - -.PHONY: test_ourboros -test_ourboros: libcore - python3 test/main.py test/testsuite/ouroboros --test_cfg=test/testsuite/ouroboros/test.cfg --timeout=180 -j20 --retry 1 --fail_exit -pFAIL - -.PHONY: c_test -c_test: - $(MAKE) -C test c_test - -.PHONY: testall -testall: - $(MAKE) -C test all +THREADS := 50 +ifneq ($(findstring test,$(MAKECMDGOALS)),) +TESTTARGET := $(MAKECMDGOALS) +ifdef TARGET +REALTARGET := $(TARGET) +else +REALTARGET := $(TESTTARGET) +endif +.PHONY: $(TESTTARGET) +${TESTTARGET}: + @python3 $(MAPLE_ROOT)/testsuite/driver/src/driver.py --target=$(REALTARGET) --run-path=$(MAPLE_ROOT)/output/testsuite $(if $(MOD), --mod=$(MOD),) --j=$(THREADS) --retry --report=$(MAPLE_ROOT)/report.txt +endif .PHONY: cleanrsd cleanrsd:uninstall_patch diff --git a/build/envsetup.sh b/build/envsetup.sh index 8ded25273e576accfd6f6ad75e5e0a593d8d8dfb..ed524b9d0a947162879e1ca35ab46b47e1e2d290 100644 --- a/build/envsetup.sh +++ b/build/envsetup.sh @@ -93,7 +93,7 @@ echo "Build: $MAPLE_BUILD_TYPE" export MAPLE_BUILD_OUTPUT=${MAPLE_ROOT}/output/${MAPLE_BUILD_TYPE} export MAPLE_EXECUTE_BIN=${MAPLE_ROOT}/output/${MAPLE_BUILD_TYPE}/bin export TEST_BIN=${CASE_ROOT}/driver/script -export PATH=${TOOL_BIN_PATH}:$PATH:${MAPLE_EXECUTE_BIN}:${TEST_BIN} +export PATH=$PATH:${MAPLE_EXECUTE_BIN}:${TEST_BIN} if [ ! -f $MAPLE_ROOT/tools/qemu/package/usr/bin/qemu-aarch64 ] && [ "$OLD_OS" = "0" ]; then echo " " diff --git a/build/jenkins/main.sh b/build/jenkins/main.sh index b904df65e09536da1e0fd82a2e334c7b717e48e5..f128a23c5c84da29a357b98cc77e37961785e450 100755 --- a/build/jenkins/main.sh +++ b/build/jenkins/main.sh @@ -39,8 +39,7 @@ function release_test { fi cd $MAPLE_ROOT - mm testall - make c_test + make testall } function main { diff --git a/testsuite/driver/src/api/c_linker.py b/testsuite/driver/src/api/c_linker.py index cded9fedee66687d3c4cd8bfee51e52d072d646d..0de13f875892a3a4abefbd5868fdaac142325d38 100644 --- a/testsuite/driver/src/api/c_linker.py +++ b/testsuite/driver/src/api/c_linker.py @@ -17,7 +17,7 @@ from api.shell_operator import ShellOperator class CLinker(ShellOperator): - def __init__(self, infile, outfile, return_value_list=[0], redirection=None): + def __init__(self, infile, outfile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.infile = infile self.outfile = outfile diff --git a/testsuite/driver/src/api/check_file_equal.py b/testsuite/driver/src/api/check_file_equal.py index ef4e000e25cb177f5e9b7559f6b694a874b91110..4741025b7152e178b985b09cab043c004b751052 100644 --- a/testsuite/driver/src/api/check_file_equal.py +++ b/testsuite/driver/src/api/check_file_equal.py @@ -17,11 +17,11 @@ from api.shell_operator import ShellOperator class CheckFileEqual(ShellOperator): - def __init__(self, file1, file2, return_value_list=[0]): - super().__init__(return_value_list) + def __init__(self, file1, file2, return_value_list=None, redirection=None): + super().__init__(return_value_list, redirection) self.file1 = file1 self.file2 = file2 def get_command(self, variables): self.command = "diff " + self.file1 + " " + self.file2 - return super().get_final_command(variables) \ No newline at end of file + return super().get_final_command(variables) diff --git a/testsuite/driver/src/api/clangfe.py b/testsuite/driver/src/api/clangfe.py index 22c16a53beb9ea84fde43a69701a559c60e01614..98f7e51dcfd91a42cf90ff7693a2e78e42f30228 100644 --- a/testsuite/driver/src/api/clangfe.py +++ b/testsuite/driver/src/api/clangfe.py @@ -21,10 +21,10 @@ class Clangfe(ShellOperator): aarch64_linux_gnu_version = os.listdir("/usr/lib/gcc-cross/aarch64-linux-gnu")[0] - def __init__(self, infile, return_value_list=[0], redirection=None): + def __init__(self, infile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.infile = infile def get_command(self, variables): - self.command = "clangfe -cc1 -emit-llvm -triple aarch64-linux-gnu -D__clang__ -D__BLOCKS__ -isystem /usr/aarch64-linux-gnu/include -isystem /usr/lib/gcc-cross/aarch64-linux-gnu/" + str(Clangfe.aarch64_linux_gnu_version) + "/include " + self.infile + self.command = "${TOOL_BIN_PATH}/clangfe -cc1 -emit-llvm -triple aarch64-linux-gnu -D__clang__ -D__BLOCKS__ -isystem /usr/aarch64-linux-gnu/include -isystem /usr/lib/gcc-cross/aarch64-linux-gnu/" + str(Clangfe.aarch64_linux_gnu_version) + "/include " + self.infile return super().get_final_command(variables) diff --git a/testsuite/driver/src/api/dex2mpl.py b/testsuite/driver/src/api/dex2mpl.py index e272aa24ed049d15f3bfae5677b784af83f68ead..259fbd73572fb9c31442f58c98fbbdb0c35a7928 100644 --- a/testsuite/driver/src/api/dex2mpl.py +++ b/testsuite/driver/src/api/dex2mpl.py @@ -17,7 +17,7 @@ from api.shell_operator import ShellOperator class Dex2mpl(ShellOperator): - def __init__(self, dex2mpl, mplt, litprofile, infile, return_value_list=[0], redirection=None): + def __init__(self, dex2mpl, mplt, litprofile, infile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.dex2mpl = dex2mpl self.mplt = mplt diff --git a/testsuite/driver/src/api/irbuild.py b/testsuite/driver/src/api/irbuild.py index 28a4da8ab0acbb608e0eff7ca9c5ecf6054d87b6..b71f7424491b906a3ee1fb229b19723ac8ca7c95 100644 --- a/testsuite/driver/src/api/irbuild.py +++ b/testsuite/driver/src/api/irbuild.py @@ -17,11 +17,11 @@ from api.shell_operator import ShellOperator class Irbuild(ShellOperator): - def __init__(self, irbuild, infile, return_value_list=[0], redirection=None): + def __init__(self, irbuild, infile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.irbuild = irbuild self.infile = infile def get_command(self, variables): self.command = self.irbuild + " " + self.infile - return super().get_final_command(variables) \ No newline at end of file + return super().get_final_command(variables) diff --git a/testsuite/driver/src/api/java2dex.py b/testsuite/driver/src/api/java2dex.py index ae59511019d3fc86c8fd156a2e81a678e25d47c7..f26e4540adbcc4985d9a4213b85521d42bd91c4f 100644 --- a/testsuite/driver/src/api/java2dex.py +++ b/testsuite/driver/src/api/java2dex.py @@ -17,7 +17,7 @@ from api.shell_operator import ShellOperator class Java2dex(ShellOperator): - def __init__(self, jar_file, outfile, infile, return_value_list=[0], redirection=None): + def __init__(self, jar_file, outfile, infile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.jar_file = jar_file self.outfile = outfile diff --git a/testsuite/driver/src/api/linker.py b/testsuite/driver/src/api/linker.py index 54ba0453382e63d271a5e254063f040bb33534a8..3b95280dc616428850dbd3300e65907016f8a83e 100644 --- a/testsuite/driver/src/api/linker.py +++ b/testsuite/driver/src/api/linker.py @@ -17,10 +17,10 @@ from api.shell_operator import ShellOperator class Linker(ShellOperator): - def __init__(self, lib, return_value_list=[0], redirection=None): + def __init__(self, lib, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.lib = lib def get_command(self, variables): - self.command = "clang++ -g3 -O2 -x assembler-with-cpp -march=armv8-a -target aarch64-linux-gnu -c ${APP}.VtableImpl.s && clang++ ${APP}.VtableImpl.o -L${OUT_ROOT}/aarch64-clang-release/ops/" + self.lib + " -g3 -O2 -march=armv8-a -target aarch64-linux-gnu -fPIC -shared -o ${APP}.so ${OUT_ROOT}/aarch64-clang-release/ops/mrt_module_init.o -fuse-ld=lld -rdynamic -lcore-all -lcommon-bridge -Wl,-z,notext -Wl,-T${OUT_ROOT}/aarch64-clang-release/ops/linker/maplelld.so.lds" + self.command = "${TOOL_BIN_PATH}/clang++ -g3 -O2 -x assembler-with-cpp -march=armv8-a -target aarch64-linux-gnu -c ${APP}.VtableImpl.s && ${TOOL_BIN_PATH}/clang++ ${APP}.VtableImpl.o -L${OUT_ROOT}/aarch64-clang-release/ops/" + self.lib + " -g3 -O2 -march=armv8-a -target aarch64-linux-gnu -fPIC -shared -o ${APP}.so ${OUT_ROOT}/aarch64-clang-release/ops/mrt_module_init.o -fuse-ld=lld -rdynamic -lcore-all -lcommon-bridge -Wl,-z,notext -Wl,-T${OUT_ROOT}/aarch64-clang-release/ops/linker/maplelld.so.lds" return super().get_final_command(variables) diff --git a/testsuite/driver/src/api/maple.py b/testsuite/driver/src/api/maple.py index 0aed6e3403d2bcb01f7e62dd7b485a8c02f81a9d..6417addd2d0e0e6cf97d12717e6e0eb5f2fb6996 100644 --- a/testsuite/driver/src/api/maple.py +++ b/testsuite/driver/src/api/maple.py @@ -17,7 +17,7 @@ from api.shell_operator import ShellOperator class Maple(ShellOperator): - def __init__(self, maple, run, option, global_option, infile, return_value_list=[0], redirection=None): + def __init__(self, maple, run, option, global_option, infile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.maple = maple self.run = run diff --git a/testsuite/driver/src/api/mplsh.py b/testsuite/driver/src/api/mplsh.py index 9cca1fbfb72d4239786b45cc0578d2dc0513b569..ec379177b9716c738a8c0f0356e3df8402d77fff 100644 --- a/testsuite/driver/src/api/mplsh.py +++ b/testsuite/driver/src/api/mplsh.py @@ -17,7 +17,7 @@ from api.shell_operator import ShellOperator class Mplsh(ShellOperator): - def __init__(self, mplsh, xbootclasspath, infile, garbage_collection_kind, return_value_list=[0], env=None, qemu=None, qemu_libc=None, qemu_ld_lib=None, main="${APP}", args=None, redirection=None): + def __init__(self, mplsh, xbootclasspath, infile, garbage_collection_kind, return_value_list=None, env=None, qemu=None, qemu_libc=None, qemu_ld_lib=None, main="${APP}", args=None, redirection=None): super().__init__(return_value_list, redirection) self.env = env self.qemu = qemu diff --git a/testsuite/driver/src/api/shell.py b/testsuite/driver/src/api/shell.py index cc61ff79bd83c8474cd06ba069a337cad4d99037..cb3a626da731dac7ea3388a06803fcc14cb5df1b 100644 --- a/testsuite/driver/src/api/shell.py +++ b/testsuite/driver/src/api/shell.py @@ -17,9 +17,9 @@ from api.shell_operator import ShellOperator class Shell(ShellOperator): - def __init__(self, command, return_value_list=[0], redirection=None): + def __init__(self, command, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.command = command def get_command(self, variables): - return super().get_final_command(variables) \ No newline at end of file + return super().get_final_command(variables) diff --git a/testsuite/driver/src/api/shell_operator.py b/testsuite/driver/src/api/shell_operator.py index 1560d614a2814fcd43efd20003c60306492f0f64..04fed42760b007990d39fe20bb6189d518d2c4b9 100644 --- a/testsuite/driver/src/api/shell_operator.py +++ b/testsuite/driver/src/api/shell_operator.py @@ -16,7 +16,10 @@ class ShellOperator(object): def __init__(self, return_value_list, redirection=None): self.command = "" - self.return_value_list = return_value_list + if return_value_list is None: + self.return_value_list = [0] + else: + self.return_value_list = return_value_list self.redirection = redirection def get_redirection(self): @@ -46,4 +49,4 @@ class ShellOperator(object): final_command = final_command.replace("${" + variable + "}", variables[variable]) final_command += self.get_redirection() final_command += self.get_check_command() - return final_command \ No newline at end of file + return final_command diff --git a/testsuite/driver/src/api/whirl2mpl.py b/testsuite/driver/src/api/whirl2mpl.py index bfef94f458a0d94501e0f2b5a5bc890e4f26a514..d7a84016e9b6398522e4dc8459bc2a0284cafc2a 100644 --- a/testsuite/driver/src/api/whirl2mpl.py +++ b/testsuite/driver/src/api/whirl2mpl.py @@ -17,7 +17,7 @@ from api.shell_operator import ShellOperator class Whirl2mpl(ShellOperator): - def __init__(self, infile, return_value_list=[0], redirection=None): + def __init__(self, infile, return_value_list=None, redirection=None): super().__init__(return_value_list, redirection) self.infile = infile diff --git a/testsuite/driver/src/mod/CO0.py b/testsuite/driver/src/mod/CO0.py index a35e523e13f7eb2f19880ddd507b4039ae470dda..e67394528eddbe37bd20c0f649861ac26bb77732 100644 --- a/testsuite/driver/src/mod/CO0.py +++ b/testsuite/driver/src/mod/CO0.py @@ -43,7 +43,7 @@ CO0 = { ], "run": [ Shell( - "qemu-aarch64 -L /usr/aarch64-linux-gnu/ ${APP}.out" + "${TOOL_BIN_PATH}/qemu-aarch64 -L /usr/aarch64-linux-gnu/ ${APP}.out" ) ] } diff --git a/testsuite/driver/src/mod/CO2.py b/testsuite/driver/src/mod/CO2.py index a64e05881dbf6f8eecfa74222f87830f202a94dd..3f4af06f3154db83a000342c54dc1376cf46e029 100644 --- a/testsuite/driver/src/mod/CO2.py +++ b/testsuite/driver/src/mod/CO2.py @@ -43,7 +43,7 @@ CO2 = { ], "run": [ Shell( - "qemu-aarch64 -L /usr/aarch64-linux-gnu/ ${APP}.out" + "${TOOL_BIN_PATH}/qemu-aarch64 -L /usr/aarch64-linux-gnu/ ${APP}.out" ) ] } diff --git a/testsuite/driver/src/mod/O0.py b/testsuite/driver/src/mod/O0.py index e39134ec23bad368b817944e272caf1deb028da8..9926eed05261222f5de527d62a3f5921e076c221 100644 --- a/testsuite/driver/src/mod/O0.py +++ b/testsuite/driver/src/mod/O0.py @@ -52,7 +52,7 @@ O0 = { ], "run": [ Mplsh( - qemu="qemu-aarch64", + qemu="${TOOL_BIN_PATH}/qemu-aarch64", qemu_libc="/usr/aarch64-linux-gnu", qemu_ld_lib=[ "${OUT_ROOT}/aarch64-clang-release/ops/third_party", diff --git a/testsuite/driver/src/mod/O2.py b/testsuite/driver/src/mod/O2.py index 18dfb60bd8c3aca9d0503e7d0886093304eb26a9..e2f6fcaa87f546592e6894e8b6906b359d8855de 100644 --- a/testsuite/driver/src/mod/O2.py +++ b/testsuite/driver/src/mod/O2.py @@ -52,7 +52,7 @@ O2 = { ], "run": [ Mplsh( - qemu="qemu-aarch64", + qemu="${TOOL_BIN_PATH}/qemu-aarch64", qemu_libc="/usr/aarch64-linux-gnu", qemu_ld_lib=[ "${OUT_ROOT}/aarch64-clang-release/ops/third_party",