Beispiel #1
0
        private static TestResult MakeCheck(string solutionFileName, string checkerFileName, string inputTestFileName,
                                            string outputTestFileName, int timeLimit, int memoryLimit, Language language, bool withChecker = true)
        {
            LanguageHandler currentLanguageHandler;

            switch (language)
            {
            case Language.CSharp:
                currentLanguageHandler = new CSharpHandler();
                break;

            case Language.Cpp:
                currentLanguageHandler = new CppHandler();
                break;

            default:
                currentLanguageHandler = new CSharpHandler();
                break;
            }

            CheckParameters parameters = new CheckParametersForSolution(solutionFileName, inputTestFileName, outputTestFileName,
                                                                        timeLimit > 0 ? timeLimit : 0, memoryLimit > 0 ? memoryLimit : 0);

            parameters.LanguageHandler = currentLanguageHandler;

            return(withChecker ? ContestHandler.CheckWithChecker(parameters, checkerFileName) : ContestHandler.Check(parameters));
        }
Beispiel #2
0
        private static string GenerateTest(string generatorFileName, string inputTestFileName, string outputTestFileName,
                                           int timeLimit, int memoryLimit, Language language)
        {
            LanguageHandler currentLanguageHandler;

            switch (language)
            {
            case Language.CSharp:
                currentLanguageHandler = new CSharpHandler();
                break;

            case Language.Cpp:
                currentLanguageHandler = new CppHandler();
                break;

            default:
                currentLanguageHandler = new CSharpHandler();
                break;
            }

            var parameters = new CheckParametersForGenerator(generatorFileName, inputTestFileName, outputTestFileName,
                                                             timeLimit > 0 ? timeLimit : 0, memoryLimit > 0 ? memoryLimit : 0)
            {
                LanguageHandler = currentLanguageHandler
            };

            return(ContestHandler.GenerateTestOutput(parameters));
        }