Ejemplo n.º 1
0
    problem_URL_splitted = problem_URL.split('/')
    contest_name = problem_URL_splitted[-3]

    problem_dir = os.path.join(CONFIG.TESTCASES, contest_name)
    testcase_preffix = problem_URL_splitted[-1]
    program_file_abspath = os.path.join(PATH, program_filepath)

    # ファイルのフォーマットチェック
    program = Program(program_file_abspath)
    if program.check_invalid_extension():
        logger.warning('Invalid File extention')
        sys.exit(0)

    # testcase 取得
    testcase = TestCase(problem_URL, problem_dir, testcase_preffix)
    testcase.get_local_testcases()
    if len(testcase.testcase_files) == 0 or redownload:
        testcase.get_samples()
        testcase.get_local_testcases()
    if len(testcase.testcase_files) == 0:
        logger.warning('no testcases')
        sys.exit(0)

    # コンパイル、実行コマンドの準備
    program.compile()
    program.make_test_command()

    # 全テストケースチェック
    testcase.test_all_testcase(program.execute_command)
    testcase.display()