Skip to content

Commit ce35f22

Browse files
committed
tools: fix coverage report script
1 parent 6c57c23 commit ce35f22

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tools/generate_coverage.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ def setup_and_init_options():
121121
logging.critical("Given build path could not be found: %s" % _args.build_dir)
122122
raise ValueError("Given build path could not be found: %s" % _args.build_dir)
123123
options.build_dir = os.path.abspath(_args.build_dir)
124+
if os.access(options.build_dir + "/CMakeCache.txt", os.W_OK):
125+
with_gcc_prof = False
126+
with_mpi = False
127+
with open(options.build_dir + "/CMakeCache.txt", 'r') as cache:
128+
for line in cache:
129+
if "pfasst_WITH_GCC_PROF:BOOL=ON" in line:
130+
with_gcc_prof = True
131+
if "pfasst_WITH_MPI:BOOL=ON" in line:
132+
with_mpi = True
133+
if not with_gcc_prof:
134+
raise RuntimeError("PFASST++ must be built with 'pfasst_WITH_GCC_PROF=ON'")
135+
if with_mpi:
136+
logging.warning("Coverage analysis only functional for non-MPI builds")
137+
exit(0)
124138

125139
if not os.access(_args.output, os.W_OK):
126140
logging.info("Output directory not found. Creating: %s" % _args.output)

0 commit comments

Comments
 (0)