| 1 |
# SPDX-License-Identifier: Apache-2.0 |
| 2 |
# Copyright © 2026 Intel Corporation |
| 3 |
|
| 4 |
project( |
| 5 |
'default', |
| 6 |
'cpp', |
| 7 |
meson_version : '>= 1.12.0', |
| 8 |
default_options : {'cpp_std' : 'c++14'}, |
| 9 |
) |
| 10 |
|
| 11 |
exe = executable( |
| 12 |
'prog', |
| 13 |
'prog.cpp', |
| 14 |
override_options : default(), |
| 15 |
) |
| 16 |
|
| 17 |
exe2 = executable( |
| 18 |
'prog2', |
| 19 |
'prog.cpp', |
| 20 |
kwargs : default(), |
| 21 |
) |
| 22 |
|
| 23 |
test_kwargs = { |
| 24 |
'protocol' : default(), |
| 25 |
} |
| 26 |
|
| 27 |
test('exe_test', exe, kwargs : test_kwargs) |
| 28 |
|
| 29 |
testcase expect_error('default() objects are not allowed for required positional arguments') |
| 30 |
executable(default(), 'prog.cpp') |
| 31 |
endtestcase |
| 32 |
|
| 33 |
testcase expect_error('default() objects are not allowed for variadic arguments') |
| 34 |
add_languages(default()) |
| 35 |
endtestcase |
| 36 |
|
| 37 |
testcase expect_error('default() objects are not allowed for optional positional arguments') |
| 38 |
assert(true, default()) |
| 39 |
endtestcase |
| 40 |
|
| 41 |
testcase expect_error('"install_symlink" got a default() value for the required keyword argument "install_dir". default() may not be used for required keyword arguments.') |
| 42 |
install_symlink('foo', pointing_to : '/foo', install_dir : default()) |
| 43 |
endtestcase |
| 44 |
|
| 45 |
foo = default() |
| 46 |
get_variable('foo') |
| 47 |
unset_variable('foo') |
| 48 |
set_variable('var', default()) |