private GroupInfo GetTestGroup(string testGroupName, string rootDir, out int instance) { if (testGroupName == null) { instance = 0; return new GroupInfo(null, rootDir); } GroupInfo result; if (groupInfo.TryGetValue(testGroupName, out result)) { result.Increment(out instance); return result; } instance = 0; result = new GroupInfo(testGroupName, rootDir); groupInfo.Add(testGroupName, result); return result; }
private Options GrabTestOptions(string testGroupName) { var dataRow = TestContext.DataRow; var sourceFile = Options.LoadString(dataRow, "Name"); var clousotOptions = Options.LoadString(dataRow, "Options"); var useContractReferenceAssemblies = Options.LoadBool(dataRow, "ContractReferenceAssemblies", false); var useExe = Options.LoadBool(dataRow, "Exe", false); var compilerOptions = Options.LoadString(dataRow, "CompilerOptions"); var references = Options.LoadList(dataRow, "References"); var libPaths = Options.LoadList(dataRow, "LibPaths"); var compilerCode = Options.LoadString(dataRow, "Compiler", "CS"); var skipForCCI2 = Options.LoadBool(dataRow, "SkipCCI2", false); var skipSlicing = Options.LoadBool(dataRow, "SkipSlicing", false); var options = new Options( sourceFile: sourceFile, clousotOptions: clousotOptions, useContractReferenceAssemblies: useContractReferenceAssemblies, useExe: useExe, compilerOptions: compilerOptions, references: references.ToArray(), libPaths: libPaths.ToArray(), compilerCode: compilerCode, skipForCCI2: skipForCCI2, skipSlicing: skipSlicing, skipForNet35: false); options.TestGroupName = testGroupName; CurrentGroupInfo = options.Group; return options; }
public Options(string testGroupName, TestContext context) { var dataRow = context.DataRow; OutDirectory = context.TestDeploymentDir; this.TestGroupName = testGroupName; this.Group = GetTestGroup(testGroupName, RootDirectory, out instance); this.SourceFile = LoadString(dataRow, "Name"); this.ClousotOptions = LoadString(dataRow, "Options"); this.UseContractReferenceAssemblies = LoadBool(dataRow, "ContractReferenceAssemblies", false); this.UseExe = LoadBool(dataRow, "Exe", false); compilerOptions = LoadString(dataRow, "CompilerOptions"); this.References = LoadList(dataRow, "References", "mscorlib.dll", "System.dll", "ClousotTestHarness.dll"); this.LibPaths = LoadList(dataRow, "LibPaths", MakeAbsolute(TestHarnessDirectory)); compilerCode = LoadString(dataRow, "Compiler", "CS"); this.SkipForCCI2 = LoadBool(dataRow, "SkipCCI2", false); this.SkipSlicing = LoadBool(dataRow, "SkipSlicing", false); }