Example #1
0
    def process_cli(self):
        parser = OptionParser()
        parser.add_option("-o", "--output", dest="output", default="testlog.log", help="resulting log file. Default testlog.log")
        parser.add_option("-f", "--folder", dest="folder", default="omim-build-release/out/release", help="specify the folder where the tests reside (absolute path or relative to the location of this script)")
        parser.add_option("-i", "--include", dest="runlist", action="append", default=[], help="Include test into execution, comma separated list with no spaces or individual tests, or both. E.g.: -i one -i two -i three,four,five")
        parser.add_option("-r", "--user_resource_path", dest="user_resource_path", default="", help="Path to user resources, such as MWMs")
        parser.add_option("-d", "--data_path", dest="data_path", default="", help="Path to the writable dir")
        parser.add_option("-l", "--log_start_finish", dest="log_start_finish", action="store_true", default=False,
                          help="Write to log each time a test starts or finishes. May be useful if you need to find out which of the tests runs for how long, and which test hang. May slow down the execution of tests.")

        (options, args) = parser.parse_args()

        if not options.runlist:
            logging.warn("You must provide the list of tests to run. This runner doesn't run all the tests it finds, only the ones you specify.")
            exit(2)

        self.workspace_path = options.folder
        interim_runlist = list()
        for opt in options.runlist:
            interim_runlist.extend(map(lambda x: x.strip(), opt.split(",")))

        self.runlist = filter(lambda x: x in tests_on_disk(self.workspace_path), interim_runlist)
        self.output = options.output
        self.user_resource_path = options.user_resource_path
        self.data_path = options.data_path
        self.write_start_finish_log = options.log_start_finish
Example #2
0
    def set_instance_vars_from_options(self, args):
        self.workspace_path = args.folder
        for opt in args.runlist:
            self.runlist.extend(map(str.strip, opt.split(",")))

        tests_on_disk_list = tests_on_disk(self.workspace_path)
        self.runlist = filter(lambda x: x in tests_on_disk_list, self.runlist)

        self.params[RESOURCE_PATH_KEY] = args.user_resource_path
        self.params[DATA_PATH_KEY] = args.data_path
Example #3
0
    def set_instance_vars_from_options(self, args):
        self.workspace_path = args.folder
        for opt in args.runlist:
            self.runlist.extend(map(str.strip, opt.split(",")))

        tests_on_disk_list = tests_on_disk(self.workspace_path)
        self.runlist = filter(lambda x: x in tests_on_disk_list, self.runlist)

        self.params[RESOURCE_PATH_KEY] = args.user_resource_path
        self.params[DATA_PATH_KEY] = args.data_path
    def process_cli(self):
        parser = OptionParser()
        parser.add_option("-o", "--output", dest="output", default="testlog.log", help="resulting log file. Default testlog.log")
        parser.add_option("-f", "--folder", dest="folder", default="omim-build-release/out/release", help="specify the folder where the tests reside (absolute path or relative to the location of this script)")
        parser.add_option("-i", "--include", dest="runlist", action="append", default=[], help="Include test into execution, comma separated list with no spaces or individual tests, or both. E.g.: -i one -i two -i three,four,five")

        (options, args) = parser.parse_args()

        if not options.runlist:
            logging.warn("You must provide the list of tests to run. This runner doesn't run all the tests it finds, only the ones you specify.")
            exit(2)

        self.workspace_path = options.folder
        self.runlist = filter(lambda x: x in tests_on_disk(self.workspace_path), options.runlist)
        self.output = options.output
    def process_cli(self):
        parser = OptionParser()
        parser.add_option("-o",
                          "--output",
                          dest="output",
                          default="testlog.log",
                          help="resulting log file. Default testlog.log")
        parser.add_option(
            "-f",
            "--folder",
            dest="folder",
            default="omim-build-release/out/release",
            help=
            "specify the folder where the tests reside (absolute path or relative to the location of this script)"
        )
        parser.add_option(
            "-i",
            "--include",
            dest="runlist",
            action="append",
            default=[],
            help=
            "Include test into execution, comma separated list with no spaces or individual tests, or both. E.g.: -i one -i two -i three,four,five"
        )
        parser.add_option("-r",
                          "--user_resource_path",
                          dest="user_resource_path",
                          default="",
                          help="Path to user resources, such as MWMs")
        parser.add_option("-d",
                          "--data_path",
                          dest="data_path",
                          default="",
                          help="Path to the writable dir")
        parser.add_option(
            "-l",
            "--log_start_finish",
            dest="log_start_finish",
            action="store_true",
            default=False,
            help=
            "Write to log each time a test starts or finishes. May be useful if you need to find out which of the tests runs for how long, and which test hang. May slow down the execution of tests."
        )

        (options, args) = parser.parse_args()

        if not options.runlist:
            logging.warn(
                "You must provide the list of tests to run. This runner doesn't run all the tests it finds, only the ones you specify."
            )
            exit(2)

        self.workspace_path = options.folder
        interim_runlist = list()
        for opt in options.runlist:
            interim_runlist.extend(map(lambda x: x.strip(), opt.split(",")))

        self.runlist = filter(
            lambda x: x in tests_on_disk(self.workspace_path), interim_runlist)
        self.output = options.output
        self.user_resource_path = options.user_resource_path
        self.data_path = options.data_path
        self.write_start_finish_log = options.log_start_finish