Skip to content

Commit

Permalink
fix: workaround for gcovr issue
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 26, 2024
1 parent 54364d5 commit bfa8cb8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ env:
hipo_ref: 20094876df040ec234dd376fa527cf58442b775a
# test options
num_events: 1000
num_threads: 0 # use 0 for "all" available cores
verbose_test: 'false' # only set this to 'true' if `meson test` fails and you need more output to investigate

jobs:
Expand Down Expand Up @@ -364,14 +365,15 @@ jobs:
### build
- name: meson setup
run: |
meson setup iguana_build iguana_src \
--prefix=$(pwd)/iguana \
--pkg-config-path=$(pwd)/hipo/lib/pkgconfig \
-Dwerror=false \
-Dinstall_examples=true \
-Dtest_data_file=$(pwd)/test_data.hipo \
-Dtest_num_events=${{ env.num_events }} \
-Dtest_output_dir=$(pwd)/validation_results \
meson setup iguana_build iguana_src \
--prefix=$(pwd)/iguana \
--pkg-config-path=$(pwd)/hipo/lib/pkgconfig \
-Dwerror=true \
-Dinstall_examples=true \
-Dtest_data_file=$(pwd)/test_data.hipo \
-Dtest_num_events=${{ env.num_events }} \
-Dtest_output_dir=$(pwd)/validation_results \
-Dtest_multithreading=${{ env.num_threads }} \
${{ matrix.opts }}
- name: dump all build options
run: meson configure iguana_build --no-pager
Expand Down Expand Up @@ -416,8 +418,10 @@ jobs:
- name: coverage
if: ${{ matrix.id == 'coverage' }}
run: |
meson configure iguana_build -Dtest_multithreading=1 # workaround gcovr issue in `TestMultithreading.h` when num_threads!=1
ninja -C iguana_build coverage-html
ninja -C iguana_build coverage-text
meson configure iguana_build -Dtest_multithreading=${{ env.num_threads }} # revert the above workaround
mv iguana_build/meson-logs/coveragereport coverage-report
echo '### Coverage Report' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
{ "id": "coverage", "CC": "gcc", "CXX": "g++", "opts": "-Dbuildtype=release -Dz_require_root=true -Db_coverage=true" },
{ "id": "documentation", "CC": "gcc", "CXX": "g++", "opts": "-Dbuildtype=release -Dz_require_root=true -Dinstall_documentation=true" },
{ "id": "address-sanitizer", "CC": "clang", "CXX": "clang++", "opts": "-Dbuildtype=debug -Dz_require_root=true -Db_sanitize=address -Db_lundef=false -Db_pie=true" },
{ "id": "thread-sanitizer", "CC": "clang", "CXX": "clang++", "opts": "-Dbuildtype=debug -Dz_require_root=true -Db_sanitize=thread -Db_lundef=false -Db_pie=true -Dtest_multithreading=0" },
{ "id": "thread-sanitizer", "CC": "clang", "CXX": "clang++", "opts": "-Dbuildtype=debug -Dz_require_root=true -Db_sanitize=thread -Db_lundef=false -Db_pie=true" },
{ "id": "undefined-sanitizer", "CC": "clang", "CXX": "clang++", "opts": "-Dbuildtype=debug -Dz_require_root=true -Db_sanitize=undefined -Db_lundef=false -Db_pie=true" },
{ "id": "leak-sanitizer", "CC": "clang", "CXX": "clang++", "opts": "-Dbuildtype=debug -Dz_require_root=true -Db_sanitize=leak -Db_lundef=false -Db_pie=true" },
{ "id": "noROOT", "CC": "gcc", "CXX": "g++", "opts": "-Dbuildtype=release -Dz_require_root=false" },
Expand Down
9 changes: 4 additions & 5 deletions src/iguana/tests/include/TestMultithreading.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ inline int TestMultithreading(
bool vary_run,
bool verbose)
{
num_threads = 1; // TEST

iguana::Logger log("test", verbose ? iguana::Logger::Level::trace : iguana::Logger::Level::info);

Expand Down Expand Up @@ -73,11 +72,11 @@ inline int TestMultithreading(
algo_name,
prerequisite_algos,
bank_names,
vary_run,
/*vary_run,*/
verbose,
num_events_per_thread,
num_events_per_frame,
run_config_bank_idx
/*num_events_per_thread,*/
num_events_per_frame/*,
run_config_bank_idx*/
](int order) {

// fill a frame
Expand Down

0 comments on commit bfa8cb8

Please sign in to comment.