@@ -243,16 +243,32 @@ def generate_coverage(self, llvm_version="20"):
243
243
if result .returncode != 0 :
244
244
raise Exception ("Failed to merge coverage profiles" )
245
245
246
- # Find executables
247
- executables = []
246
+ # Find executables and libraries with coverage
247
+ objects = []
248
+
249
+ # Add all executables from bin directory
248
250
for f in self .work_dir .iterdir ():
249
251
if f .is_file () and os .access (f , os .X_OK ) and not f .suffix == ".txt" :
250
- executables .append (str (f ))
251
-
252
- if not executables :
253
- raise Exception ("No executables found in bin directory" )
254
-
255
- print (f"Found { len (executables )} executables" )
252
+ objects .append (str (f ))
253
+
254
+ # Add all static libraries from arch directory
255
+ arch_dir = build_dir / "arch"
256
+ if arch_dir .exists ():
257
+ for f in arch_dir .glob ("*.a" ):
258
+ objects .append (str (f ))
259
+
260
+ # Add all shared libraries from lib directory
261
+ lib_dir = build_dir / "lib"
262
+ if lib_dir .exists ():
263
+ for f in lib_dir .glob ("*.so" ):
264
+ objects .append (str (f ))
265
+ for f in lib_dir .glob ("*.dylib" ):
266
+ objects .append (str (f ))
267
+
268
+ if not objects :
269
+ raise Exception ("No executables or libraries found" )
270
+
271
+ print (f"Found { len (objects )} executables and libraries" )
256
272
257
273
# Get project root
258
274
project_root = build_dir .parent
@@ -261,7 +277,7 @@ def generate_coverage(self, llvm_version="20"):
261
277
lcov_file = output_dir / "coverage.lcov"
262
278
cmd = (
263
279
[llvm_cov , "export" ]
264
- + executables
280
+ + objects
265
281
+ [
266
282
"--format=lcov" ,
267
283
"--ignore-filename-regex=.*3rdparty/.*|/usr/.*|.*tasks/.*/tests/.*|"
@@ -292,7 +308,7 @@ def generate_coverage(self, llvm_version="20"):
292
308
html_dir = output_dir / "html"
293
309
cmd = (
294
310
[llvm_cov , "show" ]
295
- + executables
311
+ + objects
296
312
+ [
297
313
"--format=html" ,
298
314
f"--output-dir={ html_dir } " ,
@@ -315,7 +331,7 @@ def generate_coverage(self, llvm_version="20"):
315
331
# Generate summary
316
332
cmd = (
317
333
[llvm_cov , "report" ]
318
- + executables
334
+ + objects
319
335
+ [
320
336
f"--instr-profile={ profdata_file } " ,
321
337
"--ignore-filename-regex=.*3rdparty/.*|/usr/.*|.*tasks/.*/tests/.*|"
0 commit comments