1# Copyright (c) 2021-2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14# target to test compilation issue on arm32 platforms 15# see issue https://gitee.com/openharmony-sig/arkcompiler_ets_frontend/issues/I84VFY 16if (PANDA_TARGET_ARM32) 17 add_custom_target(ets_tests_arm32_punctuator_any_equal 18 COMMAND ${PANDA_ROOT}/tests/tests-u-runner/runner.sh 19 --build-dir ${PANDA_BINARY_ROOT} 20 --arm32-qemu 21 --ets-runtime 22 --test-file PunctuatorAnyEqual.ets 23 ) 24endif() 25 26# ignore ARM32 because some files (not gnueabi or gnueabihf) are incompatible with 32x processors 27# this will be fixed in the future 28if(PANDA_TARGET_ARM32 OR PANDA_ARM64_TESTS_WITH_SANITIZER) 29 return() 30endif() 31 32add_custom_target(es2panda_tests COMMENT "Running es2panda test suites") 33add_custom_target(es2panda_gtests COMMENT "Running es2panda gtest suites") 34set(DEFAULT_TEST_GROUP ets_tests) 35 36# List for accumulation of all ets gtests binary paths. 37# It's used by CI to archive these binaries into a single artifact 38# and send it to second stage where unit tests will use them. 39set_property(GLOBAL PROPERTY ets_stash_list "") 40 41function(ets2panda_add_gtest TARGET) 42 # Parse arguments 43 cmake_parse_arguments( 44 ARG 45 "" 46 "" 47 "CPP_SOURCES" 48 ${ARGN} 49 ) 50 51 panda_add_gtest( 52 TEST_GROUP es2panda_gtests 53 STASH_LIST ets_stash_list 54 NAME ${TARGET} 55 SOURCES 56 ${ES2PANDA_ROOT}/test/utils/asm_test.cpp 57 ${ES2PANDA_ROOT}/test/utils/ast_verifier_test.cpp 58 ${ES2PANDA_ROOT}/test/utils/checker_test.cpp 59 ${ES2PANDA_ROOT}/test/utils/scope_init_test.cpp 60 ${ES2PANDA_ROOT}/test/utils/plugin_conversion_rule_test.cpp 61 ${ARG_CPP_SOURCES} 62 LIBRARIES 63 es2panda-public 64 es2panda-lib 65 arkassembler 66 arkbytecodeopt 67 ${LSP_LIB} 68 INCLUDE_DIRS 69 ${ES2PANDA_PATH} 70 ${ES2PANDA_BINARY_ROOT} 71 SANITIZERS 72 ${PANDA_SANITIZERS_LIST} 73 ${ARG_UNPARSED_ARGUMENTS} 74 ) 75endfunction(ets2panda_add_gtest) 76 77 78if(PANDA_WITH_ETS) 79 if (NOT (PANDA_ENABLE_ADDRESS_SANITIZER OR PANDA_ENABLE_THREAD_SANITIZER) OR 80 NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR 81 PANDA_CI_TESTING_MODE STREQUAL "Nightly") 82 set(PANDA_REGRESSION_TESTS 1) 83 endif() 84endif() 85 86add_subdirectory(tsconfig) 87add_subdirectory(options) 88add_subdirectory(unit) 89add_subdirectory(depanalyzer)