Exemple #1
0
    def register_defaults(self, project_paths=None):
        projects = list()
        if not self.args:
            if project_paths == None:
                path = self.options.projects_paths
            else:
                path = project_paths

            for root, dirs, files in os.walk(path):
                for f in files:
                    if not f.endswith(".xges"):
                        continue
                    projects.append(utils.path2url(os.path.join(path, root, f)))
        else:
            for proj_uri in self.args:
                if not utils.isuri(proj_uri):
                    proj_uri = utils.path2url(proj_uri)

                if os.path.exists(proj_uri):
                    projects.append(proj_uri)

        if self.options.long_limit != 0:
            scenarios = ["none",
                         "scrub_forward_seeking",
                         "scrub_backward_seeking"]
        else:
            scenarios = ["play_15s",
                         "scrub_forward_seeking_full",
                         "scrub_backward_seeking_full"]
        for proj_uri in projects:
            # First playback casses
            project = XgesProjectDescriptor(proj_uri)
            for scenario_name in scenarios:
                scenario = self._scenarios.get_scenario(scenario_name)
                if scenario is None:
                    continue

                if scenario.get_min_media_duration() >= (project.get_duration() / utils.GST_SECOND):
                    continue

                classname = "playback.%s.%s" % (scenario.name,
                                                    os.path.basename(proj_uri).replace(".xges", ""))
                self.add_test(GESPlaybackTest(classname,
                                              self.options,
                                              self.reporter,
                                              project,
                                              scenario=scenario)
                                  )

            # And now rendering casses
            for comb in GES_ENCODING_TARGET_COMBINATIONS:
                classname = "render.%s.%s" % (str(comb).replace(' ', '_'),
                                                  os.path.splitext(os.path.basename(proj_uri))[0])
                self.add_test(GESRenderTest(classname, self.options,
                                            self.reporter, project,
                                            combination=comb)
                                  )
Exemple #2
0
    def _set_rendering_info(self):
        self.dest_file = path = os.path.join(self.options.dest,
                                             self.classname.replace(".render.", os.sep).
                                             replace(".", os.sep))
        utils.mkdir(os.path.dirname(urllib.parse.urlsplit(self.dest_file).path))
        if not utils.isuri(self.dest_file):
            self.dest_file = utils.path2url(self.dest_file)

        profile = self.get_profile()
        self.add_arguments("-f", profile, "-o", self.dest_file)
Exemple #3
0
    def _set_rendering_info(self):
        self.dest_file = path = os.path.join(
            self.options.dest,
            self.classname.replace(".render.", os.sep).replace(".", os.sep))
        utils.mkdir(os.path.dirname(
            urllib.parse.urlsplit(self.dest_file).path))
        if not utils.isuri(self.dest_file):
            self.dest_file = utils.path2url(self.dest_file)

        profile = self.get_profile()
        self.add_arguments("-f", profile, "-o", self.dest_file)
Exemple #4
0
    def register_defaults(self, project_paths=None):
        projects = list()
        if not self.args:
            if project_paths == None:
                path = self.options.projects_paths
            else:
                path = project_paths

            for root, dirs, files in os.walk(path):
                for f in files:
                    if not f.endswith(".xges"):
                        continue
                    projects.append(utils.path2url(os.path.join(path, root,
                                                                f)))
        else:
            for proj_uri in self.args:
                if not utils.isuri(proj_uri):
                    proj_uri = utils.path2url(proj_uri)

                if os.path.exists(proj_uri):
                    projects.append(proj_uri)

        if self.options.long_limit != 0:
            scenarios = [
                "none", "scrub_forward_seeking", "scrub_backward_seeking"
            ]
        else:
            scenarios = [
                "play_15s", "scrub_forward_seeking_full",
                "scrub_backward_seeking_full"
            ]
        for proj_uri in projects:
            # First playback casses
            project = XgesProjectDescriptor(proj_uri)
            for scenario_name in scenarios:
                scenario = self._scenarios.get_scenario(scenario_name)
                if scenario is None:
                    continue

                if scenario.get_min_media_duration() >= (
                        project.get_duration() / utils.GST_SECOND):
                    continue

                classname = "playback.%s.%s" % (
                    scenario.name, os.path.basename(proj_uri).replace(
                        ".xges", ""))
                self.add_test(
                    GESPlaybackTest(classname,
                                    self.options,
                                    self.reporter,
                                    project,
                                    scenario=scenario))

            # And now rendering casses
            for comb in GES_ENCODING_TARGET_COMBINATIONS:
                classname = "render.%s.%s" % (str(comb).replace(
                    ' ', '_'), os.path.splitext(os.path.basename(proj_uri))[0])
                self.add_test(
                    GESRenderTest(classname,
                                  self.options,
                                  self.reporter,
                                  project,
                                  combination=comb))
