Release 1.22.5
[platform/upstream/gstreamer.git] / subprojects / gst-integration-testsuites / testsuites / ges.py
1 # -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
2 #
3 # Copyright (c) 2014,Thibault Saunier <thibault.saunier@collabora.com>
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this program; if not, write to the
17 # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 # Boston, MA 02110-1301, USA.
19
20 """
21 The GES GstValidate default testsuite
22 """
23 import os
24 import pathlib
25 import subprocess
26 from launcher import utils
27 from testsuiteutils import update_assets
28 from ges_known_issues import KNOWN_ISSUES
29
30
31 TEST_MANAGER = "ges"
32
33
34 def setup_tests(test_manager, options):
35     assets_dir = os.path.abspath(os.path.join(
36         os.path.dirname(__file__), "..", "medias", "defaults"))
37     if options.sync:
38         if not utils.USING_SUBPROJECT:
39             if not update_assets(options, assets_dir):
40                 return False
41         else:
42             print("Syncing gst-integration-testsuites media files")
43             subprocess.check_call(['git', 'submodule', 'update', '--init'],
44                                   cwd=utils.DEFAULT_GST_QA_ASSETS)
45             subprocess.check_call(['git', 'lfs', 'pull', '--exclude='],
46                                   cwd=pathlib.Path(utils.DEFAULT_GST_QA_ASSETS) / 'medias')
47     options.add_paths(os.path.abspath(os.path.join(os.path.dirname(__file__),
48                                                    "..", "medias", "defaults")))
49     projects_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "ges",
50                                                  "ges-projects"))
51     scenarios_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "ges",
52                                                   "scenarios"))
53     test_manager.add_expected_issues(KNOWN_ISSUES)
54     test_manager.register_defaults(projects_path, scenarios_path)
55     return True