Skip to content

Commit

Permalink
Provide target framework as an envvar to tests. (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmds committed Oct 4, 2023
1 parent 09aa2d6 commit b3e1a81
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Turkey/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public static async Task<int> Run(string testRoot,
Cleaner cleaner = new Cleaner();

DotNet dotnet = new DotNet();
Version runtimeVersion = dotnet.LatestRuntimeVersion;

TestOutput defaultOutput = new TestOutputFormats.NewOutput();

Expand All @@ -101,19 +102,21 @@ public static async Task<int> Run(string testRoot,
var sanitizer = new EnvironmentVariableSanitizer();
var envVars = sanitizer.SanitizeCurrentEnvironmentVariables();

var traits = CreateTraits(dotnet.LatestRuntimeVersion, dotnet.LatestSdkVersion, platformIds, dotnet.IsMonoRuntime(dotnet.LatestRuntimeVersion), trait);
var traits = CreateTraits(runtimeVersion, dotnet.LatestSdkVersion, platformIds, dotnet.IsMonoRuntime(runtimeVersion), trait);
Console.WriteLine($"Tests matching these traits will be skipped: {string.Join(", ", traits.OrderBy(s => s))}.");

envVars["TestTargetFramework"] = $"net{runtimeVersion.Major}.{runtimeVersion.Minor}";

SystemUnderTest system = new SystemUnderTest(
dotnet,
runtimeVersion: dotnet.LatestRuntimeVersion,
runtimeVersion: runtimeVersion,
sdkVersion: dotnet.LatestSdkVersion,
platformIds: platformIds,
environmentVariables: envVars,
traits: traits
);

Version packageVersion = dotnet.LatestRuntimeVersion;
Version packageVersion = runtimeVersion;
string nuGetConfig = await GenerateNuGetConfigIfNeededAsync(additionalFeed, packageVersion,
useSourceBuildNuGetConfig: false);
if (verbose && nuGetConfig != null)
Expand Down

0 comments on commit b3e1a81

Please sign in to comment.