Esempio n. 1
0
        public IOTestSuite()
        {
            var(success, diagnostics) = RuntimeCompiler.CompileToExe(_fastInputExeName, _fastInputSource);
            if (!success)
            {
                throw new Exception();
            }
            (success, diagnostics) = RuntimeCompiler.CompileToExe(_fastInputAndOutputExeName, _fastInputAndOutputSource);
            if (!success)
            {
                throw new Exception();
            }

            (success, diagnostics) = RuntimeCompiler.CompileToExe(_slowInputExeName, _slowInputSource);
            if (!success)
            {
                throw new Exception();
            }
            (success, diagnostics) = RuntimeCompiler.CompileToExe(_slowInputAndOutputExeName, _slowInputAndOutputSource);
            if (!success)
            {
                throw new Exception();
            }

            (success, diagnostics) = RuntimeCompiler.CompileToExe(_slowestInputExeName, _slowestInputSource);
            if (!success)
            {
                throw new Exception();
            }
            (success, diagnostics) = RuntimeCompiler.CompileToExe(_slowestInputAndOutputExeName, _slowestInputAndOutputSource);
            if (!success)
            {
                throw new Exception();
            }

            var inputBuilder = new StringBuilder();

            inputBuilder.AppendLine($"{_inputSize}");
            for (int i = 0; i < _inputSize; ++i)
            {
                inputBuilder.Append(InputGenerator.GenerateRandomInt(0, 100000));
                inputBuilder.AppendLine();
            }
            _input = inputBuilder.ToString();
        }