Skip to content

Commit 119a6ae

Browse files
CopilotYoussef1313
andcommitted
Complete implementation of global.json --test-runner option with valid JSON output
Co-authored-by: Youssef1313 <[email protected]>
1 parent 1f8bc0e commit 119a6ae

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

template_feed/Microsoft.DotNet.Common.ItemTemplates/content/GlobalJson/global.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
"rollForward": "ROLL_FORWARD_VALUE",
55
//#endif
66
"version": "SDK_VERSION"
7-
}//#if (TestRunner!="")
8-
,
7+
}
8+
//#if (TestRunner=="")
9+
//#else
10+
,
911
"test": {
1012
"runner": "TEST_RUNNER_VALUE"
1113
}
12-
//#endif
14+
//#endif
1315
}

test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,15 @@ public CommonTemplatesTests(SharedHomeDirectory fixture, ITestOutputHelper log)
2929
[InlineData("global.json file", "globaljson", null)]
3030
[InlineData("global.json file", "globaljson", new[] { "--sdk-version", "6.0.200" })]
3131
[InlineData("global.json file", "globaljson", new[] { "--sdk-version", "6.0.200", "--roll-forward", "major" })]
32+
[InlineData("global.json file", "globaljson", new[] { "--TestRunner", "VSTest" })]
33+
[InlineData("global.json file", "globaljson", new[] { "--TestRunner", "Microsoft.Testing.Platform" })]
34+
[InlineData("global.json file", "globaljson", new[] { "--sdk-version", "6.0.200", "--TestRunner", "VSTest" })]
35+
[InlineData("global.json file", "globaljson", new[] { "--roll-forward", "major", "--TestRunner", "Microsoft.Testing.Platform" })]
3236
[InlineData("global.json file", "global.json", null)]
3337
[InlineData("global.json file", "global.json", new[] { "--sdk-version", "6.0.200" })]
3438
[InlineData("global.json file", "global.json", new[] { "--sdk-version", "6.0.200", "--roll-forward", "major" })]
39+
[InlineData("global.json file", "global.json", new[] { "--TestRunner", "VSTest" })]
40+
[InlineData("global.json file", "global.json", new[] { "--TestRunner", "Microsoft.Testing.Platform" })]
3541
[InlineData("NuGet Config", "nugetconfig", null)]
3642
[InlineData("NuGet Config", "nuget.config", null)]
3743
[InlineData("dotnet gitignore file", "gitignore", null)]

0 commit comments

Comments
 (0)