Exemple #1
0
 private void ExecuteExe(string exeName)
 {
     var(exitCode, output) = RuntimeCompiler.ExecuteExe(exeName, _input);
     if (exitCode != 0)
     {
         throw new Exception();
     }
 }
Exemple #2
0
        protected void Test([CallerMemberName] string testName = null)
        {
            var(success, diagnostics) = RuntimeCompiler.CompileToExe(testName, TestSource);
            Assert.IsTrue(success, message: string.Join(Environment.NewLine, diagnostics));

            for (int i = 0; i < TestInputs.Count; ++i)
            {
                var(exitCode, output) = RuntimeCompiler.ExecuteExe(testName, TestInputs[i]);
                Assert.AreEqual(0, exitCode, message: "Non-zero exit code (runtime error).");
                Assert.AreEqual(TestOutputs[i], output);
            }
        }