IronRuby.Tests.Driver.RunManualTest C# (CSharp) Метод

RunManualTest() приватный Метод

private RunManualTest ( ) : void
Результат void
        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
                        }
                    }
                }
            }
        }

Usage Example

Пример #1
0
        public static int Run(List <string> /*!*/ args)
        {
            if (Thread.CurrentThread.CurrentCulture.ToString() != "en-US")
            {
                Console.WriteLine("Current culture: {0}", Thread.CurrentThread.CurrentCulture);
            }

            if (!ParseArguments(args))
            {
                return(-3);
            }

            int status = 0;

            if (_runTokenizerDriver)
            {
                TokenizerTestDriver driver = new TokenizerTestDriver((RubyContext)HostingHelpers.GetLanguageContext(Ruby.CreateEngine()));
                if (!driver.ParseArgs(args))
                {
                    return(-3);
                }

                status = driver.RunTests();
            }
            else
            {
                InitializeDomain();
                Driver driver = new Driver();

                if (Manual.TestCode.Trim().Length == 0)
                {
                    status = driver.RunUnitTests(args);
                }
                else
                {
                    driver.RunManualTest();

                    // for case the test is forgotten, this would fail the test suite:
                    status = -2;
                }
            }

            // return failure on bad filter (any real failures throw)
            return(status);
        }
All Usage Examples Of IronRuby.Tests.Driver::RunManualTest