diff --git a/Editor/OpenPersistentDataPathMenu.cs b/Editor/OpenPersistentDataPathMenu.cs index 7be021b..c52f1c6 100644 --- a/Editor/OpenPersistentDataPathMenu.cs +++ b/Editor/OpenPersistentDataPathMenu.cs @@ -12,7 +12,7 @@ namespace TestHelper.Editor /// public static class OpenPersistentDataPathMenu { - [MenuItem("Window/Open Persistent Data Directory")] + [MenuItem("Window/Test Helper/Open Persistent Data Directory")] private static void OpenPersistentDataPathMenuItem() { EditorUtility.RevealInFinder(Application.persistentDataPath); diff --git a/Editor/OpenTemporaryCachePathMenu.cs b/Editor/OpenTemporaryCachePathMenu.cs new file mode 100644 index 0000000..b342091 --- /dev/null +++ b/Editor/OpenTemporaryCachePathMenu.cs @@ -0,0 +1,21 @@ +// Copyright (c) 2023-2024 Koji Hasegawa. +// This software is released under the MIT License. + +using UnityEditor; +using UnityEngine; + +namespace TestHelper.Editor +{ + /// + /// Open temporary cache directory in the Finder. + /// Application.temporaryCachePath + /// + public static class OpenTemporaryCachePathMenu + { + [MenuItem("Window/Test Helper/Open Temporary Cache Directory")] + private static void OpenTemporaryCachePathMenuItem() + { + EditorUtility.RevealInFinder(Application.temporaryCachePath); + } + } +} diff --git a/Editor/OpenTemporaryCachePathMenu.cs.meta b/Editor/OpenTemporaryCachePathMenu.cs.meta new file mode 100644 index 0000000..965f28e --- /dev/null +++ b/Editor/OpenTemporaryCachePathMenu.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: c3acfa04883346dfbc73c899b2985e12 +timeCreated: 1732470013 \ No newline at end of file diff --git a/Tests/Editor/JUnitXml/JUnitXmlWriterTest.cs b/Tests/Editor/JUnitXml/JUnitXmlWriterTest.cs index d614de4..6fd4d23 100644 --- a/Tests/Editor/JUnitXml/JUnitXmlWriterTest.cs +++ b/Tests/Editor/JUnitXml/JUnitXmlWriterTest.cs @@ -5,6 +5,7 @@ using NUnit.Framework; using TestHelper.Comparers; using TestHelper.Editor.TestDoubles; +using UnityEngine; namespace TestHelper.Editor.JUnitXml { @@ -12,20 +13,21 @@ namespace TestHelper.Editor.JUnitXml public class JUnitXmlWriterTest { private const string TestResourcesPath = "Packages/com.nowsprinting.test-helper/Tests/Editor/TestResources"; - private const string TestOutputDirectoryPath = "Logs/TestHelper/JUnitXmlWriterTest"; - // Note: relative path from the project root directory. + + private readonly string _testOutputDirectoryPath = + Path.Combine(Application.temporaryCachePath, TestContext.CurrentContext.Test.ClassName); [Test, Order(0)] public void WriteTo_CreatedJUnitXmlFormatFile() { - if (Directory.Exists(TestOutputDirectoryPath)) + if (Directory.Exists(_testOutputDirectoryPath)) { - Directory.Delete(TestOutputDirectoryPath, true); + Directory.Delete(_testOutputDirectoryPath, true); } var nunitXmlPath = Path.Combine(TestResourcesPath, "nunit3.xml"); var result = new FakeTestResultAdaptor(nunitXmlPath); - var path = Path.Combine(TestOutputDirectoryPath, TestContext.CurrentContext.Test.Name + ".xml"); + var path = Path.Combine(_testOutputDirectoryPath, TestContext.CurrentContext.Test.Name + ".xml"); JUnitXmlWriter.WriteTo(result, path); Assume.That(path, Does.Exist); @@ -40,7 +42,7 @@ public void WriteTo_ExistFile_OverwriteFile() { var nunitXmlPath = Path.Combine(TestResourcesPath, "nunit3.xml"); var result = new FakeTestResultAdaptor(nunitXmlPath); - var path = Path.Combine(TestOutputDirectoryPath, TestContext.CurrentContext.Test.Name + ".xml"); + var path = Path.Combine(_testOutputDirectoryPath, TestContext.CurrentContext.Test.Name + ".xml"); // Destroy the output destination file. File.Copy(nunitXmlPath, path, true);