-# Now add "Theora and Vorbis in OGG container" as a wanted transcoding format. That means
-# that conversion to this format will be tested on all the media files/streams.
-validate.add_encoding_formats([MediaFormatCombination("ogg", "vorbis", "theora")])
-
-# Use the GstValidatePlaybinTestsGenerator to generate tests that will use playbin
-# and GstValidateTranscodingTestsGenerator to create media transcoding tests that
-# will use all the media format added with validate.add_encoding_formats
-validate.add_generators([validate.GstValidatePlaybinTestsGenerator(validate),
- GstValidateTranscodingTestsGenerator(self)])
-
-# Blacklist some tests that are known to fail because a feature is not supported
-# or due to any other reason.
-# The tuple defining those tests is of the form:
-# ("regex defining the test name", "Reason why the test should be disabled")
-validate.set_default_blacklist([
- ("validate.*.scenario1.*ogv$"
- "oggdemux does not support some action executed in scenario1")]
- )
+import os
+from launcher.baseclasses import MediaFormatCombination
+from launcher.apps.gstvalidate import *
+TEST_MANAGER = "validate"
+
+KNOWN_ISSUES = {}
+
+def setup_tests(test_manager, options):
+ print("Setting up the custom testsuite")
+ assets_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".", "samples_files"))
+ options.add_paths(assets_dir)
+
+ # This step will register default data for the test manager:
+ # - scenarios such as `play_15s`, `reverse_playback` etc.
+ # - encoding formats such as "mp4,h264,mp3" etc.
+ # - blacklist such as dash.media_check.*
+ # - test generators:
+ # - GstValidatePlaybinTestsGenerator
+ # - GstValidateMediaCheckTestsGenerator
+ # - GstValidateTranscodingTestsGenerator
+ # This 'defaults' can be found in 'gst-devtools/validate/launcher/apps/gstvalidate.py#register_defaults'
+ # test_manager.register_defaults()
+
+ # Add scenarios
+ scenarios = []
+ scenarios.append("play_5s")
+ scenarios.append("seek_backward")
+ test_manager.set_scenarios(scenarios)
+
+ # Add encoding formats used by the transcoding generator
+ test_manager.add_encoding_formats([
+ MediaFormatCombination("mp4", "mp3", "h264"),])
+
+ # Add generators
+ # GstValidatePlaybinTestsGenerator needs at least one media file
+ test_manager.add_generators([GstValidateMediaCheckTestsGenerator(test_manager)])
+ # GstValidatePlaybinTestsGenerator needs at least one scenario
+ test_manager.add_generators([GstValidatePlaybinTestsGenerator(test_manager)])
+ # GstValidateTranscodingTestsGenerator needs at least one MediaFormatCombination
+ test_manager.add_generators([GstValidateTranscodingTestsGenerator(test_manager)])
+
+ # list of combo to blacklist tests. Here it blacklists all tests with playback.seek_backward
+ test_manager.set_default_blacklist([
+ ("custom_testsuite.file.playback.seek_backward.*",
+ "Not supported by this testsuite."),])
+
+ # you can even pass known issues to bypass an existing error in your custom testsuite
+ test_manager.add_expected_issues(KNOWN_ISSUES)
+ return True