meson: add a couple of expected-to-fail tests

Initial set of tests verifying we fail when trying to load:

a) a non-existing configuration
b) a non-regular file configuration (e.g. a directory)
c) configuration exists, but has no top-level 'bar' entry
This commit is contained in:
Daniel Eklöf 2019-05-09 20:37:09 +02:00
parent 937a684f9e
commit 235efd789a
3 changed files with 13 additions and 1 deletions

View file

@ -105,7 +105,7 @@ f00bar = executable(
install: true, install: true,
install_rpath: '$ORIGIN/../' + get_option('libdir') + '/f00bar') install_rpath: '$ORIGIN/../' + get_option('libdir') + '/f00bar')
test('f00bar-is-executable', f00bar, args: ['--version']) subdir('test')
install_headers( install_headers(
'color.h', 'color.h',

9
test/meson.build Normal file
View file

@ -0,0 +1,9 @@
test('is-executable', f00bar, args: ['--version'])
pwd = meson.current_source_dir()
# Configuratoin validation tests
test('no-config', f00bar, args: ['-c', 'xyz'], should_fail: true)
test('config-isnt-file', f00bar, args: ['-c', '.'], should_fail: true)
test('config-no-bar', f00bar, args: ['-c', join_paths(pwd, 'no-bar.yml')],
should_fail: true)

3
test/no-bar.yml Normal file
View file

@ -0,0 +1,3 @@
top-level-isnt-bar:
hello: world