/// <summary> /// We split multi-targeted test projects into individual targeted test projects /// This will be then used in executing test projects for each of the targted projects /// e.g. if a test project is targeting 4 different target fx, we will create 4 list item /// same project 4 different target fx /// </summary> /// <param name="testsTobeRun"></param> /// <returns></returns> IEnumerable <SDKMSBTaskItem> AdjustMultiTargetTests(IEnumerable <SDKMSBTaskItem> testsTobeRun) { List <SDKMSBTaskItem> newTestList = new List <SDKMSBTaskItem>(); foreach (SDKMSBTaskItem testProj in testsTobeRun) { if (testProj.PlatformSpecificTargetFxMonikerString.Contains(";")) { string[] tfx = testProj.PlatformSpecificTargetFxMonikerString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string fxMonikerToken in tfx) { SDKMSBTaskItem ti = new SDKMSBTaskItem(testProj); ti.PlatformSpecificTargetFxMonikerString = fxMonikerToken; ti.UpdateMetadata(); newTestList.Add(ti); } } else { newTestList.Add(testProj); } } return(newTestList); }
public void GetPlatformTargetFx() { Environment.SetEnvironmentVariable("emulateNonWindowsEnv", "true"); CategorizeSDKProjectsTask cproj = new CategorizeSDKProjectsTask(rootDir); cproj.BuildScope = @"Compute"; Assert.True(cproj.Execute()); Assert.True(cproj.SDK_Projects.Count <ITaskItem>() == 1); //var sdkProj = cproj.SDK_Projects.ToList<SDKMSBTaskItem>(); SDKMSBTaskItem sdkProj = cproj.SDK_Projects[0]; if (!sdkProj.PlatformSpecificTargetFxMonikerString.Contains("net4", StringComparison.OrdinalIgnoreCase)) { Assert.True(true); } }