2016-09-07 20:24:53 +00:00
|
|
|
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
|
|
|
|
#
|
|
|
|
# Copyright (c) 2016,Thibault Saunier <thibault.saunier@osg.samsung.com>
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
"""
|
2020-05-07 04:23:07 +00:00
|
|
|
import os
|
|
|
|
from launcher.apps.gstvalidate import GstValidateSimpleTestsGenerator
|
2016-09-07 20:24:53 +00:00
|
|
|
|
|
|
|
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",
|
2019-03-18 19:52:11 +00:00
|
|
|
{"expected-issues": [
|
2016-09-07 20:24:53 +00:00
|
|
|
{'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",
|
2024-03-06 19:37:48 +00:00
|
|
|
r"\( \( audiotestsrc \) ! input-selector name=i \) ! capsfilter name=capsfilter caps=video/x-raw ! fakesink",
|
2019-03-18 19:52:11 +00:00
|
|
|
{"expected-issues": [
|
2016-09-07 20:24:53 +00:00
|
|
|
{'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):
|
2020-05-07 04:23:07 +00:00
|
|
|
testsuite_dir = os.path.realpath(os.path.join(os.path.dirname(__file__)))
|
|
|
|
|
2016-09-07 20:24:53 +00:00
|
|
|
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))
|
|
|
|
|
2020-05-07 04:23:07 +00:00
|
|
|
test_manager.add_generators(
|
|
|
|
GstValidateSimpleTestsGenerator("simple", test_manager,
|
|
|
|
os.path.join(testsuite_dir))
|
|
|
|
)
|
|
|
|
|
2016-09-07 20:24:53 +00:00
|
|
|
return True
|