From 42c9211ca1ec3f6bd92cdb3d0f33378affef8877 Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Tue, 19 Nov 2024 12:30:58 +0200 Subject: [PATCH] Use artifacts output (#18) * Use artifacts output * Minor corrections --------- Co-authored-by: Adam Simon --- Directory.Build.props | 1 + build/_build.csproj | 1 + .../Acornima.Tests.SourceGenerators/SourceGeneratorTest.cs | 2 +- test/Acornima.Tests/ParserTests.Fixtures.cs | 7 +++---- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 2d83b6f..56d7414 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,6 +4,7 @@ 12 enable true + true diff --git a/build/_build.csproj b/build/_build.csproj index c582246..8e0aaab 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -12,6 +12,7 @@ true false false + false diff --git a/test/Acornima.Tests.SourceGenerators/SourceGeneratorTest.cs b/test/Acornima.Tests.SourceGenerators/SourceGeneratorTest.cs index bfbe5bc..1439164 100644 --- a/test/Acornima.Tests.SourceGenerators/SourceGeneratorTest.cs +++ b/test/Acornima.Tests.SourceGenerators/SourceGeneratorTest.cs @@ -9,6 +9,6 @@ public class SourceGeneratorTest protected static string ToSourcePath(string path, string project = MainProject) { - return Path.Combine($"../../../../../src/{project}/", path); + return Path.Combine($"../../../../src/{project}/", path); } } diff --git a/test/Acornima.Tests/ParserTests.Fixtures.cs b/test/Acornima.Tests/ParserTests.Fixtures.cs index 09c80f0..c018a1d 100644 --- a/test/Acornima.Tests/ParserTests.Fixtures.cs +++ b/test/Acornima.Tests/ParserTests.Fixtures.cs @@ -30,13 +30,12 @@ internal static string GetFixturesPath() { #if NETFRAMEWORK var assemblyPath = new Uri(typeof(RegExpTests).GetTypeInfo().Assembly.CodeBase).LocalPath; - var assemblyDirectory = new FileInfo(assemblyPath).Directory; #else var assemblyPath = typeof(RegExpTests).GetTypeInfo().Assembly.Location; - var assemblyDirectory = new FileInfo(assemblyPath).Directory; #endif - var root = assemblyDirectory?.Parent?.Parent?.Parent?.FullName; - return root ?? ""; + var assemblyDirectory = new FileInfo(assemblyPath).Directory; + var root = Path.Combine(assemblyDirectory?.Parent?.Parent?.Parent?.Parent?.FullName ?? "", "test", "Acornima.Tests"); + return root; } public static IEnumerable Fixtures(string relativePath)