From 30509252ca8dfa6e3146996c083076abf4aef9c7 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 11 Jun 2020 13:16:40 +0530 Subject: [PATCH] meson: Use the tests option for validate This is what gstreamer core does too, and avoids a configure error when tests are disabled globally. Also print a useful error when gst_tester is not found from the gstreamer subproject. This broke in https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/667 Part-of: --- meson_options.txt | 2 -- tests/meson.build | 5 +---- tests/validate/meson.build | 12 +++++++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index a1bee94d68..bb3cb3c4ed 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -87,5 +87,3 @@ option('package-origin', type : 'string', value : 'Unknown package origin', yiel description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') -option('validate', type : 'feature', value : 'auto', yield: true, - description: 'Enable validate tests.') diff --git a/tests/meson.build b/tests/meson.build index b15dd529bf..25bd3497fb 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -10,11 +10,8 @@ gst_plugin_scanner_path = join_paths(gst_plugin_scanner_dir, 'gst-plugin-scanner if not get_option('tests').disabled() and gst_check_dep.found() subdir('check') subdir('icles') + subdir('validate') endif if not get_option('examples').disabled() subdir('examples') endif - -if not get_option('validate').disabled() - subdir('validate') -endif diff --git a/tests/validate/meson.build b/tests/validate/meson.build index 6e89aedc55..da1f159d83 100644 --- a/tests/validate/meson.build +++ b/tests/validate/meson.build @@ -1,7 +1,13 @@ if gst_dep.type_name() == 'internal' - gst_tester = gst_proj.get_variable('gst_tester') + gst_tester = gst_proj.get_variable('gst_tester', false) + if gst_tester == false + if get_option('tests').enabled() + error('Tests are enabled for gst-plugins-base but were not enabled for the gstreamer subproject') + endif + subdir_done() + endif else - gst_tester = find_program('gst-tester-@0@'.format(api_version), required: get_option('validate')) + gst_tester = find_program('gst-tester-@0@'.format(api_version), required: get_option('tests')) if not gst_tester.found() subdir_done() endif @@ -42,4 +48,4 @@ foreach t: tests test_file = join_paths(meson.current_source_dir(), t + '.validatetest') test(test_name, gst_tester, args: [test_file, '--use-fakesinks'], env: test_env, timeout : 3 * 60, protocol: 'tap') -endforeach \ No newline at end of file +endforeach