Skip to content

Commit

Permalink
only try to generate coverage on success
Browse files Browse the repository at this point in the history
  • Loading branch information
TingDaoK committed Oct 10, 2023
1 parent a56e486 commit ce775ed
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions builder/actions/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,13 @@ def run(self, env):
return

ctest = toolchain.ctest_binary()
sh.exec(*toolchain.shell_env, ctest,
"--output-on-failure", working_dir=project_build_dir, check=True)
# Try to generate the coverage report. Will be ignored by ctest if no coverage data available.
try:
sh.exec(*toolchain.shell_env, ctest,
"--output-on-failure", working_dir=project_build_dir, check=True)
except:
# Skip generate the coverage report on error
return
# If CTest found no test, generate coverage will hang
sh.exec(*toolchain.shell_env, ctest,
"-T", "coverage", working_dir=project_build_dir, check=True)

Expand Down

0 comments on commit ce775ed

Please sign in to comment.