Commit f1aae74b authored by Thibault Saunier's avatar Thibault Saunier 🌵

testsuites: Implement asset updating ourself

Reviewers: Mathieu_Du

Differential Revision: http://phabricator.freedesktop.org/D91
parent 6161642f
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
#
# Copyright (c) 2015, Thibault Saunier <thibault.saunier@collabora.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.
import subprocess
from launcher import utils
SYNC_ASSETS_COMMAND = "git fetch origin && git checkout origin/master && git annex get ."
def update_assets(assets_dir):
try:
utils.launch_command("cd %s && %s" % (assets_dir, SYNC_ASSETS_COMMAND),
fails=True)
except subprocess.CalledProcessError as e:
utils.printc("Could not update assets repository\n\nError: %s"
"\n\nMAKE SURE YOU HAVE git-annex INSTALLED!" % (e),
utils.Colors.FAIL, True)
return False
return True
......@@ -22,22 +22,25 @@ The GstValidate default testsuite
"""
import os
from testsuiteutils import update_assets
TEST_MANAGER = "validate"
TEST_MANAGER = "validate"
BLACKLIST = [('validate.file.transcode.to_vorbis_and_vp8_in_webm.GH1_00094_1920x1280_MTS',
'Got error: Internal data stream error. -- Debug message: mpegtsbase.c(1371):'
'mpegts_base_loop (): ...: stream stopped, reason not-negotiated')]
BLACKLIST =[('validate.file.transcode.to_vorbis_and_vp8_in_webm.GH1_00094_1920x1280_MTS',
'Got error: Internal data stream error. -- Debug message: mpegtsbase.c(1371):'
'mpegts_base_loop (): ...: stream stopped, reason not-negotiated'),
]
def setup_tests(test_manager, options):
print("Setting up GstValidate default tests")
options.add_paths(os.path.abspath(os.path.join(os.path.dirname(__file__),
"..", "medias", "defaults")))
assets_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "medias", "defaults"))
if options.sync:
update_assets(assets_dir)
options.add_paths(assets_dir)
options.set_http_server_dir(os.path.abspath(os.path.join(os.path.dirname(__file__),
"..", "medias")))
"..", "medias")))
test_manager.set_default_blacklist(BLACKLIST)
test_manager.register_defaults()
......@@ -51,30 +54,27 @@ def setup_tests(test_manager, options):
for compositor in ["compositor", "glvideomixer"]:
test_manager.add_generators(
test_manager.GstValidateMixerTestsGenerator(compositor + ".simple", test_manager,
compositor,
"video",
converter="deinterlace ! videoconvert",
mixed_srcs={
"synchronized": {"mixer_props": "sink_1::alpha=0.5 sink_1::xpos=50 sink_1::ypos=50",
"sources":
("videotestsrc pattern=snow timestamp-offset=3000000000 ! 'video/x-raw,format=AYUV,width=640,height=480,framerate=(fraction)30/1' ! timeoverlay",
"videotestsrc pattern=smpte ! 'video/x-raw,format=AYUV,width=800,height=600,framerate=(fraction)10/1' ! timeoverlay")},
"bgra": ("videotestsrc ! video/x-raw, framerate=\(fraction\)10/1, width=100, height=100",
"videotestsrc ! video/x-raw, framerate=\(fraction\)5/1, width=320, height=240")
},
valid_scenarios=valid_mixing_scenarios))
compositor,
"video",
converter="deinterlace ! videoconvert",
mixed_srcs={
"synchronized": {"mixer_props": "sink_1::alpha=0.5 sink_1::xpos=50 sink_1::ypos=50", # noqa
"sources":
("videotestsrc pattern=snow timestamp-offset=3000000000 ! 'video/x-raw,format=AYUV,width=640,height=480,framerate=(fraction)30/1' ! timeoverlay", # noqa
"videotestsrc pattern=smpte ! 'video/x-raw,format=AYUV,width=800,height=600,framerate=(fraction)10/1' ! timeoverlay")}, # noqa
"bgra": ("videotestsrc ! video/x-raw, framerate=\(fraction\)10/1, width=100, height=100", # noqa
"videotestsrc ! video/x-raw, framerate=\(fraction\)5/1, width=320, height=240")
},
valid_scenarios=valid_mixing_scenarios))
test_manager.add_generators(
test_manager.GstValidateMixerTestsGenerator("audiomixer.simple", test_manager,
"audiomixer",
"audio",
converter="audioconvert ! audioresample",
mixed_srcs={
"basic": {"mixer_props": "",
"sources":
("audiotestsrc wave=triangle",
"audiotestsrc wave=ticks")},
},
valid_scenarios=valid_mixing_scenarios))
"audiomixer",
"audio",
converter="audioconvert ! audioresample",
mixed_srcs={"basic": {"mixer_props": "",
"sources": ("audiotestsrc wave=triangle",
"audiotestsrc wave=ticks")}},
valid_scenarios=valid_mixing_scenarios))
return True
......@@ -22,6 +22,7 @@ The GstValidate default testsuite
"""
import os
from testsuiteutils import update_assets
TEST_MANAGER = "validate"
......@@ -39,8 +40,11 @@ BLACKLIST =[("validate.*reverse.*Sintel_2010_720p_mkv",
def setup_tests(test_manager, options):
print("Setting up GstValidate default tests")
options.add_paths(os.path.abspath(os.path.join(os.path.dirname(__file__),
"..", "medias", "big")))
assets_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "medias", "big"))
if options.sync:
update_assets(assets_dir)
options.add_paths(assets_dir)
test_manager.set_default_blacklist(BLACKLIST)
test_manager.register_defaults()
test_manager.add_scenarios([
......@@ -49,5 +53,3 @@ def setup_tests(test_manager, options):
])
return True
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment