Esempio n. 1
0
        private bool DidShaderChangeName(ShaderPathConverter spc)
        {
            foreach (var correspondingFilePath in spc.GetCorrespondingPaths())
            {
                var shaderCorrespondingFilePath = correspondingFilePath as ShaderCorrespondingPath;
                var filePath = Path.Combine(options.coreRootPath, shaderCorrespondingFilePath.GetCorePath());

                using (var input = File.OpenText(filePath))
                {
                    string line = input.ReadLine();
                    if (!line.Contains(shaderCorrespondingFilePath.GetCoreShaderName()) ||
                        line.Contains(shaderCorrespondingFilePath.GetPackageShaderName()))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Esempio n. 2
0
        public void Setup()
        {
            //TODO Change to the absolute path of the Tests folder
            currentDir = "/Users/hugob/Documents/Git/Packages/" + "com.unity.ui/Tools/CodeDump/Tests";

            var packageRoot  = Path.Combine(currentDir, "PackageTestDirectory");
            var coreRootPath = Path.Combine(currentDir, "CoreTestDirectory");

            options = new Options {
                silent = true, packageRootPath = packageRoot, coreRootPath = coreRootPath
            };

            BlackList.Initialize(Path.Combine(currentDir, "blacklist.json"), options);

            shaderPathConverter  = new ShaderPathConverter(Path.Combine(currentDir, "package-to-core-shader-tests.json"));
            projectPathConverter = new PathsConverter(Path.Combine(currentDir, "package-to-core-projects-tests.json"));
            pathConverterList    = new List <IPathsConverter>()
            {
                projectPathConverter, shaderPathConverter
            };
        }