private static string GetLegacyAmdPath(string testHarnessDirectory, string filePath, string relativeAmdRootPath) { string amdModulePath = UrlBuilder.GetRelativePath(testHarnessDirectory, filePath); amdModulePath = NormalizeAmdModulePath(Path.Combine(relativeAmdRootPath, amdModulePath)); return(amdModulePath); }
private static string GetAmdPath(string filePath, string amdAppRoot) { string amdModulePath = UrlBuilder.GetRelativePath(amdAppRoot, filePath); amdModulePath = NormalizeAmdModulePath(amdModulePath); return(amdModulePath); }
private static string GetLegacyAmdPath(string testHarnessDirectory, string filePath, string relativeAmdRootPath) { string amdModulePath = UrlBuilder.GetRelativePath(testHarnessDirectory, filePath); amdModulePath = Path.Combine(relativeAmdRootPath, amdModulePath) .Replace(Path.GetExtension(filePath), "") .Replace("\\", "/") .Trim('/', '\\'); return(amdModulePath); }
private static string GetAmdPath(string filePath, string amdAppRoot) { string amdModulePath = UrlBuilder.GetRelativePath(amdAppRoot, filePath); amdModulePath = amdModulePath .Replace(Path.GetExtension(filePath), "") .Replace("\\", "/") .Trim('/', '\\'); return(amdModulePath); }
/// <summary> /// Add the AMD file paths for the Path and GeneratePath fields /// </summary> /// <param name="referencedFiles"></param> /// <param name="testHarnessDirectory"></param> /// <param name="testSettings"></param> private void SetupLegacyAmdFilePaths(List <ReferencedFile> referencedFiles, string testHarnessDirectory, ChutzpahTestSettingsFile testSettings) { // If the user set a AMD base path then we must relativize the amd path's using the path from the base path to the test harness directory string relativeAmdRootPath = ""; if (!string.IsNullOrEmpty(testSettings.AMDBasePath)) { relativeAmdRootPath = UrlBuilder.GetRelativePath(testSettings.AMDBasePath, testHarnessDirectory); } foreach (var referencedFile in referencedFiles) { referencedFile.AmdFilePath = GetLegacyAmdPath(testHarnessDirectory, referencedFile.Path, relativeAmdRootPath); if (!string.IsNullOrEmpty(referencedFile.GeneratedFilePath)) { referencedFile.AmdGeneratedFilePath = GetLegacyAmdPath(testHarnessDirectory, referencedFile.GeneratedFilePath, relativeAmdRootPath); } } }
private IEnumerable <ReferencedFile> GetFilesUnderTest(IEnumerable <PathWithTestSetting> testFiles, ChutzpahTestSettingsFile chutzpahTestSettings) { return(testFiles.Select(f => new ReferencedFile { Path = f.File.FullPath, IsLocal = true, IsFileUnderTest = true, // Expand reference comments if we either do not have a matching test path setting or the user explicitly asked to do it ExpandReferenceComments = f.MatchingTestSetting == null || f.MatchingTestSetting.ExpandReferenceComments, IncludeInTestHarness = chutzpahTestSettings.TestHarnessReferenceMode == TestHarnessReferenceMode.Normal, PathFromTestSettingsDirectory = string.IsNullOrEmpty(chutzpahTestSettings.SettingsFileDirectory) ? null : UrlBuilder.GetRelativePath(chutzpahTestSettings.SettingsFileDirectory, f.File.FullPath) })); }