mirror of
https://github.com/godotengine/godot.git
synced 2024-12-21 10:25:24 +08:00
b352bdc8cb
- Bootstrap xUnit project to test source generators - Implement source generator tests - Better tests structure (put test data in cs files) - Enable `ScriptSerializationGeneratorTests` - Enable `ScriptPathAttributeGeneratorTests` - Fix `NesterClass` -> `NestedClass` - Use `Path.Combine` when dealing with paths - Copy test data to the output directory
24 lines
746 B
C#
24 lines
746 B
C#
using System.IO;
|
|
using System.Reflection;
|
|
|
|
namespace Godot.SourceGenerators.Tests;
|
|
|
|
public static class Constants
|
|
{
|
|
public static Assembly GodotSharpAssembly => typeof(GodotObject).Assembly;
|
|
|
|
public static string ExecutingAssemblyPath { get; }
|
|
public static string SourceFolderPath { get; }
|
|
public static string GeneratedSourceFolderPath { get; }
|
|
|
|
static Constants()
|
|
{
|
|
ExecutingAssemblyPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location!)!);
|
|
|
|
var testDataPath = Path.Combine(ExecutingAssemblyPath, "TestData");
|
|
|
|
SourceFolderPath = Path.Combine(testDataPath, "Sources");
|
|
GeneratedSourceFolderPath = Path.Combine(testDataPath, "GeneratedSources");
|
|
}
|
|
}
|