The Meson Build System
http://mesonbuild.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.3 KiB
36 lines
1.3 KiB
11 years ago
|
project('test features', 'c')
|
||
|
|
||
|
e1 = executable('cmd_args', 'cmd_args.c')
|
||
|
e2 = executable('envvars', 'envvars.c')
|
||
8 years ago
|
e3 = executable('env2vars', 'env2vars.c')
|
||
11 years ago
|
|
||
8 years ago
|
env = environment()
|
||
|
env.set('first', 'val1')
|
||
|
env.set('second', 'val2')
|
||
|
env.set('third', 'val3', 'and_more', separator: ':')
|
||
|
env.append('PATH', 'fakepath', separator: ':')
|
||
|
|
||
8 years ago
|
# Make sure environment objects are copied on assignment and we can
|
||
|
# change the copy without affecting the original environment object.
|
||
|
env2 = env
|
||
|
env2.set('first', 'something-else')
|
||
|
|
||
11 years ago
|
test('command line arguments', e1, args : ['first', 'second'])
|
||
8 years ago
|
test('environment variables', e2, env : env)
|
||
8 years ago
|
test('environment variables 2', e3, env : env2)
|
||
7 years ago
|
|
||
|
# https://github.com/mesonbuild/meson/issues/2211#issuecomment-327741571
|
||
|
env_array = ['MESONTESTING=picklerror']
|
||
|
testfile = files('testfile.txt')
|
||
|
testerpy = find_program('tester.py')
|
||
|
test('file arg', testerpy, args : testfile, env : env_array)
|
||
|
|
||
|
copy = find_program('copyfile.py')
|
||
|
tester = executable('tester', 'tester.c')
|
||
|
testfilect = custom_target('testfile',
|
||
|
input : testfile,
|
||
|
output : 'outfile.txt',
|
||
|
build_by_default : true,
|
||
|
command : [copy, '@INPUT@', '@OUTPUT@'])
|
||
|
test('custom target arg', tester, args : testfilect, env : env_array)
|