• 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# option(ENABLE_COMPILER_COVERAGE "Enable coverage-calculation for compiler" false)
15
16include(${PANDA_ROOT}/cmake/toolchain/coverage/unit_tests_lcov.cmake)
17
18if(ENABLE_COMPILER_COVERAGE)
19    add_custom_target(compiler_coverage DEPENDS cts-assembly tests benchmarks)
20    collect_coverage_for_target(
21        TARGET_NAME compiler_coverage
22        INCLUDE_DIR_PATTERN \"*/compiler/*\"
23        EXCLUDE_DIR_PATTERN \"/usr*\" \"*/third_party/*\" \"*/build/*\" \"*/plugins/*\" \"*/runtime/*\" \"*/bytecode_optimizer/*\" \"*/libpandabase/*\"
24    )
25else()
26    message(STATUS "Coverage will not be calculated (may be enabled by -DENABLE_COMPILER_COVERAGE=true ).")
27endif(ENABLE_COMPILER_COVERAGE)
28