From 254bb6fd462574ded444e66cdf8d4bd7a6bcd84b Mon Sep 17 00:00:00 2001 From: Svetlana Rokashevich Date: Wed, 19 Jul 2023 16:09:26 +0300 Subject: [PATCH] Split gtests and checked_tests Create panda_ecmascript_add_gtest wrapper for panda_add_gtest and ecmascript_checked_tests target to attach all ecmascript tests to ecmascript_tests group Signed-off-by: Svetlana Rokashevich --- tests/CMakeLists.txt | 13 ++++- tests/assembler/CMakeLists.txt | 2 +- tests/bytecode_optimizer/CMakeLists.txt | 2 +- tests/checked/CMakeLists.txt | 5 +- tests/compiler/CMakeLists.txt | 4 +- tests/disassembler/CMakeLists.txt | 2 +- tests/runtime/CMakeLists.txt | 54 ++++++++++--------- .../ecma_empty_class_check/CMakeLists.txt | 4 +- tests/runtime/common/gc/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- tests/runtime/mem/CMakeLists.txt | 2 +- tests/runtime/napi/CMakeLists.txt | 2 +- tests/runtime/tooling/CMakeLists.txt | 2 +- 13 files changed, 55 insertions(+), 41 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c35cfd61d..207eb974b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -287,6 +287,13 @@ function(compile_file_ecma) endif() endfunction() +function(panda_ecmascript_add_gtest) + panda_add_gtest( + TEST_GROUP ecmascript_tests + ${ARGV} + ) +endfunction() + # ARM32 is not supported for ecmascript if(NOT PANDA_TARGET_ARM32) add_subdirectory(runtime) @@ -297,6 +304,10 @@ if(PANDA_WITH_COMPILER) add_subdirectory(bytecode_optimizer) endif() -add_subdirectory(checked) +if(PANDA_COMPILER_ENABLE) + add_subdirectory(checked) + add_dependencies(ecmascript_tests ecmascript_checked_tests) +endif() + add_subdirectory(assembler) add_subdirectory(disassembler) diff --git a/tests/assembler/CMakeLists.txt b/tests/assembler/CMakeLists.txt index bc769bdd0..a82335500 100644 --- a/tests/assembler/CMakeLists.txt +++ b/tests/assembler/CMakeLists.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -panda_add_gtest( +panda_ecmascript_add_gtest( NAME assembler_tests_ecma SOURCES parser_test_ecmascript.cpp diff --git a/tests/bytecode_optimizer/CMakeLists.txt b/tests/bytecode_optimizer/CMakeLists.txt index c70ca11f5..795051a15 100644 --- a/tests/bytecode_optimizer/CMakeLists.txt +++ b/tests/bytecode_optimizer/CMakeLists.txt @@ -23,7 +23,7 @@ set(BYTECODE_OPT_TEST_ECMA_SOURCES set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${BYTECODE_OPT_TEST_OPTIONS}") -panda_add_gtest( +panda_ecmascript_add_gtest( CONTAINS_MAIN NAME bytecodeopt_unit_tests_ecma SOURCES diff --git a/tests/checked/CMakeLists.txt b/tests/checked/CMakeLists.txt index b0c9aca4b..83abcd49e 100644 --- a/tests/checked/CMakeLists.txt +++ b/tests/checked/CMakeLists.txt @@ -11,6 +11,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +add_custom_target(ecmascript_checked_tests COMMENT "Running ecmascript tests with checkers") +add_dependencies(ecmascript_checked_tests ark) + function(panda_add_checked_test_ecma) set(prefix ARG) set(singleValues NAME FILE SUPPORT_RELEASE LIBCORE) @@ -79,7 +82,7 @@ function(panda_add_checked_test_ecma) COMMENT "Running ${TEST_NAME} checked test" DEPENDS ${BINARY_FILE} ${EXT_FILES}) - add_dependencies(checked_tests ${TEST_NAME}) + add_dependencies(ecmascript_checked_tests ${TEST_NAME}) foreach(AUX_FILE ${ARG_AUX_FILES}) get_filename_component(AUX_NAME "${AUX_FILE}" NAME_WE) diff --git a/tests/compiler/CMakeLists.txt b/tests/compiler/CMakeLists.txt index 5f3f5dc16..31a437097 100644 --- a/tests/compiler/CMakeLists.txt +++ b/tests/compiler/CMakeLists.txt @@ -33,7 +33,7 @@ set(PANDA_COMPILER_ECMA_TESTS_SOURCES ) if(NOT PANDA_MINIMAL_VIXL AND PANDA_COMPILER_ENABLE) - panda_add_gtest( + panda_ecmascript_add_gtest( CONTAINS_MAIN NAME compiler_unit_tests_ecma SOURCES @@ -59,7 +59,7 @@ if(NOT PANDA_MINIMAL_VIXL AND PANDA_TARGET_AMD64) set_source_files_properties(codegen_ecma_test.cpp PROPERTIES COMPILE_FLAGS "-Wno-shadow -Wno-deprecated-declarations") endif() - panda_add_gtest( + panda_ecmascript_add_gtest( CONTAINS_MAIN NAME compiler_codegen_tests_ecma SOURCES diff --git a/tests/disassembler/CMakeLists.txt b/tests/disassembler/CMakeLists.txt index b2ae0ddfc..f791e7b36 100644 --- a/tests/disassembler/CMakeLists.txt +++ b/tests/disassembler/CMakeLists.txt @@ -20,7 +20,7 @@ set(DISASM_ECMA_TESTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/sources) set(LITERALS_TEST_ECMA_SRC ${CMAKE_CURRENT_BINARY_DIR}/disasm_test_lit_ecma.cpp) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/disasm_test_lit_ecma.cpp.in ${LITERALS_TEST_ECMA_SRC} @ONLY) -panda_add_gtest( +panda_ecmascript_add_gtest( NAME disasm_tests_ecma SOURCES diff --git a/tests/runtime/CMakeLists.txt b/tests/runtime/CMakeLists.txt index 83eb6f554..447a48443 100644 --- a/tests/runtime/CMakeLists.txt +++ b/tests/runtime/CMakeLists.txt @@ -177,7 +177,7 @@ set(ECMASCRIPT_BUILTINS_GLOBAL_TESTS_SOURCES ) #0 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_tests SOURCES @@ -196,7 +196,7 @@ if(TARGET arkruntime4ecmascript_tests) panda_target_compile_options(arkruntime4ecmascript_tests PUBLIC "-Wno-ignored-attributes") endif() #1 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_taggedvalue_tests SOURCES @@ -215,7 +215,7 @@ if(TARGET arkruntime4ecmascript_taggedvalue_tests) panda_target_compile_options(arkruntime4ecmascript_taggedvalue_tests PUBLIC "-Wno-ignored-attributes") endif() #2 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_basic_tests SOURCES @@ -234,7 +234,7 @@ if(TARGET arkruntime4ecmascript_builtins_basic_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_basic_tests PUBLIC "-Wno-ignored-attributes" "-DICU_PATH=\"${ICU_ROOT}/ohos_icu4j/data\"") endif() #3.1 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_regexp_tests SOURCES @@ -253,7 +253,7 @@ if(TARGET arkruntime4ecmascript_builtins_regexp_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_regexp_tests PUBLIC "-Wno-ignored-attributes") endif() #3.2 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_basic_tests-1 SOURCES @@ -272,7 +272,7 @@ if(TARGET arkruntime4ecmascript_builtins_basic_tests-1) panda_target_compile_options(arkruntime4ecmascript_builtins_basic_tests-1 PUBLIC "-Wno-ignored-attributes") endif() #4 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_object_tests SOURCES @@ -291,7 +291,7 @@ if(TARGET arkruntime4ecmascript_builtins_object_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_object_tests PUBLIC "-Wno-ignored-attributes") endif() #5 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_errors_tests SOURCES @@ -310,7 +310,7 @@ if(TARGET arkruntime4ecmascript_builtins_errors_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_errors_tests PUBLIC "-Wno-ignored-attributes") endif() #6 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_date_tests SOURCES @@ -329,7 +329,7 @@ if(TARGET arkruntime4ecmascript_builtins_date_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_date_tests PUBLIC "-Wno-ignored-attributes") endif() #7 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_es_basic_tests SOURCES @@ -348,7 +348,7 @@ if(TARGET arkruntime4ecmascript_es_basic_tests) panda_target_compile_options(arkruntime4ecmascript_es_basic_tests PUBLIC "-Wno-ignored-attributes") endif() #7.1 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_es_basic_tests-1 SOURCES @@ -367,7 +367,7 @@ if(TARGET arkruntime4ecmascript_es_basic_tests-1) panda_target_compile_options(arkruntime4ecmascript_es_basic_tests-1 PUBLIC "-Wno-ignored-attributes") endif() #7.2 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_es_basic_tests-2 SOURCES @@ -386,7 +386,7 @@ if(TARGET arkruntime4ecmascript_es_basic_tests-2) panda_target_compile_options(arkruntime4ecmascript_es_basic_tests-2 PUBLIC "-Wno-ignored-attributes") endif() #8 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_es_basic_object_tests SOURCES @@ -405,7 +405,7 @@ if(TARGET arkruntime4ecmascript_es_basic_object_tests) panda_target_compile_options(arkruntime4ecmascript_es_basic_object_tests PUBLIC "-Wno-ignored-attributes") endif() #9 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_math_tests SOURCES @@ -424,7 +424,7 @@ if(TARGET arkruntime4ecmascript_builtins_math_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_math_tests PUBLIC "-Wno-ignored-attributes") endif() #10 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_json_tests SOURCES @@ -443,7 +443,7 @@ if(TARGET arkruntime4ecmascript_builtins_json_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_json_tests PUBLIC "-Wno-ignored-attributes") endif() #11 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_string_tests SOURCES @@ -462,7 +462,7 @@ if(TARGET arkruntime4ecmascript_builtins_string_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_string_tests PUBLIC "-Wno-ignored-attributes") endif() #12 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_array_tests SOURCES @@ -481,7 +481,7 @@ if(TARGET arkruntime4ecmascript_builtins_array_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_array_tests PUBLIC "-Wno-ignored-attributes") endif() #13 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_reflect_tests SOURCES @@ -500,7 +500,7 @@ if(TARGET arkruntime4ecmascript_builtins_reflect_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_reflect_tests PUBLIC "-Wno-ignored-attributes") endif() #14 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_arraybuffer_tests SOURCES @@ -519,7 +519,7 @@ if(TARGET arkruntime4ecmascript_builtins_arraybuffer_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_arraybuffer_tests PUBLIC "-Wno-ignored-attributes") endif() #15 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_regexp_tests SOURCES @@ -538,7 +538,7 @@ if(TARGET arkruntime4ecmascript_regexp_tests) panda_target_compile_options(arkruntime4ecmascript_regexp_tests PUBLIC "-Wno-ignored-attributes") endif() #16 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_dataview_tests SOURCES @@ -557,7 +557,7 @@ if(TARGET arkruntime4ecmascript_builtins_dataview_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_dataview_tests PUBLIC "-Wno-ignored-attributes") endif() #17 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_typedarray_tests SOURCES @@ -576,7 +576,7 @@ if(TARGET arkruntime4ecmascript_builtins_typedarray_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_typedarray_tests PUBLIC "-Wno-ignored-attributes") endif() #18 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_separate_jsvm SOURCES @@ -589,7 +589,7 @@ NAME arkruntime4ecmascript_separate_jsvm ${PANDA_SANITIZERS_LIST} ) #19 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_mem_tests SOURCES @@ -599,9 +599,11 @@ panda_add_gtest( arkruntime arkassembler SANITIZERS ${PANDA_SANITIZERS_LIST} + DEPS_TARGETS + arkstdlib ) #20 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_promise_tests SOURCES @@ -620,7 +622,7 @@ if(TARGET arkruntime4ecmascript_builtins_promise_tests) panda_target_compile_options(arkruntime4ecmascript_builtins_promise_tests PUBLIC "-Wno-ignored-attributes") endif() #21 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_tests2 SOURCES @@ -639,7 +641,7 @@ if(TARGET arkruntime4ecmascript_tests2) panda_target_compile_options(arkruntime4ecmascript_tests2 PUBLIC "-Wno-ignored-attributes") endif() #22 -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_builtins_global_tests SOURCES diff --git a/tests/runtime/common/ecma_empty_class_check/CMakeLists.txt b/tests/runtime/common/ecma_empty_class_check/CMakeLists.txt index 1542fd9e1..18bf978c6 100644 --- a/tests/runtime/common/ecma_empty_class_check/CMakeLists.txt +++ b/tests/runtime/common/ecma_empty_class_check/CMakeLists.txt @@ -34,7 +34,7 @@ add_custom_target(ecma_empty_class_check_check_out add_dependencies(ecmascript_common_tests ecma_empty_class_check_check_out) -panda_add_gtest( +panda_ecmascript_add_gtest( NAME ecma_empty_class_check SOURCES ecma_empty_class_check.cpp @@ -45,5 +45,3 @@ panda_add_gtest( SANITIZERS ${PANDA_SANITIZERS_LIST} ) - -add_dependencies(ecmascript_common_tests ecma_empty_class_check_check_out) diff --git a/tests/runtime/common/gc/CMakeLists.txt b/tests/runtime/common/gc/CMakeLists.txt index d6903cef4..0423a7bfe 100644 --- a/tests/runtime/common/gc/CMakeLists.txt +++ b/tests/runtime/common/gc/CMakeLists.txt @@ -112,7 +112,7 @@ function(panda_add_ecma_jsnapi_gc_test) if (TARGET ecmascript_pending_exception_tests) add_dependencies(ecmascript_pending_exception_tests source_js_file_${TEST_NAME}) else() - panda_add_gtest( + panda_ecmascript_add_gtest( NO_CORES NAME ecmascript_pending_exception_tests SOURCES diff --git a/tests/runtime/common/native_methods_api_no_crash/CMakeLists.txt b/tests/runtime/common/native_methods_api_no_crash/CMakeLists.txt index 39a0eb157..935558dd2 100644 --- a/tests/runtime/common/native_methods_api_no_crash/CMakeLists.txt +++ b/tests/runtime/common/native_methods_api_no_crash/CMakeLists.txt @@ -1,6 +1,6 @@ # Huawei Technologies Co.,Ltd. -panda_add_gtest( +panda_ecmascript_add_gtest( NAME native_methods_api_no_crash SOURCES native_methods_api_no_crash.cpp diff --git a/tests/runtime/mem/CMakeLists.txt b/tests/runtime/mem/CMakeLists.txt index e564d75d0..4202092ae 100644 --- a/tests/runtime/mem/CMakeLists.txt +++ b/tests/runtime/mem/CMakeLists.txt @@ -17,7 +17,7 @@ set(MEMTESTS_JS_SOURCES weakContainers.js ) -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME arkruntime4ecmascript_mem_weak_tests SOURCES diff --git a/tests/runtime/napi/CMakeLists.txt b/tests/runtime/napi/CMakeLists.txt index b121ba72c..685e641d5 100644 --- a/tests/runtime/napi/CMakeLists.txt +++ b/tests/runtime/napi/CMakeLists.txt @@ -8,7 +8,7 @@ set(JSNAPI_TESTS_SOURCES jsnapi_tests.cpp ) -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME jsnapi_tests SOURCES diff --git a/tests/runtime/tooling/CMakeLists.txt b/tests/runtime/tooling/CMakeLists.txt index bf5964b22..7ff1bd170 100644 --- a/tests/runtime/tooling/CMakeLists.txt +++ b/tests/runtime/tooling/CMakeLists.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -panda_add_gtest( +panda_ecmascript_add_gtest( NO_CORES NAME debug_api_tests_ecma SOURCES -- Gitee