@@ -15,22 +15,53 @@ project(OcreTestSourceCoverage)
1515
1616add_subdirectory (../system/posix OcreSystemTests )
1717
18- add_custom_target (coverage ALL
18+ add_custom_target (default.profdata
1919 COMMAND llvm-profdata merge -sparse
20- OcreSystemTests/test_lib.profraw
21- OcreSystemTests/test_ocre.profraw
22- OcreSystemTests/test_context.profraw
23- OcreSystemTests/test_container.profraw
24- -o default.profdata
20+ OcreSystemTests/test_lib.profraw
21+ OcreSystemTests/test_ocre.profraw
22+ OcreSystemTests/test_context.profraw
23+ OcreSystemTests/test_container.profraw
24+ -o default.profdata
25+ DEPENDS
26+ OcreSystemTests/test_lib.profraw
27+ OcreSystemTests/test_ocre.profraw
28+ OcreSystemTests/test_context.profraw
29+ OcreSystemTests/test_container.profraw
30+ run-systests
31+ )
32+
33+ add_custom_target (coverage ALL
2534 COMMAND llvm-cov show
26- -format=html -output-dir=report
35+ -format=html -output-dir=coverage
2736 -instr-profile=default.profdata
28- --ignore-filename-regex=$wasm-micro-runtime/
29- --ignore-filename-regex=$test/
37+ --sources ${CMAKE_CURRENT_LIST_DIR} /../../src
3038 --object=OcreSystemTests/test_lib
3139 --object=OcreSystemTests/test_ocre
3240 --object=OcreSystemTests/test_context
3341 --object=OcreSystemTests/test_container
3442 DEPENDS
35- run-systests
43+ OcreSystemTests/test_lib
44+ OcreSystemTests/test_ocre
45+ OcreSystemTests/test_context
46+ OcreSystemTests/test_container
47+ default.profdata
48+ )
49+
50+ add_custom_target (report.md
51+ COMMAND echo '```' > report.md
52+ COMMAND llvm-cov report
53+ -instr-profile=default.profdata
54+ --sources ${CMAKE_CURRENT_LIST_DIR} /../../src
55+ --object=OcreSystemTests/test_lib
56+ --object=OcreSystemTests/test_ocre
57+ --object=OcreSystemTests/test_context
58+ --object=OcreSystemTests/test_container
59+ >> report.md
60+ COMMAND echo '```' >> report.md
61+ DEPENDS
62+ OcreSystemTests/test_lib
63+ OcreSystemTests/test_ocre
64+ OcreSystemTests/test_context
65+ OcreSystemTests/test_container
66+ default.profdata
3667)
0 commit comments