public virtual void RunMozillaTest() { //System.out.println("Test \"" + jsFile + "\" running under optimization level " + optimizationLevel); ShellContextFactory shellContextFactory = new ShellContextFactory(); shellContextFactory.SetOptimizationLevel(optimizationLevel); MozillaSuiteTest.ShellTestParameters @params = new MozillaSuiteTest.ShellTestParameters(); MozillaSuiteTest.JunitStatus status = new MozillaSuiteTest.JunitStatus(); ShellTest.Run(shellContextFactory, jsFile, @params, status); }
/// <exception cref="System.Exception"></exception> internal virtual void Run(JsDriver.Arguments arguments) { if (arguments.Help()) { System.Console.Out.WriteLine("See mozilla/js/tests/README-jsDriver.html; note that some options are not supported."); System.Console.Out.WriteLine("Consult the Java source code at testsrc/org/mozilla/javascript/JsDriver.java for details."); System.Environment.Exit(0); } ShellContextFactory factory = new ShellContextFactory(); factory.SetOptimizationLevel(arguments.GetOptimizationLevel()); factory.SetStrictMode(arguments.IsStrict()); FilePath path = arguments.GetTestsPath(); if (path == null) { path = new FilePath("../tests"); } if (!path.Exists()) { throw new Exception("JavaScript tests not found at " + path.GetCanonicalPath()); } JsDriver.Tests tests = new JsDriver.Tests(path, arguments.GetTestList(), arguments.GetSkipList()); JsDriver.Tests.Script[] all = tests.GetFiles(); arguments.GetConsole().Println("Running " + all.Length + " tests."); JsDriver.Results results = new JsDriver.Results(factory, arguments, arguments.Trace()); results.Start(); for (int i = 0; i < all.Length; i++) { results.Run(all[i], new JsDriver.ShellTestParameters(arguments.GetTimeout())); } results.Finish(); }
/// <exception cref="System.Exception"></exception> public override void RunBare() { ShellContextFactory shellContextFactory = new ShellContextFactory(); shellContextFactory.SetOptimizationLevel(optimizationLevel); StandardTests.JsTestCase.ShellTestParameters @params = new StandardTests.JsTestCase.ShellTestParameters(); ShellTest.Run(shellContextFactory, jsFile, @params, new StandardTests.JunitStatus()); }