/// <summary> /// The run test. /// </summary> /// <param name="testName">The test name.</param> /// <param name="simulationFrameworkVersion">The framework version to simulate for test.</param> private void RunTest(string testName, double simulationFrameworkVersion = 0) { string[] files = new string[2]; files[0] = Path.Combine(testContext.DeploymentDirectory, "StyleCop.CSharp.dll"); files[1] = Path.Combine(testContext.DeploymentDirectory, "StyleCop.CSharp.Rules.dll"); bool result = StyleCopTestRunner.Run(testName, testContext.TestDir, testContext.ResultsDirectory, testContext.DeploymentDirectory, false, simulationFrameworkVersion, files); Assert.IsTrue(result); }
/// <summary> /// The run test. /// </summary> /// <param name="testName"> /// The test name. /// </param> /// <param name="testfilesToCopy"> /// The test files to copy. /// </param> private void RunTest(string testName, params string[] testfilesToCopy) { string[] files = new string[testfilesToCopy.Length + 2]; files[0] = Path.Combine(TestBin, "StyleCop.CSharp.dll"); files[1] = Path.Combine(TestBin, "StyleCop.CSharp.Rules.dll"); testfilesToCopy.CopyTo(files, 2); bool result = StyleCopTestRunner.Run(testName, TestRoot, TestContext.DeploymentDirectory, TestContext.TestResultsDirectory, false, files); Assert.IsTrue(result, TestContext.TestResultsDirectory); }
/// <summary> /// The run test. /// </summary> /// <param name="testName"> /// The test name. /// </param> private void RunTest(string testName) { Assert.IsTrue( StyleCopTestRunner.Run( testName, TestRoot, TestContext.DeploymentDirectory, TestContext.TestResultsDirectory, false, Path.Combine(TestBin, "StyleCop.CSharp.Rules.dll"), Path.Combine(TestBin, "CSharpParserTestRules.dll")), TestContext.TestResultsDirectory); }
/// <summary> /// The main entrypoint for the program. /// </summary> /// <param name="args">The event arguments.</param> public static void Main(string[] args) { string testInputLocation = null; string testOutputLocation = null; string testroot = null; string testname = null; bool help = false; bool autoFix = false; foreach (string arg in args) { if (arg.StartsWith("/i:", StringComparison.OrdinalIgnoreCase)) { testInputLocation = arg.Substring(3, arg.Length - 3); } else if (arg.StartsWith("/o:", StringComparison.OrdinalIgnoreCase)) { testOutputLocation = arg.Substring(3, arg.Length - 3); } else if (arg.StartsWith("/testname:", StringComparison.OrdinalIgnoreCase)) { testname = arg.Substring(10, arg.Length - 10); } else if (arg.StartsWith("/testroot:", StringComparison.OrdinalIgnoreCase)) { testroot = arg.Substring(10, arg.Length - 10); } else if (arg.Equals("/fix", StringComparison.OrdinalIgnoreCase)) { autoFix = true; } else if (arg.Equals("/?", StringComparison.Ordinal)) { help = true; break; } } if (help || string.IsNullOrEmpty(testname) || string.IsNullOrEmpty(testroot) || string.IsNullOrEmpty(testInputLocation) || string.IsNullOrEmpty(testOutputLocation)) { Help(); } else { StyleCopTestRunner.Run(testname, testroot, testInputLocation, testOutputLocation, autoFix); } }
private void RunTest(string testName) { Assert.IsTrue(StyleCopTestRunner.Run(testName, TestRoot, TestContext.DeploymentDirectory, TestContext.TestResultsDirectory, true), TestContext.TestResultsDirectory); }