コード例 #1
0
ファイル: gen.py プロジェクト: ioi-2022/tps
 def on_test(self, testset_name, test_name, line, line_number):
     if not SPECIFIC_TESTS or tu.test_name_matches_pattern(
             test_name, SPECIFIED_TESTS_PATTERN):
         command = [
             'bash',
             os.path.join(INTERNALS_DIR, 'gen_test.sh'),
             self.tests_dir,
             test_name,
         ] + shlex.split(line)
         wait_process_success(subprocess.Popen(command))
コード例 #2
0
    except tu.MalformedTestsException as e:
        cprinterr(colors.ERROR, "Error:")
        sys.stderr.write("{}\n".format(e))
        sys.exit(4)

    if SPECIFIC_TESTS:
        tu.check_pattern_exists_in_test_names(SPECIFIED_TESTS_PATTERN,
                                              test_name_list)
        test_name_list = tu.filter_test_names_by_pattern(
            test_name_list, SPECIFIED_TESTS_PATTERN)

    available_tests, missing_tests = tu.divide_tests_by_availability(
        test_name_list, tests_dir)
    if missing_tests:
        cprinterr(colors.WARN, "Missing tests: " + (", ".join(missing_tests)))

    for test_name in available_tests:
        command = [
            'bash',
            os.path.join(INTERNALS_DIR, 'invoke_test.sh'),
            tests_dir,
            test_name,
        ]
        wait_process_success(subprocess.Popen(command))

    if missing_tests:
        cprinterr(
            colors.WARN, "Missing {} {}!".format(
                len(missing_tests),
                "tests" if len(missing_tests) != 1 else "test"))