Exemple #5
0
    def register_defaults(self, project_paths=None, scenarios_path=None):
        projects = list()
        all_scenarios = {}
        if not self.args:
            if project_paths == None:
                path = self.options.projects_paths
            else:
                path = project_paths

            for root, dirs, files in os.walk(path):
                for f in files:
                    if not f.endswith(".xges"):
                        continue
                    projects.append(utils.path2url(os.path.join(path, root,
                                                                f)))

            if self.options.scenarios_path:
                scenarios_path = self.options.scenarios_path

            if scenarios_path:
                for root, dirs, files in os.walk(scenarios_path):
                    for f in files:
                        name, ext = os.path.splitext(f)
                        f = os.path.join(root, f)
                        if ext == ".validatetest":
                            fpath = os.path.abspath(os.path.join(root, f))
                            pathname = os.path.abspath(os.path.join(
                                root, name))
                            name = pathname.replace(
                                os.path.commonpath([scenarios_path, root]),
                                '').replace('/', '.')
                            self.add_test(
                                GESTest('test' + name,
                                        self.options,
                                        self.reporter,
                                        None,
                                        testfile=fpath))
                            continue
                        elif ext != ".scenario":
                            continue
                        config = f + ".config"
                        if not os.path.exists(config):
                            config = None
                        all_scenarios[f] = config
        else:
            for proj_uri in self.args:
                if not utils.isuri(proj_uri):
                    proj_uri = utils.path2url(proj_uri)

                if os.path.exists(proj_uri):
                    projects.append(proj_uri)

        if self.options.long_limit != 0:
            scenarios = [
                "none", "scrub_forward_seeking", "scrub_backward_seeking"
            ]
        else:
            scenarios = [
                "play_15s", "scrub_forward_seeking_full",
                "scrub_backward_seeking_full"
            ]
        for proj_uri in projects:
            # First playback casses
            project = XgesProjectDescriptor(proj_uri)
            for scenario_name in scenarios:
                scenario = self._scenarios.get_scenario(scenario_name)
                if scenario is None:
                    continue

                if scenario.get_min_media_duration() >= (
                        project.get_duration() / utils.GST_SECOND):
                    continue

                classname = "playback.%s.%s" % (
                    scenario.name, os.path.basename(proj_uri).replace(
                        ".xges", ""))
                self.add_test(
                    GESPlaybackTest(classname,
                                    self.options,
                                    self.reporter,
                                    project,
                                    scenario=scenario,
                                    nest=False))
                #For nested timelines
                classname = "playback.nested.%s.%s" % (
                    scenario.name, os.path.basename(proj_uri).replace(
                        ".xges", ""))
                self.add_test(
                    GESPlaybackTest(classname,
                                    self.options,
                                    self.reporter,
                                    project,
                                    scenario=scenario,
                                    nest=True))

            # And now rendering casses
            for comb in GES_ENCODING_TARGET_COMBINATIONS:
                classname = "render.%s.%s" % (str(comb).replace(
                    ' ', '_'), os.path.splitext(os.path.basename(proj_uri))[0])
                self.add_test(
                    GESRenderTest(classname,
                                  self.options,
                                  self.reporter,
                                  project,
                                  combination=comb))
        if all_scenarios:
            for scenario in self._scenarios.discover_scenarios(
                    list(all_scenarios.keys())):
                config = all_scenarios[scenario.path]
                classname = "scenario.%s" % scenario.name
                test = GESScenarioTest(classname,
                                       self.options,
                                       self.reporter,
                                       scenario=scenario)
                if config:
                    test.add_validate_config(config)
                self.add_test(test)