diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-04-16 14:25:52 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-04-17 18:18:20 +0300 |
commit | 3103b336a64b1d2d56237bbffc7a0b4e3ebdc571 (patch) | |
tree | 04fd2e1e3c2ca6b403273ef81a3d5a0c332c6411 | |
parent | 66bc4856465714d2e3dab3e179fa011dc3ea6e94 (diff) | |
download | meson-3103b336a64b1d2d56237bbffc7a0b4e3ebdc571.zip meson-3103b336a64b1d2d56237bbffc7a0b4e3ebdc571.tar.gz meson-3103b336a64b1d2d56237bbffc7a0b4e3ebdc571.tar.bz2 |
tests/common/203: Use a test matrix
This allows us to test the one at a time, and the many at a time
functions without the second test getting cached. We really don't want
to get cached.
3 files changed, 41 insertions, 24 deletions
diff --git a/test cases/common/203 function attributes/meson.build b/test cases/common/203 function attributes/meson.build index 9ec948f..9817309 100644 --- a/test cases/common/203 function attributes/meson.build +++ b/test cases/common/203 function attributes/meson.build @@ -82,30 +82,30 @@ if ['gcc', 'intel'].contains(c.get_id()) endif endif +if get_option('mode') == 'single' + foreach a : attributes + x = c.has_function_attribute(a) + assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a)) + x = cpp.has_function_attribute(a) + assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a)) + endforeach -foreach a : attributes - x = c.has_function_attribute(a) - assert(x == expected_result, '@0@: @1@'.format(c.get_id(), a)) - x = cpp.has_function_attribute(a) - assert(x == expected_result, '@0@: @1@'.format(cpp.get_id(), a)) -endforeach - -win_expect = ['windows', 'cygwin'].contains(host_machine.system()) -foreach a : ['dllexport', 'dllimport'] - assert(c.has_function_attribute(a) == win_expect, - '@0@: @1@'.format(c.get_id(), a)) - assert(cpp.has_function_attribute(a) == win_expect, - '@0@: @1@'.format(cpp.get_id(), a)) -endforeach - -message('checking get_supported_function_attributes') -if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) - multi_expected = attributes + win_expect = ['windows', 'cygwin'].contains(host_machine.system()) + foreach a : ['dllexport', 'dllimport'] + assert(c.has_function_attribute(a) == win_expect, + '@0@: @1@'.format(c.get_id(), a)) + assert(cpp.has_function_attribute(a) == win_expect, + '@0@: @1@'.format(cpp.get_id(), a)) + endforeach else - multi_expected = [] -endif + if not ['msvc', 'clang-cl', 'intel-cl'].contains(c.get_id()) + multi_expected = attributes + else + multi_expected = [] + endif -multi_check = c.get_supported_function_attributes(attributes) -assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)') -multi_check = cpp.get_supported_function_attributes(attributes) -assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)') + multi_check = c.get_supported_function_attributes(attributes) + assert(multi_check == multi_expected, 'get_supported_function_arguments works (C)') + multi_check = cpp.get_supported_function_attributes(attributes) + assert(multi_check == multi_expected, 'get_supported_function_arguments works (C++)') +endif diff --git a/test cases/common/203 function attributes/meson_options.txt b/test cases/common/203 function attributes/meson_options.txt new file mode 100644 index 0000000..4a1d87c --- /dev/null +++ b/test cases/common/203 function attributes/meson_options.txt @@ -0,0 +1,7 @@ +option( + 'mode', + type : 'combo', + choices : ['single', 'parallel'], + value : 'single', + description : 'Test the one at a time function or many at a time function.' +) diff --git a/test cases/common/203 function attributes/test.json b/test cases/common/203 function attributes/test.json new file mode 100644 index 0000000..d06a24a --- /dev/null +++ b/test cases/common/203 function attributes/test.json @@ -0,0 +1,10 @@ +{ + "matrix": { + "options": { + "mode": [ + { "val": "single" }, + { "val": "parallel" } + ] + } + } +} |