From 5dee7c8f472bb28adc7af031810ac5bcbb75f62d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 7 Sep 2016 17:24:53 -0300 Subject: [PATCH] validate: tests: Add launcher based GstValidate tests First checking the new not negotiated error reporting code. --- validate/tests/launcher_tests/meson.build | 9 +++ .../tests/launcher_tests/test_validate.py | 55 +++++++++++++++++++ validate/tests/meson.build | 2 + 3 files changed, 66 insertions(+) create mode 100644 validate/tests/launcher_tests/meson.build create mode 100644 validate/tests/launcher_tests/test_validate.py diff --git a/validate/tests/launcher_tests/meson.build b/validate/tests/launcher_tests/meson.build new file mode 100644 index 0000000000..91e101e128 --- /dev/null +++ b/validate/tests/launcher_tests/meson.build @@ -0,0 +1,9 @@ +launcher = find_program(meson.build_root() + '/validate/tools/gst-validate-launcher', + required : false) + +if launcher.found() + test_name = 'launcher_tests' + test(test_name, launcher, args: ['-o', meson.build_root() + '/validate-launcher-output/', + meson.current_source_dir() + '/test_validate.py'], + env: ['GST_REGISTRY=@0@/@1@.registry'.format(meson.current_build_dir(), test_name)]) +endif diff --git a/validate/tests/launcher_tests/test_validate.py b/validate/tests/launcher_tests/test_validate.py new file mode 100644 index 0000000000..f03441376b --- /dev/null +++ b/validate/tests/launcher_tests/test_validate.py @@ -0,0 +1,55 @@ +# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python +# +# Copyright (c) 2016,Thibault Saunier +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301, USA. + +""" +The GstValidate default testsuite +""" + +TEST_MANAGER = "validate" + + +def get_pipelines(test_manager): + return [("not_negotiated.accept_caps_failure", + "audiotestsrc ! audio/x-raw,channels=2,channel-mask='(bitmask)0x67' " + "! audioconvert ! capsfilter caps=audio/x-raw,channels=6,channel-mask='(bitmask)0x32' " + " name=capsfilter ! fakesink", + {"expected-failures": [ + {'returncode': 18}, + {'level': 'critical', 'summary': 'a NOT NEGOTIATED message has been posted on the bus.', + 'details': r'.*Caps negotiation failed at pad.*capsfilter:sink.*as it refused caps:.*'}]}), + ("not_negotiated.caps_query_failure", + "audiotestsrc ! input-selector name=i ! capsfilter name=capsfilter caps=video/x-raw ! fakesink", + {"expected-failures": [ + {'returncode': 18}, + {'level': 'critical', 'summary': 'a NOT NEGOTIATED message has been posted on the bus.', + 'details': 'Caps negotiation failed starting from pad \'capsfilter:sink\' as the ' + 'QUERY_CAPS returned EMPTY caps for the following possible reasons:'}]})] + + +def setup_tests(test_manager, options): + print("Setting up tests to test GstValidate") + # No restriction about scenarios that are potentially used + valid_scenarios = ["play_15s"] + test_manager.add_scenarios(valid_scenarios) + test_manager.add_generators(test_manager.GstValidatePipelineTestsGenerator + ("test_validate", test_manager, + pipelines_descriptions=get_pipelines(test_manager), + valid_scenarios=valid_scenarios)) + + return True diff --git a/validate/tests/meson.build b/validate/tests/meson.build index 76b079162c..2153ca1c60 100644 --- a/validate/tests/meson.build +++ b/validate/tests/meson.build @@ -2,3 +2,5 @@ if host_machine.system() != 'windows' subdir('check') endif + +subdir('launcher_tests')