-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from nowsprinting/feature/buildscene_attribute
Add BuildScene attribute and LoadSceneAsync method
- Loading branch information
Showing
22 changed files
with
1,789 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2023-2024 Koji Hasegawa. | ||
// This software is released under the MIT License. | ||
|
||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using System.Runtime.CompilerServices; | ||
using NUnit.Framework; | ||
|
||
namespace TestHelper.Attributes | ||
{ | ||
/// <summary> | ||
/// Build scene before running test on player. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
public class BuildSceneAttribute : NUnitAttribute | ||
{ | ||
internal string ScenePath { get; private set; } | ||
internal string CallerFilePath { get; private set; } | ||
|
||
/// <summary> | ||
/// Build scene before running test on player. | ||
/// This attribute has the following benefits: | ||
/// - Can be specified scenes that are **NOT** in "Scenes in Build". | ||
/// - Can be specified scene path by [glob](https://en.wikipedia.org/wiki/Glob_(programming)) pattern. However, there are restrictions, top level and scene name cannot be omitted. | ||
/// - Can be specified scene path by relative path from the test class file. | ||
/// </summary> | ||
/// <param name="path">Scene file path. | ||
/// The path starts with `Assets/` or `Packages/` or `.`. | ||
/// And package name using `name` instead of `displayName`, when scenes in the package. | ||
/// (e.g., `Packages/com.nowsprinting.test-helper/Tests/Scenes/Scene.unity`) | ||
/// </param> | ||
/// <remarks> | ||
/// - For the process of including a Scene not in "Scenes in Build" to a build for player, see: <see cref="TestHelper.Editor.TemporaryBuildScenesUsingInTest"/>. | ||
/// </remarks> | ||
[SuppressMessage("ReSharper", "InvalidXmlDocComment")] | ||
public BuildSceneAttribute(string path, [CallerFilePath] string callerFilePath = null) | ||
{ | ||
ScenePath = path; | ||
CallerFilePath = callerFilePath; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.