Пример #1
0
        public void GetSymbolsPath_IsExportingFalse_ReturnsUnityDefaultPath()
        {
            var expectedSymbolsPath = Path.Combine(_fixture.UnityProjectPath, "Temp", "StagingArea", "symbols");

            var actualSymbolsPath = DebugSymbolUpload.GetSymbolsPath(_fixture.UnityProjectPath, _fixture.GradleProjectPath, false);

            Assert.AreEqual(expectedSymbolsPath, actualSymbolsPath);
        }
Пример #2
0
        public void AppendUploadToGradleFile_BuildGradleFileDoesNotExist_ThrowsFileNotFoundException()
        {
            var symbolsDirectoryPath = DebugSymbolUpload.GetSymbolsPath(_fixture.UnityProjectPath, _fixture.GradleProjectPath, false);
            var invalidGradlePath    = Path.GetRandomFileName();

            var ex = Assert.Throws <FileNotFoundException>(() => DebugSymbolUpload.AppendUploadToGradleFile(_fixture.SentryCliPath, invalidGradlePath, symbolsDirectoryPath));

            Assert.AreEqual(invalidGradlePath, ex.FileName);
        }
Пример #3
0
        public void GetSymbolsPath_IsExportingTrue_CopiesSymbolsAndReturnsPath()
        {
            var expectedSymbolsPath = Path.Combine(_fixture.GradleProjectPath, DebugSymbolUpload.GradleExportedSymbolsPath);

            var actualSymbolsPath = DebugSymbolUpload.GetSymbolsPath(_fixture.UnityProjectPath, _fixture.GradleProjectPath, true);

            Assert.AreEqual(expectedSymbolsPath, actualSymbolsPath);
            Assert.IsTrue(Directory.Exists(expectedSymbolsPath));

            var files = Directory.GetFiles(expectedSymbolsPath, "*.so", SearchOption.AllDirectories).ToList();

            Assert.IsNotNull(files.Find(f => f.EndsWith("libil2cpp.dbg.so")));
            Assert.IsNotNull(files.Find(f => f.EndsWith("libil2cpp.sym.so")));
            Assert.IsNotNull(files.Find(f => f.EndsWith("libunity.sym.so")));
        }
Пример #4
0
        public void AppendUploadToGradleFile_AllRequirementsMet_AppendsSentryCliToFile(bool export)
        {
            var symbolsDirectoryPath         = DebugSymbolUpload.GetSymbolsPath(_fixture.UnityProjectPath, _fixture.GradleProjectPath, export);
            var expectedSentryCliPath        = _fixture.SentryCliPath;
            var expectedSymbolsDirectoryPath = symbolsDirectoryPath;

            if (Application.platform == RuntimePlatform.WindowsEditor)
            {
                expectedSentryCliPath        = expectedSentryCliPath.Replace(@"\", "/");
                expectedSymbolsDirectoryPath = symbolsDirectoryPath.Replace(@"\", "/");
            }

            DebugSymbolUpload.AppendUploadToGradleFile(_fixture.SentryCliPath, _fixture.GradleProjectPath, symbolsDirectoryPath);
            var actualFileContent = File.ReadAllText(Path.Combine(_fixture.GradleProjectPath, "build.gradle"));

            StringAssert.Contains(expectedSentryCliPath, actualFileContent);
            StringAssert.Contains(expectedSymbolsDirectoryPath, actualFileContent);
        }
Пример #5
0
 public void AppendUploadToGradleFile_SymbolsDirectoryDoesNotExist_ThrowsDirectoryNotFoundException()
 {
     Assert.Throws <DirectoryNotFoundException>(() => DebugSymbolUpload.AppendUploadToGradleFile(_fixture.SentryCliPath, _fixture.GradleProjectPath, String.Empty));
 }