Skip to content

Commit

Permalink
fix(ci): thread sanitizer should actually run multi-threaded
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 9, 2024
1 parent 5534ff2 commit 965ba98
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
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" },
{ "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=4" },
{ "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
1 change: 1 addition & 0 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option('test_data_file', type: 'string', value: '', description: '
option('test_num_events', type: 'string', value: '10', description: 'Number of events from `test_data_file` to test')
option('test_output_dir', type: 'string', value: '', description: 'Output directory for tests. Must be an absolute path. If unspecified, tests will still run, but will not produce output files.')
option('test_validator_all_stats', type: 'boolean', value: false, description: 'If true, use all statistics for validators, rather than `test_num_events`')
option('test_multithreading', type: 'integer', value: -1, description: 'if < 0, run single threaded, otherwise run tests with this many threads (use 0 for hardware max)')

# expert options: the defaults should be reasonable for a local installation; different values may be preferred for installation in common areas
option('z_install_envfile', type: 'boolean', value: true, description: 'Install a sourceable environment variable file')
Expand Down
2 changes: 1 addition & 1 deletion src/iguana/tests/iguana_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ int main(int argc, char** argv)

// parse option arguments
int opt;
while((opt = getopt(argc, argv, "hf:n:a:b:p:t:o:v|")) != -1) {
while((opt = getopt(argc, argv, "hf:n:a:b:p:t:j:o:v|")) != -1) {
switch(opt) {
case 'h':
return UsageOptions(2);
Expand Down
6 changes: 5 additions & 1 deletion src/iguana/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ foreach algo : algo_dict
'algorithm-' + test_name_algo,
test_exe,
suite: [ 'algorithm' ],
args: test_args + [ '-n', '0' ],#get_option('test_num_events') ],
args: test_args + [
'-n', get_option('test_num_events'),
'-j', get_option('test_multithreading').to_string(),
],
is_parallel: get_option('test_multithreading') < 0, # don't parallelize these tests if `test_multithreading >= 0`
env: project_test_env,
timeout: 0,
)
Expand Down

0 comments on commit 965ba98

Please sign in to comment.