/// <summary/> public GraphicsTestLoader(TokenList tokens) { this.tokens = tokens; }
/// <summary> /// Set the TestAssembly, launch tests in the test assembly based on args, and /// revert the TestAssembly value to original value. /// </summary> /// <param name="args"></param> /// <param name="testAssembly"></param> public static void Launch(string[] args, Assembly testAssembly) { //Set TestAssembly. Assembly originalTestAssembly = TestAssembly; TestAssembly = testAssembly; TokenList tokens = new TokenList(args); foreach (Object o in tokens) { LogHeader(o.ToString()); } string runAll = tokens.GetValue("RunAll"); string runAllScripts = tokens.GetValue("RunAllScripts"); string dontCatch = tokens.GetValue("DontCatch"); string logTime = tokens.GetValue("LogTime"); string script = tokens.GetValue("script"); string className = tokens.GetValue("Class"); if (tokens.ContainsKey("?") || tokens.ContainsKey("help") || tokens.ContainsKey("Help")) { PrintHelp(); return; } //Catch Exceptions on dispatcher, and rethrow on main thread if (dontCatch == null) { RenderingTest.catchExceptionsOnDispatcherThread = true; } else { RenderingTest.catchExceptionsOnDispatcherThread = !StringConverter.ToBool(dontCatch); } if (logTime != null) { LogTime = StringConverter.ToBool(logTime); } GraphicsTestLoader tester = null; if (runAll != null && StringConverter.ToBool(runAll)) { tester = new RunAllLoader(tokens); } else if (runAllScripts != null && StringConverter.ToBool(runAllScripts)) { tester = new RunAllLoader(tokens, false); } else if (script == null && className == null) { PrintHelp(); return; } else { tester = new RunScriptLoader(tokens, script); } //Intercept and log any uncaught exceptions try { tester.RunMyTests(); } catch (Exception e) { TestLog.Current.Result = TestResult.Fail; TestLog.Current.LogStatus("Test Failure - Unhandled Exception Caught"); TestLog.Current.LogEvidence(e.ToString()); Logger.LogFinalResults(1, 1); } if (RenderingTest.application != null) { RenderingTest.application.Dispatcher.BeginInvoke( DispatcherPriority.Normal, new DispatcherOperationCallback(Shutdown), null ); } //revert TestAssembly. TestAssembly = originalTestAssembly; }
/// <summary/> public RunAllLoader(TokenList tokens) : this(tokens, true) { }
private Variation(TokenList tokens, bool isGlobalVariation) { localParameters = tokens; ParseParameters(isGlobalVariation); id = ++totalVariations; }
/// <summary/> public Variation(TokenList tokens) : this(tokens, false) { }
private void CreateVariationFromTokens(TokenList tokens) { Variation.SetGlobalParameters(tokens); variations = new Variation[1]; variations[0] = new Variation(tokens); }