Example #1
0
        static void Main(string[] args)
        {
            // paths *to* the XML files, as well as paths *in* the XML files,
            // assume that we're running from the app's directory; apparently,
            // the VS2017 / new-style SDK changes did something to make that
            // no longer guaranteed to be the case at startup.
            Environment.CurrentDirectory = new FileInfo(Assembly.GetEntryAssembly().Location).Directory.FullName;
            if (args == null || args.Length == 0)
            {
                XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                RunInteractive(XmlTestType.None, true);
            }
            else
            {
                var parser     = new TestOptionsParser();
                var collection = parser.Parse(args);

                if (parser.IsDefault)
                {
                    RunDefault();
                }
                else
                {
                    if (collection != null)
                    {
                        if (collection.Count == 1)
                        {
                            // see if it is the interactive type
                            var info = collection[0];
                            if (info.Interactive)
                            {
                                if (info.Exception)
                                {
                                    XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                                }
                                RunInteractive(info.Filter, info.Verbose);
                            }
                        }
                        else
                        {
                            var runner = new TestRunner(collection);
                            runner.Run();
                        }
                    }
                    else
                    {
                        XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                        RunInteractive(XmlTestType.None, true);
                    }
                }
            }
        }
Example #2
0
        static void RunOther()
        {
            var parserOptions = new TestOptionsParser();
            var listTests     =
                parserOptions.ParseProject(@"..\..\..\NetTopologySuite.TestRunner.Tests\Other.xml");

            if (listTests != null && listTests.Count > 0)
            {
                var runner = new TestRunner(listTests);
                runner.Run();
                runner.PrintResult();
            }
        }
        static void RunDefault()
        {
            TestOptionsParser  parserOptions = new TestOptionsParser();
            TestInfoCollection listTests     =
                parserOptions.ParseProject(@"..\..\..\NetTopologySuite.TestRunner.Tests\Default.xml");

            if (listTests != null && listTests.Count > 0)
            {
                TestRunner runner = new TestRunner(listTests);
                runner.Run();
                runner.PrintResult();
            }
        }
        static void Run(string fileName)
        {
            var parserOptions = new TestOptionsParser();
            var listTests     =
                parserOptions.ParseProject(Path.Combine(TestRunnerDirectory, fileName));

            if (listTests != null && listTests.Count > 0)
            {
                var runner = new TestRunner(listTests);
                runner.Run();
                runner.PrintResult();
            }
        }
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                RunInteractive(XmlTestType.None, true);
            }
            else
            {
                TestOptionsParser  parser     = new TestOptionsParser();
                TestInfoCollection collection = parser.Parse(args);

                if (parser.IsDefault)
                {
                    RunDefault();
                }
                else
                {
                    if (collection != null)
                    {
                        if (collection.Count == 1)
                        {
                            // see if it is the interactive type
                            TestInfo info = collection[0];
                            if (info.Interactive)
                            {
                                if (info.Exception)
                                {
                                    XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                                }
                                RunInteractive(info.Filter, info.Verbose);
                            }
                        }
                        else
                        {
                            TestRunner runner = new TestRunner(collection);
                            runner.Run();
                        }
                    }
                    else
                    {
                        XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                        RunInteractive(XmlTestType.None, true);
                    }
                }
            }
        }
Example #6
0
 static void RunDefault()
 {
     TestOptionsParser parserOptions = new TestOptionsParser();
     TestInfoCollection listTests =
         parserOptions.ParseProject(@"..\..\..\NetTopologySuite.TestRunner.Tests\Default.xml");
     
     if (listTests != null && listTests.Count > 0)
     {
         TestRunner runner = new TestRunner(listTests);
         runner.Run();
         runner.PrintResult();
     }   
 }
Example #7
0
        static void Main(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                RunInteractive(XmlTestType.None, true);
            }
            else
            {
                TestOptionsParser parser = new TestOptionsParser();
                TestInfoCollection collection = parser.Parse(args);

                if (parser.IsDefault)
                {
                    RunDefault();
                }
                else
                {
                    if (collection != null)
                    {
                        if (collection.Count == 1)
                        {
                            // see if it is the interactive type
                            TestInfo info = collection[0];
                            if (info.Interactive)
                            {
                                if (info.Exception)
                                    XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                                RunInteractive(info.Filter, info.Verbose);
                            }
                        }
                        else
                        {
                            TestRunner runner = new TestRunner(collection);
                            runner.Run();
                        }
                    }
                    else
                    {
                        XmlTestExceptionManager.ErrorEvent += new XmlTestErrorEventHandler(OnErrorEvent);
                        RunInteractive(XmlTestType.None, true);
                    }
                }
            }

        }