RunUnitTests() private method

private RunUnitTests ( List largs ) : int
largs List
return int
Esempio n. 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);
        }
Esempio n. 2
0
        public static int Run(List <string> /*!*/ args)
        {
            if (!ParseArguments(args))
            {
                return(-3);
            }

            int status = 0;

            if (_runTokenizerDriver)
            {
                TokenizerTestDriver driver = new TokenizerTestDriver(Ruby.GetExecutionContext(Ruby.CreateRuntime()));
                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);
        }
Esempio n. 3
0
        public static int Run(List <string> /*!*/ args, string baseDirectory)
        {
#if !WIN8
            if (Thread.CurrentThread.CurrentCulture.ToString() != "en-US")
            {
                WriteOutput("Current culture: {0}", Thread.CurrentThread.CurrentCulture);
            }
#endif
            if (!ParseArguments(args))
            {
                return(-3);
            }

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

                return(tokenizerDriver.RunTests());
            }
#endif
            InitializeDomain();
            Driver driver = new Driver(baseDirectory);

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

#if !WIN8
            driver.RunManualTest();
#endif
            // for case the test is forgotten, this would fail the test suite:
            return(-2);
        }
Esempio n. 4
0
        public static int Run(List<string>/*!*/ args) {
            if (!ParseArguments(args)) {
                return -3;
            }

            int status = 0;

            if (_runTokenizerDriver) {
                TokenizerTestDriver driver = new TokenizerTestDriver(Ruby.GetExecutionContext(Ruby.CreateRuntime()));
                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;
        }
Esempio n. 5
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;
        }
Esempio n. 6
0
        public static int Run(List<string>/*!*/ args, string baseDirectory)
        {
            #if !WIN8
            if (Thread.CurrentThread.CurrentCulture.ToString() != "en-US") {
                WriteOutput("Current culture: {0}", Thread.CurrentThread.CurrentCulture);
            }
            #endif
            if (!ParseArguments(args)) {
                return -3;
            }

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

                return tokenizerDriver.RunTests();
            }
            #endif
            InitializeDomain();
            Driver driver = new Driver(baseDirectory);

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

            #if !WIN8
            driver.RunManualTest();
            #endif
            // for case the test is forgotten, this would fail the test suite:
            return -2;
        }