Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8f7b82c
implement dotnet test help option
mariam-abdulla May 24, 2024
19393e0
delete DebuggerUtility.cs
mariam-abdulla May 24, 2024
8d61d89
refactor
mariam-abdulla May 27, 2024
20f5b1a
refactor
mariam-abdulla May 28, 2024
9f6f951
refactor TestingPlatformCommand.Help.cs
mariam-abdulla May 28, 2024
1c93e3b
move Microsoft.NET.Testing.Tasks project into tasks folder
mariam-abdulla May 29, 2024
1b8db4b
Remove IDisposable from IClient and IServer
mariam-abdulla May 29, 2024
1c38cc1
Add comment to ObjectFieldIds
mariam-abdulla May 29, 2024
7c04a05
Revert "Add comment to ObjectFieldIds"
mariam-abdulla May 29, 2024
b5e8c18
Add comment to ObjectFieldIds
mariam-abdulla May 29, 2024
23bb5ac
remove pragma warning from VoidResponseSerializer
mariam-abdulla May 29, 2024
f6b3cd6
Expose ErrorEvent in TestApplication.cs
mariam-abdulla May 29, 2024
b1a64fd
rename env var to DOTNET_CLI_TESTINGPLATFORM_ENABLE
mariam-abdulla May 29, 2024
698c7e8
revert dotnet/Program.cs change
mariam-abdulla May 29, 2024
ab171f5
reverse logic for containsNoBuild in TestingPlatformCommand
mariam-abdulla May 29, 2024
7c14c93
remove MSBuildExeName from TestApplication.cs
mariam-abdulla May 29, 2024
6fdd73d
Update namespaces
mariam-abdulla May 29, 2024
b7070a0
move TestingPlatformCommand constructor to top
mariam-abdulla May 29, 2024
f4cb57e
refactor code
mariam-abdulla Jun 3, 2024
2cf9cb2
refactor code & add constants
mariam-abdulla Jun 3, 2024
46f7200
remove DebuggerUtility
mariam-abdulla Jun 3, 2024
ca41b0d
remove empty line
mariam-abdulla Jun 4, 2024
097d9ba
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 4, 2024
4801c6e
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 4, 2024
dfc7cb7
delete PathDotnetTest.ps1
mariam-abdulla Jun 5, 2024
89b8f76
Merge branch 'dev/mabdullah/ImplementDotnetTestHelp' of https://githu…
mariam-abdulla Jun 5, 2024
81a3e90
rename constant
mariam-abdulla Jun 5, 2024
15c652e
Move GetTestsProject to Microsoft.NET.Build.Tasks
mariam-abdulla Jun 6, 2024
4af142c
Support _GetTestsProject target with multiple target frameworks
mariam-abdulla Jun 7, 2024
1f69b2d
Display dotnet test help options differently
mariam-abdulla Jun 10, 2024
5e4347a
refactor
mariam-abdulla Jun 10, 2024
ff1880c
remove TryGetMSBuildArgs
mariam-abdulla Jun 10, 2024
6c55c56
Update src/Cli/dotnet/commands/dotnet-test/IPC/Models/CommandLineOpti…
mariam-abdulla Jun 10, 2024
208ae67
Update src/Cli/dotnet/commands/dotnet-test/IPC/NamedPipeClient.cs
mariam-abdulla Jun 10, 2024
da9ffba
Update src/Cli/dotnet/commands/dotnet-test/IPC/NamedPipeServer.cs
mariam-abdulla Jun 10, 2024
87074d7
apply comments
mariam-abdulla Jun 10, 2024
2aa8506
Merge branch 'dev/mabdullah/ImplementDotnetTestHelp' of https://githu…
mariam-abdulla Jun 10, 2024
fae7748
Update src/Cli/dotnet/commands/dotnet-test/IPC/NamedPipeServer.cs
mariam-abdulla Jun 10, 2024
9138671
refactor code
mariam-abdulla Jun 10, 2024
a8fba78
Merge branch 'dev/mabdullah/ImplementDotnetTestHelp' of https://githu…
mariam-abdulla Jun 10, 2024
cdc6d94
refactor code
mariam-abdulla Jun 10, 2024
46cb20d
change exception in GetSerializer() in NamedPipeBase
mariam-abdulla Jun 10, 2024
3d37391
clean warnings from IClient.cs and IServer.cs
mariam-abdulla Jun 11, 2024
88e5dc9
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 11, 2024
d0b41f0
Send Project full path in GetTestsProject task
mariam-abdulla Jun 11, 2024
e96af9c
Merge branch 'dev/mabdullah/ImplementDotnetTestHelp' of https://githu…
mariam-abdulla Jun 11, 2024
9f7d0ab
Remove DebuggerUtility class
mariam-abdulla Jun 11, 2024
b1d85db
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 11, 2024
de47bb4
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 11, 2024
2c2501e
Use MSBuildThisFileDirectory instead of MSBuildProjectFullPath in Mic…
mariam-abdulla Jun 12, 2024
e4271e9
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 12, 2024
07d37fd
Merge branch 'dev/mabdullah/ImplementDotnetTestHelp' of https://githu…
mariam-abdulla Jun 12, 2024
d9c9839
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 12, 2024
5484b06
Fix replacing MicrosoftNETBuildTasksAssembly
mariam-abdulla Jun 12, 2024
79ed573
Merge branch 'dev/mabdullah/ImplementDotnetTestHelp' of https://githu…
mariam-abdulla Jun 12, 2024
98be087
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 12, 2024
9f2acd1
Merge branch 'main' into dev/mabdullah/ImplementDotnetTestHelp
mariam-abdulla Jun 17, 2024
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
19 changes: 19 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/CliConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Cli
{
internal static class CliConstants
{
public const string HelpOptionKey = "--help";
public const string MSBuildOptionKey = "--msbuild-params";
public const string NoBuildOptionKey = "--no-build";
public const string ServerOptionKey = "--server";
public const string DotNetTestPipeOptionKey = "--dotnet-test-pipe";

public const string ServerOptionValue = "dotnettestcli";

public const string MSBuildExeName = "MSBuild.dll";

}
}
17 changes: 17 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/CustomEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.DotNet.Tools.Test;

