• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-2024 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.sts
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")
33
34function(ets2panda_add_gtest TARGET)
35    # Parse arguments
36    cmake_parse_arguments(
37            ARG
38            ""
39            ""
40            "CPP_SOURCES"
41            ${ARGN}
42    )
43
44    panda_add_gtest(
45            NAME ${TARGET}
46            SOURCES
47                ${ARG_CPP_SOURCES}
48            LIBRARIES
49                es2panda-public
50                es2panda-lib
51                arkassembler
52                arkbytecodeopt
53            INCLUDE_DIRS
54                ${ES2PANDA_PATH}
55                ${ES2PANDA_BINARY_ROOT}
56            SANITIZERS
57                ${PANDA_SANITIZERS_LIST}
58    )
59endfunction(ets2panda_add_gtest)
60
61
62if(PANDA_WITH_ETS)
63    if (NOT (PANDA_ENABLE_ADDRESS_SANITIZER OR PANDA_ENABLE_THREAD_SANITIZER) OR
64        NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR
65        PANDA_CI_TESTING_MODE STREQUAL "Nightly")
66            set(PANDA_REGRESSION_TESTS 1)
67    endif()
68endif()
69
70add_subdirectory(tsconfig)
71add_subdirectory(options)
72add_subdirectory(unit)
73