• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024-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
14if(NOT PANDA_REGRESSION_TESTS)
15    return()
16endif()
17
18set(GEN_INCLUDE_DIR "${PANDA_BINARY_ROOT}/runtime/include")
19
20add_custom_command(OUTPUT ${GEN_INCLUDE_DIR}/path_getter.h
21    COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/path_getter.rb
22            ${CMAKE_CURRENT_SOURCE_DIR}/path_getter.h.erb
23            ${GEN_INCLUDE_DIR}/path_getter.h
24            "${PANDA_BINARY_ROOT}/bin-gtests/es2panda_depanalyz_tests" "${CMAKE_CURRENT_SOURCE_DIR}/test"
25    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/path_getter.h.erb)
26
27add_custom_target(path_getter
28    DEPENDS ${GEN_INCLUDE_DIR}/path_getter.h)
29add_dependencies(panda_gen_files path_getter)
30
31panda_add_gtest(
32        TEST_GROUP es2panda_gtests
33        STASH_LIST ets_stash_list
34        NAME es2panda_depanalyz_tests
35        SOURCES
36            test.cpp
37        LIBRARIES
38            es2panda-public
39            es2panda-lib
40            arkassembler
41            dependency_analyzer_lib
42        INCLUDE_DIRS
43            ${ES2PANDA_PATH}
44            ${ES2PANDA_BINARY_ROOT}
45            ${GEN_INCLUDE_DIR}
46        SANITIZERS
47            ${PANDA_SANITIZERS_LIST}
48)
49
50add_dependencies(es2panda_depanalyz_tests path_getter)
51
52if(NOT PANDA_WITH_ETS)
53    return()
54endif()
55