Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion test/dotnet.Tests/CommandTests/Run/RunFileTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private static string PrepareOutOfTreeBaseDirectory()
/// is created under this directory, and NuGet walks up from the project location to
/// find config files.
/// </summary>
protected static void CopyNuGetConfigToRunfileDirectory()
internal static void CopyNuGetConfigToRunfileDirectory()
{
var sourceNuGetConfig = Path.Join(SdkTestContext.Current.TestExecutionDirectory, "NuGet.config");
var runfileDir = VirtualProjectBuilder.GetTempSubdirectory();
Expand Down
25 changes: 24 additions & 1 deletion test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,33 @@
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.FileBasedPrograms;
using Microsoft.DotNet.ProjectTools;
using Xunit.Sdk;

namespace Microsoft.DotNet.Cli.Run.Tests;

public sealed class RunFileTests_CscOnlyAndApi(ITestOutputHelper log) : RunFileTestBase(log)
public sealed class RunFileCscOnlyFixture(IMessageSink sink) : IAsyncLifetime
{
public ValueTask InitializeAsync()
{
RunFileTestBase.CopyNuGetConfigToRunfileDirectory();

// Ensure a simple app runs fully with MSBuild before running other csc-only tests
// so we have packages like ILLink.Tasks restored and csc-only optimization can kick in.
new DotnetCommand(new SharedTestOutputHelper(sink), "run", "-")
.WithStandardInput("""
Console.WriteLine("Hello");
""")
.Execute()
.Should().Pass()
.And.HaveStdOut("Hello");

return default;
}

public ValueTask DisposeAsync() => default;
}

public sealed class RunFileTests_CscOnlyAndApi(ITestOutputHelper log) : RunFileTestBase(log), IClassFixture<RunFileCscOnlyFixture>
Comment thread
jjonescz marked this conversation as resolved.
Outdated
{
[Fact]
public void UpToDate()
Expand Down
Loading