예제 #1
0
		public TestResult Run (EventListener listener, string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly)
		{
			InitSupportAssemblies (supportAssemblies);

			ITestFilter filter = TestFilter.Empty;
			if (nameFilter != null && nameFilter.Length > 0)
				filter = new TestNameFilter (nameFilter);

			TestRunner tr;
			if (!string.IsNullOrEmpty (testRunnerType)) {
				Type runnerType;
				if (string.IsNullOrEmpty (testRunnerAssembly))
					runnerType = Type.GetType (testRunnerType, true);
				else {
					var asm = Assembly.LoadFrom (testRunnerAssembly);
					runnerType = asm.GetType (testRunnerType);
				}
				tr = (TestRunner)Activator.CreateInstance (runnerType);
			} else
				tr = new RemoteTestRunner ();

			TestPackage package = new TestPackage (path);
			if (!string.IsNullOrEmpty (suiteName))
				package.TestName = suiteName;
			tr.Load (package);
			return tr.Run (listener, filter, false, LoggingThreshold.All);
		}
예제 #2
0
        public TestResult Run(EventListener listener, string[] nameFilter, string path, string suiteName, string[] supportAssemblies, string testRunnerType, string testRunnerAssembly)
        {
            InitSupportAssemblies(supportAssemblies);

            ITestFilter filter = TestFilter.Empty;

            if (nameFilter != null && nameFilter.Length > 0)
            {
                filter = new TestNameFilter(nameFilter);
            }

            TestRunner tr;

            if (!string.IsNullOrEmpty(testRunnerType))
            {
                Type runnerType;
                if (string.IsNullOrEmpty(testRunnerAssembly))
                {
                    runnerType = Type.GetType(testRunnerType, true);
                }
                else
                {
                    var asm = Assembly.LoadFrom(testRunnerAssembly);
                    runnerType = asm.GetType(testRunnerType);
                }
                tr = (TestRunner)Activator.CreateInstance(runnerType);
            }
            else
            {
                tr = new RemoteTestRunner();
            }

            TestPackage package = new TestPackage(path);

            if (!string.IsNullOrEmpty(suiteName))
            {
                package.TestName = suiteName;
            }
            tr.Load(package);
            return(tr.Run(listener, filter, false, LoggingThreshold.All));
        }