namespace Microsoft.DotNet.Cli
{
internal class ErrorEventArgs : EventArgs
{
public string ErrorMessage { get; set; }
}

internal class HelpEventArgs : EventArgs
{
public CommandLineOptionMessages CommandLineOptionMessages { get; set; }
}
}
19 changes: 19 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/IClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal interface IClient :
#if NETCOREAPP
IAsyncDisposable,
#endif
IDisposable
{
bool IsConnected { get; }

Task ConnectAsync(CancellationToken cancellationToken);

Task<TResponse> RequestReplyAsync<TRequest, TResponse>(TRequest request, CancellationToken cancellationToken)
where TRequest : IRequest
where TResponse : IResponse;
}
9 changes: 9 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/INamedPipeBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal interface INamedPipeBase
{
void RegisterSerializer(INamedPipeSerializer namedPipeSerializer, Type type);
}
13 changes: 13 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/INamedPipeSerializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal interface INamedPipeSerializer
{
int Id { get; }

void Serialize(object objectToSerialize, Stream stream);

object Deserialize(Stream stream);
}
8 changes: 8 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/IRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal interface IRequest
{
}
8 changes: 8 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/IResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal interface IResponse
{
}
15 changes: 15 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/IServer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal interface IServer : INamedPipeBase,
#if NETCOREAPP
IAsyncDisposable,
#endif
IDisposable
{
PipeNameDescription PipeName { get; }

Task WaitConnectionAsync(CancellationToken cancellationToken);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test
{
internal sealed record CommandLineOptionMessage(string Name, string Description, bool IsHidden, bool IsBuiltIn) : IRequest;

internal sealed record CommandLineOptionMessages(string ModulePath, CommandLineOptionMessage[] CommandLineOptionMessageList) : IRequest;
}
6 changes: 6 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/Models/Module.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal sealed record class Module(string DLLPath, string ProjectPath) : IRequest;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace Microsoft.DotNet.Tools.Test;

internal sealed class VoidResponse : IResponse
{
public static readonly VoidResponse CachedInstance = new();
}
46 changes: 46 additions & 0 deletions src/Cli/dotnet/commands/dotnet-test/IPC/NamedPipeBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#pragma warning disable IDE0240 // Remove redundant nullable directive
#nullable disable
#pragma warning restore IDE0240 // Remove redundant nullable directive

using System.Globalization;

namespace Microsoft.DotNet.Tools.Test;

internal abstract class NamedPipeBase
{
private readonly Dictionary<Type, object> _typeSerializer = [];
private readonly Dictionary<int, object> _idSerializer = [];

public void RegisterSerializer(INamedPipeSerializer namedPipeSerializer, Type type)
{
_typeSerializer.Add(type, namedPipeSerializer);
_idSerializer.Add(namedPipeSerializer.Id, namedPipeSerializer);
}

protected INamedPipeSerializer GetSerializer(int id)
=> _idSerializer.TryGetValue(id, out object serializer)
? (INamedPipeSerializer)serializer
: throw new ArgumentException((string.Format(
CultureInfo.InvariantCulture,
#if dotnet
LocalizableStrings.NoSerializerRegisteredWithIdErrorMessage,
#else
"No serializer registered with ID '{0}'",
#endif
id)));

protected INamedPipeSerializer GetSerializer(Type type)
=> _typeSerializer.TryGetValue(type, out object serializer)
? (INamedPipeSerializer)serializer
: throw new ArgumentException(string.Format(
CultureInfo.InvariantCulture,
#if dotnet
LocalizableStrings.NoSerializerRegisteredWithTypeErrorMessage,
#else
"No serializer registered with type '{0}'",
#endif
type));
}
Loading