From 235efd789a54fec8bf62c24a8fc3971b749381e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 9 May 2019 20:37:09 +0200 Subject: [PATCH] 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 --- meson.build | 2 +- test/meson.build | 9 +++++++++ test/no-bar.yml | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/meson.build create mode 100644 test/no-bar.yml diff --git a/meson.build b/meson.build index b105335..6f996c9 100644 --- a/meson.build +++ b/meson.build @@ -105,7 +105,7 @@ f00bar = executable( install: true, install_rpath: '$ORIGIN/../' + get_option('libdir') + '/f00bar') -test('f00bar-is-executable', f00bar, args: ['--version']) +subdir('test') install_headers( 'color.h', diff --git a/test/meson.build b/test/meson.build new file mode 100644 index 0000000..c77fd0d --- /dev/null +++ b/test/meson.build @@ -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) diff --git a/test/no-bar.yml b/test/no-bar.yml new file mode 100644 index 0000000..95e1486 --- /dev/null +++ b/test/no-bar.yml @@ -0,0 +1,3 @@ +top-level-isnt-bar: + hello: world +