Esempio n. 1
0
        private static string GetLegacyAmdPath(string testHarnessDirectory, string filePath, string relativeAmdRootPath)
        {
            string amdModulePath = UrlBuilder.GetRelativePath(testHarnessDirectory, filePath);

            amdModulePath = NormalizeAmdModulePath(Path.Combine(relativeAmdRootPath, amdModulePath));

            return(amdModulePath);
        }
Esempio n. 2
0
        private static string GetAmdPath(string filePath, string amdAppRoot)
        {
            string amdModulePath = UrlBuilder.GetRelativePath(amdAppRoot, filePath);

            amdModulePath = NormalizeAmdModulePath(amdModulePath);

            return(amdModulePath);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        private static string GetAmdPath(string filePath, string amdAppRoot)
        {
            string amdModulePath = UrlBuilder.GetRelativePath(amdAppRoot, filePath);

            amdModulePath = amdModulePath
                            .Replace(Path.GetExtension(filePath), "")
                            .Replace("\\", "/")
                            .Trim('/', '\\');


            return(amdModulePath);
        }
Esempio n. 5
0
        /// <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);
                }
            }
        }
Esempio n. 6
0
        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)
            }));
        }