예제 #1
0
파일: Driver.cs 프로젝트: jcteague/ironruby
        private void RunTestCase(TestCase/*!*/ testCase) {
            _testRuntime = new TestRuntime(this, testCase);

            Console.WriteLine("Executing {0}", testCase.Name);

            try {
                testCase.TestMethod();
            } catch (Exception e) {
                PrintTestCaseFailed();
                _unexpectedExceptions.Add(new Tuple<string, Exception>(testCase.Name, e));
            } finally {
                Snippets.SaveAndVerifyAssemblies();
            }
        }
예제 #2
0
        private void RunTestCase(TestCase/*!*/ testCase, ref int failedCount) {
            _testRuntime = new TestRuntime(this, testCase);

            Console.WriteLine("Executing {0}", testCase.Name);

            try {
                testCase.TestMethod();
            } catch (Exception e) {
                Console.Error.WriteLine(e);
                failedCount++;
            } finally {
                Snippets.SaveAndVerifyAssemblies();
            }
        }
예제 #3
0
파일: Driver.cs 프로젝트: jcteague/ironruby
        private void RunManualTest() {
            Console.WriteLine("Running hardcoded test case");
            
            if (Manual.ParseOnly) {
                _testRuntime = new TestRuntime(this, new TestCase { Name = "<manual>" });
                Tests.GetRubyTokens(_testRuntime.Context, new LoggingErrorSink(false), Manual.TestCode, !Manual.DumpReductions, Manual.DumpReductions);                
            } else {
                try {

                    for (int i = 0; i < Manual.RequiredFiles.Length; i += 2) {
                        File.CreateText(Manual.RequiredFiles[i]).WriteLine(Manual.RequiredFiles[i + 1]);
                    }

                    _tests = new Tests(this);
                    RunTestCase(new TestCase() {
                        Name = "$manual$",
                        TestMethod = () => _tests.CompilerTest(Manual.TestCode),
                    });

                } finally {
                    for (int i = 0; i < Manual.RequiredFiles.Length; i += 2) {
                        try {
                            File.Delete(Manual.RequiredFiles[i]);
                        } catch {
                            // nop
                        }
                    }
                }
            }
        }
예제 #4
0
파일: Driver.cs 프로젝트: TerabyteX/main
        private void RunTestCase(TestCase/*!*/ testCase)
        {
            _testRuntime = new TestRuntime(this, testCase);

            if (_verbose) {
                Output.WriteLine("Executing {0}", testCase.Name);
            } else {
                Output.Write('.');
            }

            try {
                testCase.TestMethod();
            } catch (Exception e) {
                PrintTestCaseFailed();
                _unexpectedExceptions.Add(new MutableTuple<string, Exception>(testCase.Name, e));
            } finally {
            #if !WIN8
                Snippets.SaveAndVerifyAssemblies();
            #endif
            }
        }