Skip to content

Commit

Permalink
add info about skipped tests (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau authored Aug 8, 2023
1 parent 125f217 commit 10baa5d
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 57 deletions.
5 changes: 1 addition & 4 deletions tests/test_bids_model.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,7 @@ function test_model_default_no_events()
function test_model_validate()

if bids.internal.is_octave()
% TODO fix Octave error in CI
% failure: warning 'Octave:mixed-string-concat' was raised,
% expected 'Model:missingField'. Stack trace:
return
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

bm = bids.Model();
Expand Down
4 changes: 2 additions & 2 deletions tests/test_derivatives_json.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function test_derivatives_json_basic()

function test_derivatives_json_entity_as_number()

if bids.internal.is_octave
return
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

filename = 'sub-01_ses-test_task-faceRecognition_run-02_res-2_bold.nii';
Expand Down
10 changes: 4 additions & 6 deletions tests/test_report.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function test_report_asl()

% TODO make it work on Octave
if bids.internal.is_octave()
return
moxunit_throw_test_skipped_exception('Octave: TODO');
end
assertEqual(content, expected);

Expand Down Expand Up @@ -63,7 +63,7 @@ function test_report_basic()

% TODO make it work on Octave
if bids.internal.is_octave()
return
moxunit_throw_test_skipped_exception('Octave: TODO');
end

assertEqual(content, expected);
Expand Down Expand Up @@ -93,9 +93,8 @@ function test_report_pet()
content = get_report_content(report);
expected = get_expected_content(cfg, datasets, filter.modality);

% TODO make it work on Octave
if bids.internal.is_octave()
return
moxunit_throw_test_skipped_exception('Octave: TODO');
end
assertEqual(content, expected);

Expand Down Expand Up @@ -131,9 +130,8 @@ function test_report_moae_data()
content = get_report_content(report);
expected = get_expected_content(cfg, 'MoAE', 'all');

% TODO make it work on Octave
if bids.internal.is_octave()
return
moxunit_throw_test_skipped_exception('Octave: TODO');
end
assertEqual(content, expected);

Expand Down
13 changes: 7 additions & 6 deletions tests/tests_layout/test_layout_derivatives.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ function test_layout_warning_invalid_subfolder_struct_fieldname()
invalid_subfolder = fullfile(get_test_data_dir(), '..', ...
'data', 'synthetic', 'derivatives', 'invalid_subfolder');

% 'Octave:mixed-string-concat'
if ~bids.internal.is_octave
assertWarning(@()bids.layout(invalid_subfolder, ...
'use_schema', false, ...
'verbose', true), ...
'layout:invalidSubfolderName');
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

assertWarning(@()bids.layout(invalid_subfolder, ...
'use_schema', false, ...
'verbose', true), ...
'layout:invalidSubfolderName');

end

function test_layout_nested()
Expand Down
57 changes: 30 additions & 27 deletions tests/tests_private/test_append_to_layout.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,44 @@ function test_layout_missing_subgroup()
synthetic_derivatives = fullfile(get_test_data_dir(), '..', ...
'data', 'synthetic', 'derivatives', 'manual');

if ~bids.internal.is_octave % skipping because Octave:mixed-string-concat
assertWarning(@()bids.layout(synthetic_derivatives, 'verbose', true), ...
'append_to_layout:unknownSuffix');
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

assertWarning(@()bids.layout(synthetic_derivatives, 'verbose', true), ...
'append_to_layout:unknownSuffix');

end

function test_append_to_layout_schema_unknown_entity()

if ~bids.internal.is_octave()
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

[subject, modality, schema, previous] = set_up('meg');
[subject, modality, schema, previous] = set_up('meg');

file = 'sub-16_task-bar_foo-bar_meg.ds';
file = 'sub-16_task-bar_foo-bar_meg.ds';

assertWarning( ...
@()bids.internal.append_to_layout(file, subject, modality, schema, previous), ...
'append_to_layout:unknownEntity');

end
assertWarning( ...
@()bids.internal.append_to_layout(file, subject, modality, schema, previous), ...
'append_to_layout:unknownEntity');

end

function test_append_to_layout_schema_unknown_extension()

if ~bids.internal.is_octave()

[subject, modality, schema, previous] = set_up('meg');
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

file = 'sub-16_task-bar_meg.foo';
[subject, modality, schema, previous] = set_up('meg');

assertWarning( ...
@()bids.internal.append_to_layout(file, subject, modality, schema, previous), ...
'append_to_layout:unknownExtension');
file = 'sub-16_task-bar_meg.foo';

end
assertWarning( ...
@()bids.internal.append_to_layout(file, subject, modality, schema, previous), ...
'append_to_layout:unknownExtension');

end

Expand Down Expand Up @@ -85,17 +87,18 @@ function test_append_to_layout_basic()

function test_append_to_layout_schema_missing_required_entity()

if ~bids.internal.is_octave()
[subject, modality, schema, previous] = set_up('func');
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

% func with missing task entity
file = 'sub-16_bold.nii.gz';
[subject, modality, schema, previous] = set_up('func');

assertWarning( ...
@()bids.internal.append_to_layout(file, subject, modality, schema, previous), ...
'append_to_layout:missingRequiredEntity');
% func with missing task entity
file = 'sub-16_bold.nii.gz';

end
assertWarning( ...
@()bids.internal.append_to_layout(file, subject, modality, schema, previous), ...
'append_to_layout:missingRequiredEntity');

end

Expand Down
4 changes: 2 additions & 2 deletions tests/tests_private/test_list_all_trial_types.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function test_list_all_trial_types_warning()
trial_type_list = bids.internal.list_all_trial_types(BIDS, {'not', 'a', 'task'}, ...
'verbose', false);
assertEqual(trial_type_list, {});
if bids.internal.is_octave
return
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end
assertWarning(@() bids.internal.list_all_trial_types(BIDS, {'not', 'a', 'task'}, ...
'verbose', true), ...
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_private/test_parse_filename.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
function test_parse_filename_warnings()

if bids.internal.is_octave()
return
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

fields = {};
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_private/test_return_file_index.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function test_return_file_index_basic()

function test_return_file_index_warning()

if bids.internal.is_octave
return
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

pth_bids_example = get_test_data_dir();
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_utils/test_create_data_dict.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function test_create_data_dict_schema()

function test_create_data_dict_warning

if bids.internal.is_octave
return
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

dataset = 'ds000248';
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_utils/test_create_participants_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function test_create_participants_tsv_basic()
function test_create_participants_tsv_already_exist()

if bids.internal.is_octave()
return
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

bids_path = fullfile(get_test_data_dir(), 'ds210');
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_utils/test_create_readme.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function test_create_readme_basic()

function test_create_readme_warning_already_present()

if bids.internal.is_octave
return
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

bids_path = fullfile(get_test_data_dir(), 'ds116');
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_utils/test_create_sessions_tsv.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function test_create_sessions_tsv_no_session()

validate_dataset(bids_path);

if bids.internal.is_octave
return
if bids.internal.is_octave()
moxunit_throw_test_skipped_exception('Octave:mixed-string-concat warning thrown');
end

assertWarning(@() bids.util.create_sessions_tsv(bids_path, 'verbose', true), ...
Expand Down

0 comments on commit 10baa5d

Please sign in to comment.