godot/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/Constants.cs
Paul Joannon b352bdc8cb
Add tests for source generators
- 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
2023-12-19 18:26:52 +01:00

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");
}
}