Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public class Tests
"Newtonsoft.Json"
};

// Verify stores SolutionDirectory as a relative path ("../"), which AttributeReader returns
// verbatim; resolving it against the absolute project directory keeps paths correct regardless
// of the test runner's working directory.
static string SolutionDirectory => Path.GetFullPath(
Path.Combine(AttributeReader.GetProjectDirectory(), AttributeReader.GetSolutionDirectory()));

static Tests()
{
tempPath = Path.Combine(binDirectory, "Temp");
Expand Down Expand Up @@ -106,7 +112,7 @@ public Task Combo(bool copyPdbs, bool sign, bool internalize)
[Fact]
public async Task RunTask()
{
var solutionDir = AttributeReader.GetSolutionDirectory();
var solutionDir = SolutionDirectory;

var buildResult = await Cli.Wrap("dotnet")
.WithArguments("build --configuration IncludeAliasTask --no-restore")
Expand Down Expand Up @@ -170,7 +176,7 @@ await Verify(
[Fact]
public async Task RunSample()
{
var solutionDirectory = AttributeReader.GetSolutionDirectory();
var solutionDirectory = SolutionDirectory;

var targetPath = Path.Combine(solutionDirectory, "SampleApp/bin/Debug/net10.0");

Expand Down Expand Up @@ -202,7 +208,8 @@ public async Task RunSample()

PatchDependencies(tempPath);

var exePath = Path.Combine(tempPath, "SampleApp.exe");
var exeName = OperatingSystem.IsWindows() ? "SampleApp.exe" : "SampleApp";
var exePath = Path.Combine(tempPath, exeName);

var result = await Cli.Wrap(exePath).ExecuteBufferedAsync();

Expand Down
Loading