From 4f539fb01feaa1b68b4606218459f2c6737c5de4 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Mon, 9 Oct 2023 21:22:04 -0700 Subject: [PATCH] no test is not an error --- builder/actions/cmake.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/builder/actions/cmake.py b/builder/actions/cmake.py index 61d2af6dc..1df8c02c4 100644 --- a/builder/actions/cmake.py +++ b/builder/actions/cmake.py @@ -246,15 +246,13 @@ def run(self, env): return ctest = toolchain.ctest_binary() - 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) + "--output-on-failure", working_dir=project_build_dir, check=True) + if env.args.coverage: + # Only generate coverage when required to + # If CTest found no test, generate coverage will hang + sh.exec(*toolchain.shell_env, ctest, + "-T", "coverage", working_dir=project_build_dir, check=True) def __str__(self): return 'ctest {} @ {}'.format(self.project.name, self.project.path)