diff --git a/src/aspnetcore/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor b/src/aspnetcore/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor
index d6c0928d658..c81bfba1e7f 100644
--- a/src/aspnetcore/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor
+++ b/src/aspnetcore/src/Components/test/testassets/Components.TestServer/RazorComponents/Shared/EnhancedNavLayout.razor
@@ -25,6 +25,24 @@
LocationChanged/LocationChanging event (server-and-wasm)Null component parameter (server)Null component parameter (wasm)
+
+
+
+
+
+
+
+
diff --git a/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Mvc/DetectAmbiguousActionRoutes.cs b/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Mvc/DetectAmbiguousActionRoutes.cs
index 3bb454473cc..a3c66da1e17 100644
--- a/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Mvc/DetectAmbiguousActionRoutes.cs
+++ b/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/Mvc/DetectAmbiguousActionRoutes.cs
@@ -20,7 +20,7 @@ public partial class MvcAnalyzer
{
private static void DetectAmbiguousActionRoutes(SymbolAnalysisContext context, WellKnownTypes wellKnownTypes, RoutePatternTree? controllerRoutePattern, List actionRoutes)
{
- var controllerHasActionReplacement = controllerRoutePattern != null ? HasActionReplacementToken(controllerRoutePattern) : false;
+ var controllerHasActionToken = controllerRoutePattern != null ? HasActionToken(controllerRoutePattern) : false;
// Ambiguous action route detection is conservative in what it detects to avoid false positives.
//
@@ -33,7 +33,7 @@ private static void DetectAmbiguousActionRoutes(SymbolAnalysisContext context, W
{
// Group action routes together. When multiple match in a group, then report action routes to diagnostics.
var groupedByParent = actionRoutes
- .GroupBy(ar => new ActionRouteGroupKey(ar.ActionSymbol, ar.RouteUsageModel.RoutePattern, ar.HttpMethods, controllerHasActionReplacement, wellKnownTypes));
+ .GroupBy(ar => new ActionRouteGroupKey(ar.ActionSymbol, ar.RouteUsageModel.RoutePattern, ar.HttpMethods, controllerHasActionToken, wellKnownTypes));
foreach (var ambiguousGroup in groupedByParent.Where(g => g.Count() >= 2))
{
@@ -48,7 +48,12 @@ private static void DetectAmbiguousActionRoutes(SymbolAnalysisContext context, W
}
}
- private static bool HasActionReplacementToken(RoutePatternTree routePattern)
+ ///
+ /// Search route pattern for:
+ /// 1. Action replacement tokens, [action]
+ /// 2. Action parameter tokens, {action}
+ ///
+ private static bool HasActionToken(RoutePatternTree routePattern)
{
for (var i = 0; i < routePattern.Root.Parts.Length; i++)
{
@@ -67,6 +72,23 @@ private static bool HasActionReplacementToken(RoutePatternTree routePattern)
}
}
}
+ else if (segment.Children[j] is RoutePatternParameterNode parameterNode)
+ {
+ for (var k = 0; k < parameterNode.ParameterParts.Length; k++)
+ {
+ if (parameterNode.ParameterParts[k] is RoutePatternNameParameterPartNode namePartNode)
+ {
+ if (!namePartNode.ParameterNameToken.IsMissing)
+ {
+ var name = namePartNode.ParameterNameToken.Value!.ToString();
+ if (string.Equals(name, "action", StringComparison.OrdinalIgnoreCase))
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
}
}
}
@@ -80,10 +102,10 @@ private static bool HasActionReplacementToken(RoutePatternTree routePattern)
public RoutePatternTree RoutePattern { get; }
public ImmutableArray HttpMethods { get; }
public string ActionName { get; }
- public bool HasActionReplacement { get; }
+ public bool HasActionToken { get; }
private readonly WellKnownTypes _wellKnownTypes;
- public ActionRouteGroupKey(IMethodSymbol actionSymbol, RoutePatternTree routePattern, ImmutableArray httpMethods, bool controllerHasActionReplacement, WellKnownTypes wellKnownTypes)
+ public ActionRouteGroupKey(IMethodSymbol actionSymbol, RoutePatternTree routePattern, ImmutableArray httpMethods, bool controllerHasActionToken, WellKnownTypes wellKnownTypes)
{
Debug.Assert(!httpMethods.IsDefault);
@@ -92,7 +114,7 @@ public ActionRouteGroupKey(IMethodSymbol actionSymbol, RoutePatternTree routePat
HttpMethods = httpMethods;
_wellKnownTypes = wellKnownTypes;
ActionName = GetActionName(ActionSymbol, _wellKnownTypes);
- HasActionReplacement = controllerHasActionReplacement || HasActionReplacementToken(RoutePattern);
+ HasActionToken = controllerHasActionToken || HasActionToken(RoutePattern);
}
private static string GetActionName(IMethodSymbol actionSymbol, WellKnownTypes wellKnownTypes)
@@ -118,7 +140,7 @@ public bool Equals(ActionRouteGroupKey other)
{
return
AmbiguousRoutePatternComparer.Instance.Equals(RoutePattern, other.RoutePattern) &&
- (!HasActionReplacement || string.Equals(ActionName, other.ActionName, StringComparison.OrdinalIgnoreCase)) &&
+ (!HasActionToken || string.Equals(ActionName, other.ActionName, StringComparison.OrdinalIgnoreCase)) &&
HasMatchingHttpMethods(HttpMethods, other.HttpMethods) &&
CanMatchActions(_wellKnownTypes, ActionSymbol, other.ActionSymbol);
}
diff --git a/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/test/Mvc/DetectAmbiguousActionRoutesTest.cs b/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/test/Mvc/DetectAmbiguousActionRoutesTest.cs
index 285ff95c36e..d970d00188c 100644
--- a/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/test/Mvc/DetectAmbiguousActionRoutesTest.cs
+++ b/src/aspnetcore/src/Framework/AspNetCoreAnalyzers/test/Mvc/DetectAmbiguousActionRoutesTest.cs
@@ -318,6 +318,284 @@ static void Main(string[] args)
await VerifyCS.VerifyAnalyzerAsync(source);
}
+ [Fact]
+ public async Task ActionRouteToken_DifferentActionNames_NoDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+public class WeatherForecastController : ControllerBase
+{
+ [Route(""{action}"")]
+ public object Get() => new object();
+
+ [Route(""{action}"")]
+ public object Get1() => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_SameActionName_HasDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+public class WeatherForecastController : ControllerBase
+{
+ [Route({|#0:""{action}""|})]
+ public object Get() => new object();
+
+ [Route({|#1:""{action}""|})]
+ public object Get(int i) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ var expectedDiagnostics = new[] {
+ new DiagnosticResult(DiagnosticDescriptors.AmbiguousActionRoute).WithArguments("{action}").WithLocation(0),
+ new DiagnosticResult(DiagnosticDescriptors.AmbiguousActionRoute).WithArguments("{action}").WithLocation(1)
+ };
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source, expectedDiagnostics);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_ActionNameAttribute_HasDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+public class WeatherForecastController : ControllerBase
+{
+ [Route({|#0:""{action}""|})]
+ public object Get() => new object();
+
+ [Route({|#1:""{action}""|})]
+ [ActionName(""get"")]
+ public object Get1(int i) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ var expectedDiagnostics = new[] {
+ new DiagnosticResult(DiagnosticDescriptors.AmbiguousActionRoute).WithArguments("{action}").WithLocation(0),
+ new DiagnosticResult(DiagnosticDescriptors.AmbiguousActionRoute).WithArguments("{action}").WithLocation(1)
+ };
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source, expectedDiagnostics);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_ActionNameAttributeNullValue_NoDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+public class WeatherForecastController : ControllerBase
+{
+ [Route({|#0:""{action}""|})]
+ public object Get() => new object();
+
+ [Route({|#1:""{action}""|})]
+ [ActionName(null)]
+ public object Get1(int i) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_OnController_NoDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+[Route(""{controller}/{action}"")]
+public class WeatherForecastController : ControllerBase
+{
+ [Route(""{i}"")]
+ public object Get(int i) => new object();
+
+ [Route(""{i}"")]
+ public object Get1(int i) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_OnBaseController_NoDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+[Route(""{controller}/{action}"")]
+public class MyControllerBase : ControllerBase
+{
+}
+public class WeatherForecastController : MyControllerBase
+{
+ [Route(""{i}"")]
+ public object Get(int i) => new object();
+
+ [Route(""{i}"")]
+ public object Get1(int i) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_OnBaseControllerButOverridden_HasDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+[Route(""{controller}/{action}"")]
+public class MyControllerBase : ControllerBase
+{
+}
+[Route(""api"")]
+public class WeatherForecastController : MyControllerBase
+{
+ [Route({|#0:""{i}""|})]
+ public object Get(int i) => new object();
+
+ [Route({|#1:""{i}""|})]
+ public object Get1(int i) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ var expectedDiagnostics = new[] {
+ new DiagnosticResult(DiagnosticDescriptors.AmbiguousActionRoute).WithArguments("{i}").WithLocation(0),
+ new DiagnosticResult(DiagnosticDescriptors.AmbiguousActionRoute).WithArguments("{i}").WithLocation(1)
+ };
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source, expectedDiagnostics);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_OnController_ActionName_NoDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+[Route(""{controller}/{action}"")]
+public class WeatherForecastController : ControllerBase
+{
+ [Route(""{i}"")]
+ public object Get(int i) => new object();
+
+ [Route(""{s}"")]
+ [ActionName(name: ""getWithString"")]
+ public object Get(string s) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source);
+ }
+
+ [Fact]
+ public async Task ActionRouteToken_OnController_ActionNameOnBase_NoDiagnostics()
+ {
+ // Arrange
+ var source = @"
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Mvc;
+public abstract class MyControllerBase : ControllerBase
+{
+ [ActionName(name: ""getWithString"")]
+ public abstract object Get(string s);
+}
+[Route(""{controller}/{action}"")]
+public class WeatherForecastController : MyControllerBase
+{
+ [Route(""{i}"")]
+ public object Get(int i) => new object();
+
+ [Route(""{s}"")]
+ public override object Get(string s) => new object();
+}
+internal class Program
+{
+ static void Main(string[] args)
+ {
+ }
+}
+";
+
+ // Act & Assert
+ await VerifyCS.VerifyAnalyzerAsync(source);
+ }
+
[Fact]
public async Task MixedRoutes_DifferentAction_HasDiagnostics()
{
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/HttpValidationProblemDetails.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/HttpValidationProblemDetails.cs
index af225a4b13f..99d07781b92 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/HttpValidationProblemDetails.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/HttpValidationProblemDetails.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Mvc;
namespace Microsoft.AspNetCore.Http;
@@ -36,5 +37,6 @@ private HttpValidationProblemDetails(Dictionary errors)
///
/// Gets the validation errors associated with this instance of .
///
+ [JsonPropertyName("errors")]
public IDictionary Errors { get; set; } = new Dictionary(StringComparer.Ordinal);
}
diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/ProblemDetails.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/ProblemDetails.cs
index 96c7db573ba..02a002451c4 100644
--- a/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/ProblemDetails.cs
+++ b/src/aspnetcore/src/Http/Http.Abstractions/src/ProblemDetails/ProblemDetails.cs
@@ -18,6 +18,7 @@ public class ProblemDetails
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyOrder(-5)]
+ [JsonPropertyName("type")]
public string? Type { get; set; }
///
@@ -27,6 +28,7 @@ public class ProblemDetails
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyOrder(-4)]
+ [JsonPropertyName("title")]
public string? Title { get; set; }
///
@@ -34,6 +36,7 @@ public class ProblemDetails
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyOrder(-3)]
+ [JsonPropertyName("status")]
public int? Status { get; set; }
///
@@ -41,6 +44,7 @@ public class ProblemDetails
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyOrder(-2)]
+ [JsonPropertyName("detail")]
public string? Detail { get; set; }
///
@@ -48,6 +52,7 @@ public class ProblemDetails
///
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyOrder(-1)]
+ [JsonPropertyName("instance")]
public string? Instance { get; set; }
///
diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs
index 5bd053f13f7..8df91d09993 100644
--- a/src/aspnetcore/src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs
+++ b/src/aspnetcore/src/Http/Http.Extensions/test/ProblemDetailsDefaultWriterTest.cs
@@ -54,6 +54,68 @@ public async Task WriteAsync_Works()
Assert.Equal(expectedProblem.Instance, problemDetails.Instance);
}
+ [Fact]
+ public async Task WriteAsync_Works_ProperCasing()
+ {
+ // Arrange
+ var writer = GetWriter();
+ var stream = new MemoryStream();
+ var context = CreateContext(stream);
+ var expectedProblem = new ProblemDetails()
+ {
+ Detail = "Custom Bad Request",
+ Instance = "Custom Bad Request",
+ Status = StatusCodes.Status400BadRequest,
+ Type = "https://tools.ietf.org/html/rfc9110#section-15.5.1-custom",
+ Title = "Custom Bad Request",
+ Extensions = new Dictionary() { { "extensionKey", 1 } }
+ };
+ var problemDetailsContext = new ProblemDetailsContext()
+ {
+ HttpContext = context,
+ ProblemDetails = expectedProblem
+ };
+
+ //Act
+ await writer.WriteAsync(problemDetailsContext);
+
+ //Assert
+ stream.Position = 0;
+ var result = await JsonSerializer.DeserializeAsync>(stream, JsonSerializerOptions.Default);
+ Assert.Equal(result.Keys, new(new() { { "type", 0 }, { "title", 1 }, { "status", 2 }, { "detail", 3 }, { "instance", 4 }, { "extensionKey", 5 } }));
+ }
+
+ [Fact]
+ public async Task WriteAsync_Works_ProperCasing_ValidationProblemDetails()
+ {
+ // Arrange
+ var writer = GetWriter();
+ var stream = new MemoryStream();
+ var context = CreateContext(stream);
+ var expectedProblem = new ValidationProblemDetails()
+ {
+ Detail = "Custom Bad Request",
+ Instance = "Custom Bad Request",
+ Status = StatusCodes.Status400BadRequest,
+ Type = "https://tools.ietf.org/html/rfc9110#section-15.5.1-custom",
+ Title = "Custom Bad Request",
+ Errors = new Dictionary() { { "name", ["Name is invalid."] } }
+ };
+ var problemDetailsContext = new ProblemDetailsContext()
+ {
+ HttpContext = context,
+ ProblemDetails = expectedProblem
+ };
+
+ //Act
+ await writer.WriteAsync(problemDetailsContext);
+
+ //Assert
+ stream.Position = 0;
+ var result = await JsonSerializer.DeserializeAsync>(stream, JsonSerializerOptions.Default);
+ Assert.Equal(result.Keys, new(new() { { "type", 0 }, { "title", 1 }, { "status", 2 }, { "detail", 3 }, { "instance", 4 }, { "errors", 5 } }));
+ }
+
[Fact]
public async Task WriteAsync_Works_WhenReplacingProblemDetailsUsingSetter()
{
diff --git a/src/aspnetcore/src/Identity/Core/src/Data/IdentityEndpointsJsonSerializerContext.cs b/src/aspnetcore/src/Identity/Core/src/Data/IdentityEndpointsJsonSerializerContext.cs
index 1c3f09fbd46..e459042e9ce 100644
--- a/src/aspnetcore/src/Identity/Core/src/Data/IdentityEndpointsJsonSerializerContext.cs
+++ b/src/aspnetcore/src/Identity/Core/src/Data/IdentityEndpointsJsonSerializerContext.cs
@@ -9,6 +9,7 @@ namespace Microsoft.AspNetCore.Identity.Data;
[JsonSerializable(typeof(LoginRequest))]
[JsonSerializable(typeof(RefreshRequest))]
[JsonSerializable(typeof(ResetPasswordRequest))]
+[JsonSerializable(typeof(ForgotPasswordRequest))]
[JsonSerializable(typeof(ResendConfirmationEmailRequest))]
[JsonSerializable(typeof(InfoRequest))]
[JsonSerializable(typeof(InfoResponse))]
diff --git a/src/aspnetcore/src/Mvc/Mvc.Core/src/ValidationProblemDetails.cs b/src/aspnetcore/src/Mvc/Mvc.Core/src/ValidationProblemDetails.cs
index 0701521ebb3..d3ce4af1a8c 100644
--- a/src/aspnetcore/src/Mvc/Mvc.Core/src/ValidationProblemDetails.cs
+++ b/src/aspnetcore/src/Mvc/Mvc.Core/src/ValidationProblemDetails.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Text.Json.Serialization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.ModelBinding;
@@ -81,5 +82,6 @@ public ValidationProblemDetails(IDictionary errors)
///
/// Gets the validation errors associated with this instance of .
///
+ [JsonPropertyName("errors")]
public new IDictionary Errors { get { return base.Errors; } set { base.Errors = value; } }
}
diff --git a/src/aspnetcore/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs b/src/aspnetcore/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
index 7f97e1e2976..c47953e4eeb 100644
--- a/src/aspnetcore/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
+++ b/src/aspnetcore/src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs
@@ -168,6 +168,14 @@ private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connecti
{
transport = HttpTransportType.WebSockets;
connection = await GetOrCreateConnectionAsync(context, options);
+
+ if (connection is not null)
+ {
+ Log.EstablishedConnection(_logger);
+
+ // Allow the reads to be canceled
+ connection.Cancellation ??= new CancellationTokenSource();
+ }
}
else
{
diff --git a/src/aspnetcore/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs b/src/aspnetcore/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs
index 20ba0fc3dc9..f55f5756ac4 100644
--- a/src/aspnetcore/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs
+++ b/src/aspnetcore/src/SignalR/common/Http.Connections/test/HttpConnectionDispatcherTests.cs
@@ -2866,6 +2866,37 @@ public async Task WebSocketConnectionClosingTriggersConnectionClosedToken()
}
}
+ [Fact]
+ public async Task ServerClosingClosesWebSocketConnection()
+ {
+ using (StartVerifiableLog())
+ {
+ var manager = CreateConnectionManager(LoggerFactory);
+ var connection = manager.CreateConnection();
+
+ var dispatcher = CreateDispatcher(manager, LoggerFactory);
+ var services = new ServiceCollection();
+ services.AddSingleton();
+ var context = MakeRequest("/foo", connection, services);
+ SetTransport(context, HttpTransportType.WebSockets);
+
+ var builder = new ConnectionBuilder(services.BuildServiceProvider());
+ builder.UseConnectionHandler();
+ var app = builder.Build();
+ var options = new HttpConnectionDispatcherOptions();
+ options.WebSockets.CloseTimeout = TimeSpan.FromSeconds(1);
+
+ var executeTask = dispatcher.ExecuteAsync(context, options, app);
+
+ // "close" server, since we're not using a server in these tests we just simulate what would be called when the server closes
+ await connection.DisposeAsync().DefaultTimeout();
+
+ await connection.ConnectionClosed.WaitForCancellationAsync().DefaultTimeout();
+
+ await executeTask.DefaultTimeout();
+ }
+ }
+
public class CustomHttpRequestLifetimeFeature : IHttpRequestLifetimeFeature
{
public CancellationToken RequestAborted { get; set; }
diff --git a/src/aspnetcore/src/SignalR/server/Core/src/DefaultHubLifetimeManager.cs b/src/aspnetcore/src/SignalR/server/Core/src/DefaultHubLifetimeManager.cs
index eec5f9ea254..1eba4726f89 100644
--- a/src/aspnetcore/src/SignalR/server/Core/src/DefaultHubLifetimeManager.cs
+++ b/src/aspnetcore/src/SignalR/server/Core/src/DefaultHubLifetimeManager.cs
@@ -42,7 +42,18 @@ public override Task AddToGroupAsync(string connectionId, string groupName, Canc
return Task.CompletedTask;
}
- _groups.Add(connection, groupName);
+ // Track groups in the connection object
+ lock (connection.GroupNames)
+ {
+ if (!connection.GroupNames.Add(groupName))
+ {
+ // Connection already in group
+ return Task.CompletedTask;
+ }
+
+ _groups.Add(connection, groupName);
+ }
+
// Connection disconnected while adding to group, remove it in case the Add was called after OnDisconnectedAsync removed items from the group
if (connection.ConnectionAborted.IsCancellationRequested)
{
@@ -64,7 +75,17 @@ public override Task RemoveFromGroupAsync(string connectionId, string groupName,
return Task.CompletedTask;
}
- _groups.Remove(connectionId, groupName);
+ // Remove from previously saved groups
+ lock (connection.GroupNames)
+ {
+ if (!connection.GroupNames.Remove(groupName))
+ {
+ // Connection not in group
+ return Task.CompletedTask;
+ }
+
+ _groups.Remove(connectionId, groupName);
+ }
return Task.CompletedTask;
}
@@ -277,8 +298,16 @@ public override Task OnConnectedAsync(HubConnectionContext connection)
///
public override Task OnDisconnectedAsync(HubConnectionContext connection)
{
+ lock (connection.GroupNames)
+ {
+ // Remove from tracked groups one by one
+ foreach (var groupName in connection.GroupNames)
+ {
+ _groups.Remove(connection.ConnectionId, groupName);
+ }
+ }
+
_connections.Remove(connection);
- _groups.RemoveDisconnectedConnection(connection.ConnectionId);
return Task.CompletedTask;
}
diff --git a/src/aspnetcore/src/SignalR/server/Core/src/HubConnectionContext.cs b/src/aspnetcore/src/SignalR/server/Core/src/HubConnectionContext.cs
index af9c68bbaa8..da0067064b9 100644
--- a/src/aspnetcore/src/SignalR/server/Core/src/HubConnectionContext.cs
+++ b/src/aspnetcore/src/SignalR/server/Core/src/HubConnectionContext.cs
@@ -56,6 +56,9 @@ public partial class HubConnectionContext
[MemberNotNullWhen(true, nameof(_messageBuffer))]
internal bool UsingStatefulReconnect() => _useStatefulReconnect;
+ // Tracks groups that the connection has been added to
+ internal HashSet GroupNames { get; } = new HashSet();
+
///
/// Initializes a new instance of the class.
///
diff --git a/src/aspnetcore/src/SignalR/server/Core/src/Internal/HubGroupList.cs b/src/aspnetcore/src/SignalR/server/Core/src/Internal/HubGroupList.cs
index 138595d5be0..d87bb7f09e4 100644
--- a/src/aspnetcore/src/SignalR/server/Core/src/Internal/HubGroupList.cs
+++ b/src/aspnetcore/src/SignalR/server/Core/src/Internal/HubGroupList.cs
@@ -3,7 +3,6 @@
using System.Collections;
using System.Collections.Concurrent;
-using System.Linq;
namespace Microsoft.AspNetCore.SignalR.Internal;
@@ -43,15 +42,6 @@ public void Remove(string connectionId, string groupName)
}
}
- public void RemoveDisconnectedConnection(string connectionId)
- {
- var groupNames = _groups.Where(x => x.Value.ContainsKey(connectionId)).Select(x => x.Key);
- foreach (var groupName in groupNames)
- {
- Remove(connectionId, groupName);
- }
- }
-
public int Count => _groups.Count;
public IEnumerator> GetEnumerator()
diff --git a/src/aspnetcore/src/Tools/dotnet-sql-cache/src/dotnet-sql-cache.csproj b/src/aspnetcore/src/Tools/dotnet-sql-cache/src/dotnet-sql-cache.csproj
index ca9fb454c38..91c5ec3c5fe 100644
--- a/src/aspnetcore/src/Tools/dotnet-sql-cache/src/dotnet-sql-cache.csproj
+++ b/src/aspnetcore/src/Tools/dotnet-sql-cache/src/dotnet-sql-cache.csproj
@@ -15,6 +15,7 @@
+
diff --git a/src/aspnetcore/src/submodules/googletest/.gitignore b/src/aspnetcore/src/submodules/googletest/.gitignore
index fede02f6509..f0df39db1d7 100644
--- a/src/aspnetcore/src/submodules/googletest/.gitignore
+++ b/src/aspnetcore/src/submodules/googletest/.gitignore
@@ -8,6 +8,7 @@ bazel-genfiles
bazel-googletest
bazel-out
bazel-testlogs
+MODULE.bazel.lock
# python
*.pyc
diff --git a/src/aspnetcore/src/submodules/googletest/CMakeLists.txt b/src/aspnetcore/src/submodules/googletest/CMakeLists.txt
index 089ac987fb6..9e6d6440da9 100644
--- a/src/aspnetcore/src/submodules/googletest/CMakeLists.txt
+++ b/src/aspnetcore/src/submodules/googletest/CMakeLists.txt
@@ -15,11 +15,20 @@ enable_testing()
include(CMakeDependentOption)
include(GNUInstallDirs)
-#Note that googlemock target already builds googletest
+# Note that googlemock target already builds googletest.
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF)
+if(GTEST_HAS_ABSL)
+ if(NOT TARGET absl::base)
+ find_package(absl REQUIRED)
+ endif()
+ if(NOT TARGET re2::re2)
+ find_package(re2 REQUIRED)
+ endif()
+endif()
+
if(BUILD_GMOCK)
add_subdirectory( googlemock )
else()
diff --git a/src/aspnetcore/src/submodules/googletest/CONTRIBUTING.md b/src/aspnetcore/src/submodules/googletest/CONTRIBUTING.md
index 8bed14b2666..ab5a47bf553 100644
--- a/src/aspnetcore/src/submodules/googletest/CONTRIBUTING.md
+++ b/src/aspnetcore/src/submodules/googletest/CONTRIBUTING.md
@@ -47,11 +47,11 @@ PR is acceptable as an alternative.
## The Google Test and Google Mock Communities
The Google Test community exists primarily through the
-[discussion group](http://groups.google.com/group/googletestframework) and the
+[discussion group](https://groups.google.com/group/googletestframework) and the
GitHub repository. Likewise, the Google Mock community exists primarily through
-their own [discussion group](http://groups.google.com/group/googlemock). You are
-definitely encouraged to contribute to the discussion and you can also help us
-to keep the effectiveness of the group high by following and promoting the
+their own [discussion group](https://groups.google.com/group/googlemock). You
+are definitely encouraged to contribute to the discussion and you can also help
+us to keep the effectiveness of the group high by following and promoting the
guidelines listed here.
### Please Be Friendly
diff --git a/src/aspnetcore/src/submodules/googletest/CONTRIBUTORS b/src/aspnetcore/src/submodules/googletest/CONTRIBUTORS
index 77397a5b53f..ccea41ea810 100644
--- a/src/aspnetcore/src/submodules/googletest/CONTRIBUTORS
+++ b/src/aspnetcore/src/submodules/googletest/CONTRIBUTORS
@@ -55,6 +55,7 @@ Russ Cox
Russ Rufer
Sean Mcafee
Sigurður Ásgeirsson
+Soyeon Kim
Sverre Sundsdal
Szymon Sobik
Takeshi Yoshino
diff --git a/src/aspnetcore/src/submodules/googletest/MODULE.bazel b/src/aspnetcore/src/submodules/googletest/MODULE.bazel
new file mode 100644
index 00000000000..d4ad2b3aed0
--- /dev/null
+++ b/src/aspnetcore/src/submodules/googletest/MODULE.bazel
@@ -0,0 +1,57 @@
+# Copyright 2024 Google Inc.
+# All Rights Reserved.
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# https://bazel.build/external/overview#bzlmod
+
+module(
+ name = "googletest",
+ version = "head",
+ compatibility_level = 1,
+)
+
+# Only direct dependencies need to be listed below.
+# Please keep the versions in sync with the versions in the WORKSPACE file.
+
+bazel_dep(name = "abseil-cpp",
+ version = "20240116.0",
+ repo_name = "com_google_absl")
+
+bazel_dep(name = "platforms",
+ version = "0.0.8")
+
+bazel_dep(name = "re2",
+ repo_name = "com_googlesource_code_re2",
+ version = "2023-11-01")
+
+bazel_dep(name = "rules_python",
+ version = "0.29.0")
+
+# https://github.com/bazelbuild/rules_python/blob/main/BZLMOD_SUPPORT.md#default-toolchain-is-not-the-local-system-python
+register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain")
diff --git a/src/aspnetcore/src/submodules/googletest/README.md b/src/aspnetcore/src/submodules/googletest/README.md
index 1bca4d1ff92..c1c14465962 100644
--- a/src/aspnetcore/src/submodules/googletest/README.md
+++ b/src/aspnetcore/src/submodules/googletest/README.md
@@ -100,12 +100,12 @@ tools.
In addition to many internal projects at Google, GoogleTest is also used by the
following notable projects:
-* The [Chromium projects](http://www.chromium.org/) (behind the Chrome browser
- and Chrome OS).
-* The [LLVM](http://llvm.org/) compiler.
+* The [Chromium projects](https://www.chromium.org/) (behind the Chrome
+ browser and Chrome OS).
+* The [LLVM](https://llvm.org/) compiler.
* [Protocol Buffers](https://github.com/google/protobuf), Google's data
interchange format.
-* The [OpenCV](http://opencv.org/) computer vision library.
+* The [OpenCV](https://opencv.org/) computer vision library.
## Related Open Source Projects
diff --git a/src/aspnetcore/src/submodules/googletest/WORKSPACE b/src/aspnetcore/src/submodules/googletest/WORKSPACE
index f819ffe61b3..92cfd259a84 100644
--- a/src/aspnetcore/src/submodules/googletest/WORKSPACE
+++ b/src/aspnetcore/src/submodules/googletest/WORKSPACE
@@ -6,22 +6,24 @@ googletest_deps()
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
- name = "rules_python", # 2023-07-31T20:39:27Z
- sha256 = "1250b59a33c591a1c4ba68c62e95fc88a84c334ec35a2e23f46cbc1b9a5a8b55",
- strip_prefix = "rules_python-e355becc30275939d87116a4ec83dad4bb50d9e1",
- urls = ["https://github.com/bazelbuild/rules_python/archive/e355becc30275939d87116a4ec83dad4bb50d9e1.zip"],
+ name = "rules_python",
+ sha256 = "d71d2c67e0bce986e1c5a7731b4693226867c45bfe0b7c5e0067228a536fc580",
+ strip_prefix = "rules_python-0.29.0",
+ urls = ["https://github.com/bazelbuild/rules_python/releases/download/0.29.0/rules_python-0.29.0.tar.gz"],
)
+# https://github.com/bazelbuild/rules_python/releases/tag/0.29.0
+load("@rules_python//python:repositories.bzl", "py_repositories")
+py_repositories()
+
http_archive(
- name = "bazel_skylib", # 2023-05-31T19:24:07Z
- sha256 = "08c0386f45821ce246bbbf77503c973246ed6ee5c3463e41efc197fa9bc3a7f4",
- strip_prefix = "bazel-skylib-288731ef9f7f688932bd50e704a91a45ec185f9b",
- urls = ["https://github.com/bazelbuild/bazel-skylib/archive/288731ef9f7f688932bd50e704a91a45ec185f9b.zip"],
+ name = "bazel_skylib",
+ sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
+ urls = ["https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"],
)
http_archive(
- name = "platforms", # 2023-07-28T19:44:27Z
- sha256 = "40eb313613ff00a5c03eed20aba58890046f4d38dec7344f00bb9a8867853526",
- strip_prefix = "platforms-4ad40ef271da8176d4fc0194d2089b8a76e19d7b",
- urls = ["https://github.com/bazelbuild/platforms/archive/4ad40ef271da8176d4fc0194d2089b8a76e19d7b.zip"],
+ name = "platforms",
+ sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
+ urls = ["https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"],
)
diff --git a/src/aspnetcore/src/submodules/googletest/WORKSPACE.bzlmod b/src/aspnetcore/src/submodules/googletest/WORKSPACE.bzlmod
new file mode 100644
index 00000000000..381432c5d0c
--- /dev/null
+++ b/src/aspnetcore/src/submodules/googletest/WORKSPACE.bzlmod
@@ -0,0 +1,35 @@
+# Copyright 2024 Google Inc.
+# All Rights Reserved.
+#
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# https://bazel.build/external/migration#workspace.bzlmod
+#
+# This file is intentionally empty. When bzlmod is enabled and this
+# file exists, the content of WORKSPACE is ignored. This prevents
+# bzlmod builds from unintentionally depending on the WORKSPACE file.
diff --git a/src/aspnetcore/src/submodules/googletest/ci/linux-presubmit.sh b/src/aspnetcore/src/submodules/googletest/ci/linux-presubmit.sh
index 6bac88787ff..35e1670724e 100644
--- a/src/aspnetcore/src/submodules/googletest/ci/linux-presubmit.sh
+++ b/src/aspnetcore/src/submodules/googletest/ci/linux-presubmit.sh
@@ -31,7 +31,7 @@
set -euox pipefail
-readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20230217"
+readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20231218"
readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20230120"
if [[ -z ${GTEST_ROOT:-} ]]; then
@@ -67,6 +67,9 @@ for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do
done
# Do one test with an older version of GCC
+# TODO(googletest-team): This currently uses Bazel 5. When upgrading to a
+# version of Bazel that supports Bzlmod, add --enable_bzlmod=false to keep test
+# coverage for the old WORKSPACE dependency management.
time docker run \
--volume="${GTEST_ROOT}:/src:ro" \
--workdir="/src" \
@@ -80,7 +83,6 @@ time docker run \
--copt="-Wuninitialized" \
--copt="-Wundef" \
--copt="-Wno-error=pragmas" \
- --distdir="/bazel-distdir" \
--features=external_include_paths \
--keep_going \
--show_timestamps \
@@ -102,7 +104,7 @@ for std in ${STD}; do
--copt="-Wuninitialized" \
--copt="-Wundef" \
--define="absl=${absl}" \
- --distdir="/bazel-distdir" \
+ --enable_bzlmod=true \
--features=external_include_paths \
--keep_going \
--show_timestamps \
@@ -127,7 +129,7 @@ for std in ${STD}; do
--copt="-Wuninitialized" \
--copt="-Wundef" \
--define="absl=${absl}" \
- --distdir="/bazel-distdir" \
+ --enable_bzlmod=true \
--features=external_include_paths \
--keep_going \
--linkopt="--gcc-toolchain=/usr/local" \
diff --git a/src/aspnetcore/src/submodules/googletest/ci/macos-presubmit.sh b/src/aspnetcore/src/submodules/googletest/ci/macos-presubmit.sh
index 681ebc2a91d..70eaa74fb49 100644
--- a/src/aspnetcore/src/submodules/googletest/ci/macos-presubmit.sh
+++ b/src/aspnetcore/src/submodules/googletest/ci/macos-presubmit.sh
@@ -53,7 +53,7 @@ done
# Test the Bazel build
# If we are running on Kokoro, check for a versioned Bazel binary.
-KOKORO_GFILE_BAZEL_BIN="bazel-5.1.1-darwin-x86_64"
+KOKORO_GFILE_BAZEL_BIN="bazel-7.0.0-darwin-x86_64"
if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then
BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}"
chmod +x ${BAZEL_BIN}
@@ -69,6 +69,7 @@ for absl in 0 1; do
--copt="-Wundef" \
--cxxopt="-std=c++14" \
--define="absl=${absl}" \
+ --enable_bzlmod=true \
--features=external_include_paths \
--keep_going \
--show_timestamps \
diff --git a/src/aspnetcore/src/submodules/googletest/ci/windows-presubmit.bat b/src/aspnetcore/src/submodules/googletest/ci/windows-presubmit.bat
index 48962eb9e08..9753f9c0c51 100644
--- a/src/aspnetcore/src/submodules/googletest/ci/windows-presubmit.bat
+++ b/src/aspnetcore/src/submodules/googletest/ci/windows-presubmit.bat
@@ -1,6 +1,6 @@
SETLOCAL ENABLEDELAYEDEXPANSION
-SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe
+SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-7.0.0-windows-x86_64.exe
SET PATH=C:\Python34;%PATH%
SET BAZEL_PYTHON=C:\python34\python.exe
@@ -51,7 +51,7 @@ SET BAZEL_VS=C:\Program Files\Microsoft Visual Studio\2022\Community
--compilation_mode=dbg ^
--copt=/std:c++14 ^
--copt=/WX ^
- --features=external_include_paths ^
+ --enable_bzlmod=true ^
--keep_going ^
--test_output=errors ^
--test_tag_filters=-no_test_msvc2017
diff --git a/src/aspnetcore/src/submodules/googletest/docs/advanced.md b/src/aspnetcore/src/submodules/googletest/docs/advanced.md
index 344d5418b61..2ecce63f56f 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/advanced.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/advanced.md
@@ -508,9 +508,9 @@ TEST_F(FooDeathTest, DoesThat) {
When built with Bazel and using Abseil, GoogleTest uses the
[RE2](https://github.com/google/re2/wiki/Syntax) syntax. Otherwise, for POSIX
systems (Linux, Cygwin, Mac), GoogleTest uses the
-[POSIX extended regular expression](http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04)
+[POSIX extended regular expression](https://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04)
syntax. To learn about POSIX syntax, you may want to read this
-[Wikipedia entry](http://en.wikipedia.org/wiki/Regular_expression#POSIX_extended).
+[Wikipedia entry](https://en.wikipedia.org/wiki/Regular_expression#POSIX_extended).
On Windows, GoogleTest uses its own simple regular expression implementation. It
lacks many features. For example, we don't support union (`"x|y"`), grouping
@@ -1004,11 +1004,21 @@ calling the `::testing::AddGlobalTestEnvironment()` function:
Environment* AddGlobalTestEnvironment(Environment* env);
```
-Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of
-each environment object, then runs the tests if none of the environments
-reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()`
-always calls `TearDown()` with each environment object, regardless of whether or
-not the tests were run.
+Now, when `RUN_ALL_TESTS()` is invoked, it first calls the `SetUp()` method. The
+tests are then executed, provided that none of the environments have reported
+fatal failures and `GTEST_SKIP()` has not been invoked. Finally, `TearDown()` is
+called.
+
+Note that `SetUp()` and `TearDown()` are only invoked if there is at least one
+test to be performed. Importantly, `TearDown()` is executed even if the test is
+not run due to a fatal failure or `GTEST_SKIP()`.
+
+Calling `SetUp()` and `TearDown()` for each iteration depends on the flag
+`gtest_recreate_environments_when_repeating`. `SetUp()` and `TearDown()` are
+called for each environment object when the object is recreated for each
+iteration. However, if test environments are not recreated for each iteration,
+`SetUp()` is called only on the first iteration, and `TearDown()` is called only
+on the last iteration.
It's OK to register multiple environment objects. In this suite, their `SetUp()`
will be called in the order they are registered, and their `TearDown()` will be
@@ -2171,7 +2181,7 @@ The report format conforms to the following JSON Schema:
```json
{
- "$schema": "http://json-schema.org/schema#",
+ "$schema": "https://json-schema.org/schema#",
"type": "object",
"definitions": {
"TestCase": {
diff --git a/src/aspnetcore/src/submodules/googletest/docs/faq.md b/src/aspnetcore/src/submodules/googletest/docs/faq.md
index 1928097292a..c7d10b5006b 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/faq.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/faq.md
@@ -3,7 +3,7 @@
## Why should test suite names and test names not contain underscore?
{: .callout .note}
-Note: GoogleTest reserves underscore (`_`) for special purpose keywords, such as
+Note: GoogleTest reserves underscore (`_`) for special-purpose keywords, such as
[the `DISABLED_` prefix](advanced.md#temporarily-disabling-tests), in addition
to the following rationale.
@@ -33,9 +33,9 @@ contains `_`?
`TestSuiteName_Bar__Test`, which is invalid.
So clearly `TestSuiteName` and `TestName` cannot start or end with `_`
-(Actually, `TestSuiteName` can start with `_` -- as long as the `_` isn't
-followed by an upper-case letter. But that's getting complicated. So for
-simplicity we just say that it cannot start with `_`.).
+(Actually, `TestSuiteName` can start with `_`—as long as the `_` isn't followed
+by an upper-case letter. But that's getting complicated. So for simplicity we
+just say that it cannot start with `_`.).
It may seem fine for `TestSuiteName` and `TestName` to contain `_` in the
middle. However, consider this:
@@ -128,30 +128,9 @@ both approaches a try. Practice is a much better way to grasp the subtle
differences between the two tools. Once you have some concrete experience, you
can much more easily decide which one to use the next time.
-## I got some run-time errors about invalid proto descriptors when using `ProtocolMessageEquals`. Help!
-
-{: .callout .note}
-**Note:** `ProtocolMessageEquals` and `ProtocolMessageEquiv` are *deprecated*
-now. Please use `EqualsProto`, etc instead.
-
-`ProtocolMessageEquals` and `ProtocolMessageEquiv` were redefined recently and
-are now less tolerant of invalid protocol buffer definitions. In particular, if
-you have a `foo.proto` that doesn't fully qualify the type of a protocol message
-it references (e.g. `message` where it should be `message`), you
-will now get run-time errors like:
-
-```
-... descriptor.cc:...] Invalid proto descriptor for file "path/to/foo.proto":
-... descriptor.cc:...] blah.MyMessage.my_field: ".Bar" is not defined.
-```
-
-If you see this, your `.proto` file is broken and needs to be fixed by making
-the types fully qualified. The new definition of `ProtocolMessageEquals` and
-`ProtocolMessageEquiv` just happen to reveal your bug.
-
## My death test modifies some state, but the change seems lost after the death test finishes. Why?
-Death tests (`EXPECT_DEATH`, etc) are executed in a sub-process s.t. the
+Death tests (`EXPECT_DEATH`, etc.) are executed in a sub-process s.t. the
expected crash won't kill the test program (i.e. the parent process). As a
result, any in-memory side effects they incur are observable in their respective
sub-processes, but not in the parent process. You can think of them as running
@@ -192,16 +171,16 @@ class Foo {
};
```
-You also need to define it *outside* of the class body in `foo.cc`:
+you also need to define it *outside* of the class body in `foo.cc`:
```c++
const int Foo::kBar; // No initializer here.
```
Otherwise your code is **invalid C++**, and may break in unexpected ways. In
-particular, using it in GoogleTest comparison assertions (`EXPECT_EQ`, etc) will
-generate an "undefined reference" linker error. The fact that "it used to work"
-doesn't mean it's valid. It just means that you were lucky. :-)
+particular, using it in GoogleTest comparison assertions (`EXPECT_EQ`, etc.)
+will generate an "undefined reference" linker error. The fact that "it used to
+work" doesn't mean it's valid. It just means that you were lucky. :-)
If the declaration of the static data member is `constexpr` then it is
implicitly an `inline` definition, and a separate definition in `foo.cc` is not
@@ -311,7 +290,7 @@ a **fresh** test fixture object, immediately call `SetUp()`, run the test body,
call `TearDown()`, and then delete the test fixture object.
When you need to write per-test set-up and tear-down logic, you have the choice
-between using the test fixture constructor/destructor or `SetUp()/TearDown()`.
+between using the test fixture constructor/destructor or `SetUp()`/`TearDown()`.
The former is usually preferred, as it has the following benefits:
* By initializing a member variable in the constructor, we have the option to
@@ -352,7 +331,7 @@ You may still want to use `SetUp()/TearDown()` in the following cases:
GoogleTest assertions in a destructor if your code could run on such a
platform.
-## The compiler complains "no matching function to call" when I use ASSERT_PRED*. How do I fix it?
+## The compiler complains "no matching function to call" when I use `ASSERT_PRED*`. How do I fix it?
See details for [`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) in the
Assertions Reference.
@@ -410,7 +389,7 @@ C++ is case-sensitive. Did you spell it as `Setup()`?
Similarly, sometimes people spell `SetUpTestSuite()` as `SetupTestSuite()` and
wonder why it's never called.
-## I have several test suites which share the same test fixture logic, do I have to define a new test fixture class for each of them? This seems pretty tedious.
+## I have several test suites which share the same test fixture logic; do I have to define a new test fixture class for each of them? This seems pretty tedious.
You don't have to. Instead of
@@ -545,7 +524,7 @@ The new NPTL thread library doesn't suffer from this problem, as it doesn't
create a manager thread. However, if you don't control which machine your test
runs on, you shouldn't depend on this.
-## Why does GoogleTest require the entire test suite, instead of individual tests, to be named *DeathTest when it uses ASSERT_DEATH?
+## Why does GoogleTest require the entire test suite, instead of individual tests, to be named `*DeathTest` when it uses `ASSERT_DEATH`?
GoogleTest does not interleave tests from different test suites. That is, it
runs all tests in one test suite first, and then runs all tests in the next test
@@ -570,7 +549,7 @@ interleave tests from different test suites, we need to run all tests in the
`FooTest` case before running any test in the `BarTest` case. This contradicts
with the requirement to run `BarTest.DefDeathTest` before `FooTest.Uvw`.
-## But I don't like calling my entire test suite \*DeathTest when it contains both death tests and non-death tests. What do I do?
+## But I don't like calling my entire test suite `*DeathTest` when it contains both death tests and non-death tests. What do I do?
You don't have to, but if you like, you may split up the test suite into
`FooTest` and `FooDeathTest`, where the names make it clear that they are
@@ -607,7 +586,7 @@ defined such that we can print a value of `FooType`.
In addition, if `FooType` is declared in a name space, the `<<` operator also
needs to be defined in the *same* name space. See
-[Tip of the Week #49](http://abseil.io/tips/49) for details.
+[Tip of the Week #49](https://abseil.io/tips/49) for details.
## How do I suppress the memory leak messages on Windows?
@@ -628,10 +607,10 @@ mistake in production. Such cleverness also leads to
advise against the practice, and GoogleTest doesn't provide a way to do it.
In general, the recommended way to cause the code to behave differently under
-test is [Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection). You can inject
+test is [Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection). You can inject
different functionality from the test and from the production code. Since your
production code doesn't link in the for-test logic at all (the
-[`testonly`](http://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly) attribute for BUILD targets helps to ensure
+[`testonly`](https://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly) attribute for BUILD targets helps to ensure
that), there is no danger in accidentally running it.
However, if you *really*, *really*, *really* have no choice, and if you follow
@@ -654,7 +633,7 @@ the `--gtest_also_run_disabled_tests` flag.
Yes.
The rule is **all test methods in the same test suite must use the same fixture
-class.** This means that the following is **allowed** because both tests use the
+class**. This means that the following is **allowed** because both tests use the
same fixture class (`::testing::Test`).
```c++
diff --git a/src/aspnetcore/src/submodules/googletest/docs/gmock_cook_book.md b/src/aspnetcore/src/submodules/googletest/docs/gmock_cook_book.md
index da10918c965..5e9b6647d07 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/gmock_cook_book.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/gmock_cook_book.md
@@ -1927,6 +1927,12 @@ class MockFoo : public Foo {
action_n));
```
+The return value of the last action **must** match the return type of the mocked
+method. In the example above, `action_n` could be `Return(true)`, or a lambda
+that returns a `bool`, but not `SaveArg`, which returns `void`. Otherwise the
+signature of `DoAll` would not match the signature expected by `WillOnce`, which
+is the signature of the mocked method, and it wouldn't compile.
+
### Verifying Complex Arguments {#SaveArgVerify}
If you want to verify that a method is called with a particular argument but the
diff --git a/src/aspnetcore/src/submodules/googletest/docs/gmock_for_dummies.md b/src/aspnetcore/src/submodules/googletest/docs/gmock_for_dummies.md
index 43f907aaa5d..9f24dcae548 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/gmock_for_dummies.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/gmock_for_dummies.md
@@ -90,14 +90,14 @@ gMock is bundled with googletest.
## A Case for Mock Turtles
Let's look at an example. Suppose you are developing a graphics program that
-relies on a [LOGO](http://en.wikipedia.org/wiki/Logo_programming_language)-like
+relies on a [LOGO](https://en.wikipedia.org/wiki/Logo_programming_language)-like
API for drawing. How would you test that it does the right thing? Well, you can
run it and compare the screen with a golden screen snapshot, but let's admit it:
tests like this are expensive to run and fragile (What if you just upgraded to a
shiny new graphics card that has better anti-aliasing? Suddenly you have to
update all your golden images.). It would be too painful if all your tests are
like this. Fortunately, you learned about
-[Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection) and know the right thing
+[Dependency Injection](https://en.wikipedia.org/wiki/Dependency_injection) and know the right thing
to do: instead of having your application talk to the system API directly, wrap
the API in an interface (say, `Turtle`) and code to that interface:
diff --git a/src/aspnetcore/src/submodules/googletest/docs/primer.md b/src/aspnetcore/src/submodules/googletest/docs/primer.md
index f2a97a7269b..0f90c0399a9 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/primer.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/primer.md
@@ -50,7 +50,7 @@ terms *Test*, *Test Case* and *Test Suite*, so beware of misunderstanding these.
Historically, GoogleTest started to use the term *Test Case* for grouping
related tests, whereas current publications, including International Software
-Testing Qualifications Board ([ISTQB](http://www.istqb.org/)) materials and
+Testing Qualifications Board ([ISTQB](https://www.istqb.org/)) materials and
various textbooks on software quality, use the term
*[Test Suite][istqb test suite]* for this.
@@ -68,13 +68,13 @@ deprecated and refactored away.
So please be aware of the different definitions of the terms:
-Meaning | GoogleTest Term | [ISTQB](http://www.istqb.org/) Term
+Meaning | GoogleTest Term | [ISTQB](https://www.istqb.org/) Term
:----------------------------------------------------------------------------------- | :---------------------- | :----------------------------------
Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case][istqb test case]
-[istqb test case]: http://glossary.istqb.org/en/search/test%20case
-[istqb test suite]: http://glossary.istqb.org/en/search/test%20suite
+[istqb test case]: https://glossary.istqb.org/en_US/term/test-case-2
+[istqb test suite]: https://glossary.istqb.org/en_US/term/test-suite-1-3
## Basic Concepts
@@ -210,7 +210,7 @@ objects for several different tests.
To create a fixture:
-1. Derive a class from `::testing::Test` . Start its body with `protected:`, as
+1. Derive a class from `testing::Test` . Start its body with `protected:`, as
we'll want to access fixture members from sub-classes.
2. Inside the class, declare any objects you plan to use.
3. If necessary, write a default constructor or `SetUp()` function to prepare
@@ -271,7 +271,7 @@ First, define a fixture class. By convention, you should give it the name
`FooTest` where `Foo` is the class being tested.
```c++
-class QueueTest : public ::testing::Test {
+class QueueTest : public testing::Test {
protected:
void SetUp() override {
// q0_ remains empty
@@ -402,7 +402,7 @@ namespace project {
namespace {
// The fixture for testing class Foo.
-class FooTest : public ::testing::Test {
+class FooTest : public testing::Test {
protected:
// You can remove any or all of the following functions if their bodies would
// be empty.
@@ -450,14 +450,14 @@ TEST_F(FooTest, DoesXyz) {
} // namespace my
int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
+ testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
```
-The `::testing::InitGoogleTest()` function parses the command line for
-GoogleTest flags, and removes all recognized flags. This allows the user to
-control a test program's behavior via various flags, which we'll cover in the
+The `testing::InitGoogleTest()` function parses the command line for GoogleTest
+flags, and removes all recognized flags. This allows the user to control a test
+program's behavior via various flags, which we'll cover in the
[AdvancedGuide](advanced.md). You **must** call this function before calling
`RUN_ALL_TESTS()`, or the flags won't be properly initialized.
diff --git a/src/aspnetcore/src/submodules/googletest/docs/reference/mocking.md b/src/aspnetcore/src/submodules/googletest/docs/reference/mocking.md
index ab37ebf3623..3ad49527c64 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/reference/mocking.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/reference/mocking.md
@@ -81,8 +81,8 @@ EXPECT_CALL(mock_object, method_name(matchers...))
.Times(cardinality) // Can be used at most once
.InSequence(sequences...) // Can be used any number of times
.After(expectations...) // Can be used any number of times
- .WillOnce(action) // Can be used any number of times
- .WillRepeatedly(action) // Can be used at most once
+ .WillRepeatedly(action) // Can be used any number of times
+ .WillOnce(action) // Can be used at most once
.RetiresOnSaturation(); // Can be used at most once
```
diff --git a/src/aspnetcore/src/submodules/googletest/docs/reference/testing.md b/src/aspnetcore/src/submodules/googletest/docs/reference/testing.md
index ead66b36264..81640fd49eb 100644
--- a/src/aspnetcore/src/submodules/googletest/docs/reference/testing.md
+++ b/src/aspnetcore/src/submodules/googletest/docs/reference/testing.md
@@ -1317,7 +1317,9 @@ tests.
Initializes GoogleTest. This must be called before calling
[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS). In particular, it parses the command line
for the flags that GoogleTest recognizes. Whenever a GoogleTest flag is seen, it
-is removed from `argv`, and `*argc` is decremented.
+is removed from `argv`, and `*argc` is decremented. Keep in mind that `argv`
+must terminate with a `NULL` pointer (i.e. `argv[argc]` is `NULL`), which is
+already the case with the default `argv` passed to `main`.
No value is returned. Instead, the GoogleTest flag variables are updated.
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/CMakeLists.txt b/src/aspnetcore/src/submodules/googletest/googlemock/CMakeLists.txt
index a9aa0723fbf..428bd9f8ea1 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/CMakeLists.txt
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/CMakeLists.txt
@@ -5,7 +5,7 @@
# CMake build script for Google Mock.
#
# To run the tests for Google Mock itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
+# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.
option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
@@ -44,7 +44,7 @@ if (COMMAND set_up_hermetic_build)
endif()
# Instructs CMake to process Google Test's CMakeLists.txt and add its
-# targets to the current scope. We are placing Google Test's binary
+# targets to the current scope. We are placing Google Test's binary
# directory in a subdirectory of our own as VC compilation may break
# if they are the same (the default).
add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}")
@@ -60,9 +60,9 @@ else()
endif()
# Although Google Test's CMakeLists.txt calls this function, the
-# changes there don't affect the current scope. Therefore we have to
+# changes there don't affect the current scope. Therefore we have to
# call it again here.
-config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
+config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
# Adds Google Mock's and Google Test's header directories to the search path.
set(gmock_build_include_dirs
@@ -75,10 +75,10 @@ include_directories(${gmock_build_include_dirs})
########################################################################
#
-# Defines the gmock & gmock_main libraries. User tests should link
+# Defines the gmock & gmock_main libraries. User tests should link
# with one of them.
-# Google Mock libraries. We build them using more strict warnings than what
+# Google Mock libraries. We build them using more strict warnings than what
# are used for other targets, to ensure that Google Mock can be compiled by
# a user aggressive about warnings.
if (MSVC)
@@ -111,7 +111,7 @@ target_include_directories(gmock_main SYSTEM INTERFACE
########################################################################
#
-# Install rules
+# Install rules.
install_project(gmock gmock_main)
########################################################################
@@ -121,8 +121,8 @@ install_project(gmock gmock_main)
# You can skip this section if you aren't interested in testing
# Google Mock itself.
#
-# The tests are not built by default. To build them, set the
-# gmock_build_tests option to ON. You can do it by running ccmake
+# The tests are not built by default. To build them, set the
+# gmock_build_tests option to ON. You can do it by running ccmake
# or specifying the -Dgmock_build_tests=ON flag when running cmake.
if (gmock_build_tests)
@@ -187,7 +187,7 @@ if (gmock_build_tests)
cxx_shared_library(shared_gmock_main "${cxx_default}"
"${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
- # Tests that a binary can be built with Google Mock as a shared library. On
+ # Tests that a binary can be built with Google Mock as a shared library. On
# some system configurations, it may not possible to run the binary without
# knowing more details about the system configurations. We do not try to run
# this binary. To get a more robust shared library coverage, configure with
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/README.md b/src/aspnetcore/src/submodules/googletest/googlemock/README.md
index 7da60655dba..e1103b16bbf 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/README.md
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/README.md
@@ -8,8 +8,8 @@ derive better designs of your system and write better tests.
It is inspired by:
* [jMock](http://www.jmock.org/)
-* [EasyMock](http://www.easymock.org/)
-* [Hamcrest](http://code.google.com/p/hamcrest/)
+* [EasyMock](https://easymock.org/)
+* [Hamcrest](https://code.google.com/p/hamcrest/)
It is designed with C++'s specifics in mind.
@@ -36,5 +36,5 @@ Details and examples can be found here:
* [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html)
GoogleMock is a part of
-[GoogleTest C++ testing framework](http://github.com/google/googletest/) and a
+[GoogleTest C++ testing framework](https://github.com/google/googletest/) and a
subject to the same requirements.
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-actions.h b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-actions.h
index f20258bca4e..fab9993384b 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-actions.h
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-actions.h
@@ -135,6 +135,7 @@
#endif
#include
+#include
#include
#include
#include
@@ -1746,6 +1747,13 @@ struct ThrowAction {
return [copy](Args...) -> R { throw copy; };
}
};
+struct RethrowAction {
+ std::exception_ptr exception;
+ template
+ operator Action() const { // NOLINT
+ return [ex = exception](Args...) -> R { std::rethrow_exception(ex); };
+ }
+};
#endif // GTEST_HAS_EXCEPTIONS
} // namespace internal
@@ -2062,13 +2070,23 @@ internal::ReturnPointeeAction ReturnPointee(Ptr pointer) {
return {pointer};
}
-// Action Throw(exception) can be used in a mock function of any type
-// to throw the given exception. Any copyable value can be thrown.
#if GTEST_HAS_EXCEPTIONS
+// Action Throw(exception) can be used in a mock function of any type
+// to throw the given exception. Any copyable value can be thrown,
+// except for std::exception_ptr, which is likely a mistake if
+// thrown directly.
template
-internal::ThrowAction::type> Throw(T&& exception) {
+typename std::enable_if<
+ !std::is_base_of::type>::value,
+ internal::ThrowAction::type>>::type
+Throw(T&& exception) {
return {std::forward(exception)};
}
+// Action Rethrow(exception_ptr) can be used in a mock function of any type
+// to rethrow any exception_ptr. Note that the same object is thrown each time.
+inline internal::RethrowAction Rethrow(std::exception_ptr exception) {
+ return {std::move(exception)};
+}
#endif // GTEST_HAS_EXCEPTIONS
namespace internal {
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-function-mocker.h b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-function-mocker.h
index 1a1f126e492..d2cb13cd834 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-function-mocker.h
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-function-mocker.h
@@ -37,6 +37,7 @@
#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_
#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_FUNCTION_MOCKER_H_
+#include
#include // IWYU pragma: keep
#include // IWYU pragma: keep
@@ -69,22 +70,22 @@ constexpr bool PrefixOf(const char* a, const char* b) {
return *a == 0 || (*a == *b && internal::PrefixOf(a + 1, b + 1));
}
-template
+template
constexpr bool StartsWith(const char (&prefix)[N], const char (&str)[M]) {
return N <= M && internal::PrefixOf(prefix, str);
}
-template
+template
constexpr bool EndsWith(const char (&suffix)[N], const char (&str)[M]) {
return N <= M && internal::PrefixOf(suffix, str + M - N);
}
-template
+template
constexpr bool Equals(const char (&a)[N], const char (&b)[M]) {
return N == M && internal::PrefixOf(a, b);
}
-template
+template
constexpr bool ValidateSpec(const char (&spec)[N]) {
return internal::Equals("const", spec) ||
internal::Equals("override", spec) ||
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-matchers.h b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-matchers.h
index 0f67713776a..8052c74a1dc 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-matchers.h
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-matchers.h
@@ -1048,7 +1048,7 @@ class StartsWithMatcher {
template
bool MatchAndExplain(const MatcheeStringType& s,
MatchResultListener* /* listener */) const {
- const StringType& s2(s);
+ const StringType s2(s);
return s2.length() >= prefix_.length() &&
s2.substr(0, prefix_.length()) == prefix_;
}
@@ -1102,7 +1102,7 @@ class EndsWithMatcher {
template
bool MatchAndExplain(const MatcheeStringType& s,
MatchResultListener* /* listener */) const {
- const StringType& s2(s);
+ const StringType s2(s);
return s2.length() >= suffix_.length() &&
s2.substr(s2.length() - suffix_.length()) == suffix_;
}
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-more-actions.h b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-more-actions.h
index 40300766f08..dd90e31fa1a 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-more-actions.h
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock-more-actions.h
@@ -606,7 +606,7 @@ struct InvokeArgumentAction {
internal::FlatTuple args_tuple(FlatTupleConstructTag{},
std::forward(args)...);
return params.Apply([&](const Params &...unpacked_params) {
- auto &&callable = args_tuple.template Get();
+ auto &&callable = std::move(args_tuple.template Get());
return internal::InvokeArgument(
std::forward(callable), unpacked_params...);
});
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock.h b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock.h
index 568c8c71d78..c78fb8ee597 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock.h
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/include/gmock/gmock.h
@@ -53,13 +53,14 @@
//
// where all clauses are optional and WillOnce() can be repeated.
-#include "gmock/gmock-actions.h"
-#include "gmock/gmock-cardinalities.h"
-#include "gmock/gmock-function-mocker.h"
-#include "gmock/gmock-matchers.h"
-#include "gmock/gmock-more-actions.h"
-#include "gmock/gmock-more-matchers.h"
-#include "gmock/gmock-nice-strict.h"
+#include "gmock/gmock-actions.h" // IWYU pragma: export
+#include "gmock/gmock-cardinalities.h" // IWYU pragma: export
+#include "gmock/gmock-function-mocker.h" // IWYU pragma: export
+#include "gmock/gmock-matchers.h" // IWYU pragma: export
+#include "gmock/gmock-more-actions.h" // IWYU pragma: export
+#include "gmock/gmock-more-matchers.h" // IWYU pragma: export
+#include "gmock/gmock-nice-strict.h" // IWYU pragma: export
+#include "gmock/gmock-spec-builders.h" // IWYU pragma: export
#include "gmock/internal/gmock-internal-utils.h"
#include "gmock/internal/gmock-port.h"
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-matchers.cc b/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-matchers.cc
index 07bba4f0103..81a5b7ea5a0 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-matchers.cc
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-matchers.cc
@@ -120,7 +120,7 @@ GTEST_API_ std::string FormatMatcherDescription(
// [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
// "Introduction to Algorithms (Second ed.)", pp. 651-664.
// [2] "Ford-Fulkerson algorithm", Wikipedia,
-// 'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
+// 'https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
class MaxBipartiteMatchState {
public:
explicit MaxBipartiteMatchState(const MatchMatrix& graph)
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-spec-builders.cc b/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-spec-builders.cc
index de894716358..fb67ab09d40 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-spec-builders.cc
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/src/gmock-spec-builders.cc
@@ -490,6 +490,7 @@ class MockObjectRegistry {
// failure, unless the user explicitly asked us to ignore it.
~MockObjectRegistry() {
if (!GMOCK_FLAG_GET(catch_leaked_mocks)) return;
+ internal::MutexLock l(&internal::g_gmock_mutex);
int leaked_count = 0;
for (StateMap::const_iterator it = states_.begin(); it != states_.end();
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-matchers-comparisons_test.cc b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-matchers-comparisons_test.cc
index b2ce99e18d4..5b75b457be0 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-matchers-comparisons_test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-matchers-comparisons_test.cc
@@ -1769,6 +1769,15 @@ TEST(StartsWithTest, CanDescribeSelf) {
EXPECT_EQ("starts with \"Hi\"", Describe(m));
}
+TEST(StartsWithTest, WorksWithStringMatcherOnStringViewMatchee) {
+#if GTEST_INTERNAL_HAS_STRING_VIEW
+ EXPECT_THAT(internal::StringView("talk to me goose"),
+ StartsWith(std::string("talk")));
+#else
+ GTEST_SKIP() << "Not applicable without internal::StringView.";
+#endif // GTEST_INTERNAL_HAS_STRING_VIEW
+}
+
// Tests EndsWith(s).
TEST(EndsWithTest, MatchesStringWithGivenSuffix) {
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-more-actions_test.cc b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-more-actions_test.cc
index 9980f3bc456..16af6892855 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-more-actions_test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-more-actions_test.cc
@@ -85,6 +85,12 @@ struct UnaryFunctor {
int operator()(bool x) { return x ? 1 : -1; }
};
+struct UnaryMoveOnlyFunctor : UnaryFunctor {
+ UnaryMoveOnlyFunctor() = default;
+ UnaryMoveOnlyFunctor(const UnaryMoveOnlyFunctor&) = delete;
+ UnaryMoveOnlyFunctor(UnaryMoveOnlyFunctor&&) = default;
+};
+
const char* Binary(const char* input, short n) { return input + n; } // NOLINT
int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
@@ -698,12 +704,18 @@ TEST(InvokeArgumentTest, Function0) {
EXPECT_EQ(1, a.Perform(std::make_tuple(2, &Nullary)));
}
-// Tests using InvokeArgument with a unary function.
+// Tests using InvokeArgument with a unary functor.
TEST(InvokeArgumentTest, Functor1) {
Action a = InvokeArgument<0>(true); // NOLINT
EXPECT_EQ(1, a.Perform(std::make_tuple(UnaryFunctor())));
}
+// Tests using InvokeArgument with a unary move-only functor.
+TEST(InvokeArgumentTest, Functor1MoveOnly) {
+ Action a = InvokeArgument<0>(true); // NOLINT
+ EXPECT_EQ(1, a.Perform(std::make_tuple(UnaryMoveOnlyFunctor())));
+}
+
// Tests using InvokeArgument with a 5-ary function.
TEST(InvokeArgumentTest, Function5) {
Action a = // NOLINT
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-spec-builders_test.cc b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-spec-builders_test.cc
index 221de2d20b3..aaf88d74ee7 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-spec-builders_test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock-spec-builders_test.cc
@@ -906,7 +906,7 @@ TEST(ExpectCallTest, TakesDefaultActionWhenWillListIsExhausted) {
" - returning default value."));
}
-TEST(FunctionMockerMessageTest, ReportsExpectCallLocationForExhausedActions) {
+TEST(FunctionMockerMessageTest, ReportsExpectCallLocationForExhaustedActions) {
MockB b;
std::string expect_call_location = FormatFileLocation(__FILE__, __LINE__ + 1);
EXPECT_CALL(b, DoB()).Times(AnyNumber()).WillOnce(Return(1));
diff --git a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock_link_test.h b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock_link_test.h
index db11c2d24d1..cf0a985b632 100644
--- a/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock_link_test.h
+++ b/src/aspnetcore/src/submodules/googletest/googlemock/test/gmock_link_test.h
@@ -187,6 +187,7 @@ using testing::SetErrnoAndReturn;
#if GTEST_HAS_EXCEPTIONS
using testing::Throw;
+using testing::Rethrow;
#endif
using testing::ContainsRegex;
@@ -416,6 +417,14 @@ TEST(LinkTest, TestThrow) {
EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
EXPECT_THROW(mock.VoidFromString(nullptr), int);
}
+// Tests the linkage of the Rethrow action.
+TEST(LinkTest, TestRethrow) {
+ Mock mock;
+
+ EXPECT_CALL(mock, VoidFromString(_))
+ .WillOnce(Rethrow(std::make_exception_ptr(42)));
+ EXPECT_THROW(mock.VoidFromString(nullptr), int);
+}
#endif // GTEST_HAS_EXCEPTIONS
// The ACTION*() macros trigger warning C4100 (unreferenced formal
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/CMakeLists.txt b/src/aspnetcore/src/submodules/googletest/googletest/CMakeLists.txt
index caafa8c7685..dce6a7c9ee6 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/CMakeLists.txt
+++ b/src/aspnetcore/src/submodules/googletest/googletest/CMakeLists.txt
@@ -5,7 +5,7 @@
# CMake build script for Google Test.
#
# To run the tests for Google Test itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
+# ctest. You can select which tests to run using 'ctest -R regex'.
# For more options, run 'ctest --help'.
# When other libraries are using a shared version of runtime libraries,
@@ -35,7 +35,7 @@ endif()
########################################################################
#
-# Project-wide settings
+# Project-wide settings.
# Name of the project.
#
@@ -44,7 +44,7 @@ endif()
# ${gtest_BINARY_DIR}.
# Language "C" is required for find_package(Threads).
-# Project version:
+# Project version.
cmake_minimum_required(VERSION 3.13)
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
@@ -53,7 +53,7 @@ if (COMMAND set_up_hermetic_build)
set_up_hermetic_build()
endif()
-# These commands only run if this is the main project
+# These commands only run if this is the main project.
if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
@@ -83,7 +83,7 @@ include(cmake/internal_utils.cmake)
config_compiler_and_linker() # Defined in internal_utils.cmake.
# Needed to set the namespace for both the export targets and the
-# alias libraries
+# alias libraries.
set(cmake_package_name GTest CACHE INTERNAL "")
# Create the CMake package file descriptors.
@@ -114,10 +114,10 @@ include_directories(${gtest_build_include_dirs})
########################################################################
#
-# Defines the gtest & gtest_main libraries. User tests should link
+# Defines the gtest & gtest_main libraries. User tests should link
# with one of them.
-# Google Test libraries. We build them using more strict warnings than what
+# Google Test libraries. We build them using more strict warnings than what
# are used for other targets, to ensure that gtest can be compiled by a user
# aggressive about warnings.
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
@@ -147,22 +147,22 @@ target_include_directories(gtest SYSTEM INTERFACE
target_include_directories(gtest_main SYSTEM INTERFACE
"$"
"$/${CMAKE_INSTALL_INCLUDEDIR}>")
-if(CMAKE_SYSTEM_NAME MATCHES "QNX")
+if(CMAKE_SYSTEM_NAME MATCHES "QNX" AND CMAKE_SYSTEM_VERSION VERSION_GREATER_EQUAL 7.1)
target_link_libraries(gtest PUBLIC regex)
endif()
target_link_libraries(gtest_main PUBLIC gtest)
########################################################################
#
-# Install rules
+# Install rules.
install_project(gtest gtest_main)
########################################################################
#
# Samples on how to link user tests with gtest or gtest_main.
#
-# They are not built by default. To build them, set the
-# gtest_build_samples option to ON. You can do it by running ccmake
+# They are not built by default. To build them, set the
+# gtest_build_samples option to ON. You can do it by running ccmake
# or specifying the -Dgtest_build_samples=ON flag when running cmake.
if (gtest_build_samples)
@@ -185,8 +185,8 @@ endif()
# You can skip this section if you aren't interested in testing
# Google Test itself.
#
-# The tests are not built by default. To build them, set the
-# gtest_build_tests option to ON. You can do it by running ccmake
+# The tests are not built by default. To build them, set the
+# gtest_build_tests option to ON. You can do it by running ccmake
# or specifying the -Dgtest_build_tests=ON flag when running cmake.
if (gtest_build_tests)
@@ -268,7 +268,7 @@ if (gtest_build_tests)
py_test(gtest_skip_environment_check_output_test)
# Visual Studio .NET 2003 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
+ if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
cxx_executable_with_flags(
googletest-catch-exceptions-no-ex-test_
"${cxx_no_exception}"
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/README.md b/src/aspnetcore/src/submodules/googletest/googletest/README.md
index 9331fce3b8c..44fd69b4892 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/README.md
+++ b/src/aspnetcore/src/submodules/googletest/googletest/README.md
@@ -12,7 +12,7 @@ GoogleTest comes with a CMake build script
([CMakeLists.txt](https://github.com/google/googletest/blob/main/CMakeLists.txt))
that can be used on a wide range of platforms ("C" stands for cross-platform.).
If you don't have CMake installed already, you can download it for free from
-.
+.
CMake works by generating native makefiles or build projects that can be used in
the compiler environment of your choice. You can either build GoogleTest as a
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/cmake/Config.cmake.in b/src/aspnetcore/src/submodules/googletest/googletest/cmake/Config.cmake.in
index 12be4498b1a..3f706612b24 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/cmake/Config.cmake.in
+++ b/src/aspnetcore/src/submodules/googletest/googletest/cmake/Config.cmake.in
@@ -4,6 +4,10 @@ if (@GTEST_HAS_PTHREAD@)
set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@)
find_dependency(Threads)
endif()
+if (@GTEST_HAS_ABSL@)
+ find_dependency(absl)
+ find_dependency(re2)
+endif()
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("@project_name@")
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/cmake/internal_utils.cmake b/src/aspnetcore/src/submodules/googletest/googletest/cmake/internal_utils.cmake
index 64fa340fd9e..580ac1cbc38 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/cmake/internal_utils.cmake
+++ b/src/aspnetcore/src/submodules/googletest/googletest/cmake/internal_utils.cmake
@@ -29,7 +29,7 @@ macro(fix_default_compiler_settings_)
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
# When Google Test is built as a shared library, it should also use
- # shared runtime libraries. Otherwise, it may end up with multiple
+ # shared runtime libraries. Otherwise, it may end up with multiple
# copies of runtime library data in different modules, resulting in
# hard-to-find crashes. When it is built as a static library, it is
# preferable to use CRT as static libraries, as we don't have to rely
@@ -55,11 +55,11 @@ macro(fix_default_compiler_settings_)
endmacro()
# Defines the compiler/linker flags used to build Google Test and
-# Google Mock. You can tweak these definitions to suit your need. A
+# Google Mock. You can tweak these definitions to suit your need. A
# variable's value is empty before it's explicitly assigned to.
macro(config_compiler_and_linker)
# Note: pthreads on MinGW is not supported, even if available
- # instead, we use windows threading primitives
+ # instead, we use windows threading primitives.
unset(GTEST_HAS_PTHREAD)
if (NOT gtest_disable_pthreads AND NOT MINGW)
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
@@ -79,8 +79,8 @@ macro(config_compiler_and_linker)
set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
set(cxx_no_exception_flags "-EHs-c- -D_HAS_EXCEPTIONS=0")
set(cxx_no_rtti_flags "-GR-")
- # Suppress "unreachable code" warning
- # http://stackoverflow.com/questions/3232669 explains the issue.
+ # Suppress "unreachable code" warning,
+ # https://stackoverflow.com/questions/3232669 explains the issue.
set(cxx_base_flags "${cxx_base_flags} -wd4702")
# Ensure MSVC treats source files as UTF-8 encoded.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
@@ -110,7 +110,7 @@ macro(config_compiler_and_linker)
set(cxx_exception_flags "-fexceptions")
set(cxx_no_exception_flags "-fno-exceptions")
# Until version 4.3.2, GCC doesn't define a macro to indicate
- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
+ # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
# explicitly.
set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
set(cxx_strict_flags
@@ -127,7 +127,7 @@ macro(config_compiler_and_linker)
set(cxx_exception_flags "-qeh")
set(cxx_no_exception_flags "-qnoeh")
# Until version 9.0, Visual Age doesn't define a macro to indicate
- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
+ # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
# explicitly.
set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
@@ -157,7 +157,7 @@ macro(config_compiler_and_linker)
set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
endmacro()
-# Defines the gtest & gtest_main libraries. User tests should link
+# Defines the gtest & gtest_main libraries. User tests should link
# with one of them.
function(cxx_library_with_type name type cxx_flags)
# type can be either STATIC or SHARED to denote a static or shared library.
@@ -167,7 +167,7 @@ function(cxx_library_with_type name type cxx_flags)
set_target_properties(${name}
PROPERTIES
COMPILE_FLAGS "${cxx_flags}")
- # Set the output directory for build artifacts
+ # Set the output directory for build artifacts.
set_target_properties(${name}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
@@ -175,7 +175,7 @@ function(cxx_library_with_type name type cxx_flags)
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
COMPILE_PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
- # make PDBs match library name
+ # Make PDBs match library name.
get_target_property(pdb_debug_postfix ${name} DEBUG_POSTFIX)
set_target_properties(${name}
PROPERTIES
@@ -212,7 +212,7 @@ endfunction()
# cxx_executable_with_flags(name cxx_flags libs srcs...)
#
-# creates a named C++ executable that depends on the given libraries and
+# Creates a named C++ executable that depends on the given libraries and
# is built from the given source files with the given compiler flags.
function(cxx_executable_with_flags name cxx_flags libs)
add_executable(${name} ${ARGN})
@@ -239,19 +239,21 @@ endfunction()
# cxx_executable(name dir lib srcs...)
#
-# creates a named target that depends on the given libs and is built
-# from the given source files. dir/name.cc is implicitly included in
+# Creates a named target that depends on the given libs and is built
+# from the given source files. dir/name.cc is implicitly included in
# the source file list.
function(cxx_executable name dir libs)
cxx_executable_with_flags(
${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})
endfunction()
-find_package(Python3)
+if(gtest_build_tests)
+ find_package(Python3)
+endif()
# cxx_test_with_flags(name cxx_flags libs srcs...)
#
-# creates a named C++ test that depends on the given libs and is built
+# Creates a named C++ test that depends on the given libs and is built
# from the given source files with the given compiler flags.
function(cxx_test_with_flags name cxx_flags libs)
cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
@@ -260,8 +262,8 @@ endfunction()
# cxx_test(name libs srcs...)
#
-# creates a named test target that depends on the given libs and is
-# built from the given source files. Unlike cxx_test_with_flags,
+# Creates a named test target that depends on the given libs and is
+# built from the given source files. Unlike cxx_test_with_flags,
# test/name.cc is already implicitly included in the source file list.
function(cxx_test name libs)
cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
@@ -270,8 +272,8 @@ endfunction()
# py_test(name)
#
-# creates a Python test with the given name whose main module is in
-# test/name.py. It does nothing if Python is not installed.
+# Creates a Python test with the given name whose main module is in
+# test/name.py. It does nothing if Python is not installed.
function(py_test name)
if (NOT Python3_Interpreter_FOUND)
return()
@@ -307,7 +309,7 @@ function(install_project)
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- # Install PDBs
+ # Install PDBs.
foreach(t ${ARGN})
get_target_property(t_pdb_name ${t} COMPILE_PDB_NAME)
get_target_property(t_pdb_name_debug ${t} COMPILE_PDB_NAME_DEBUG)
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-message.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-message.h
index 59b805e4e46..448ac6b7ee2 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-message.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-message.h
@@ -59,7 +59,7 @@
#ifdef GTEST_HAS_ABSL
#include
-#include "absl/strings/internal/has_absl_stringify.h"
+#include "absl/strings/has_absl_stringify.h"
#include "absl/strings/str_cat.h"
#endif // GTEST_HAS_ABSL
@@ -121,14 +121,14 @@ class GTEST_API_ Message {
// Streams a non-pointer value to this object. If building a version of
// GoogleTest with ABSL, this overload is only enabled if the value does not
// have an AbslStringify definition.
- template ::value, // NOLINT
- int>::type = 0
+ ,
+ typename std::enable_if::value, // NOLINT
+ int>::type = 0
#endif // GTEST_HAS_ABSL
- >
+ >
inline Message& operator<<(const T& val) {
// Some libraries overload << for STL containers. These
// overloads are defined in the global namespace instead of ::std.
@@ -153,9 +153,8 @@ class GTEST_API_ Message {
// Streams a non-pointer value with an AbslStringify definition to this
// object.
template ::value, // NOLINT
- int>::type = 0>
+ typename std::enable_if::value, // NOLINT
+ int>::type = 0>
inline Message& operator<<(const T& val) {
// ::operator<< is needed here for a similar reason as with the non-Abseil
// version above
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-printers.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-printers.h
index d1766e640f2..b2822bcde23 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-printers.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest-printers.h
@@ -116,12 +116,16 @@
#include
#ifdef GTEST_HAS_ABSL
-#include "absl/strings/internal/has_absl_stringify.h"
+#include "absl/strings/has_absl_stringify.h"
#include "absl/strings/str_cat.h"
#endif // GTEST_HAS_ABSL
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-port.h"
+#if GTEST_INTERNAL_HAS_STD_SPAN
+#include // NOLINT
+#endif // GTEST_INTERNAL_HAS_STD_SPAN
+
namespace testing {
// Definitions in the internal* namespaces are subject to change without notice.
@@ -131,13 +135,32 @@ namespace internal {
template
void UniversalPrint(const T& value, ::std::ostream* os);
+template
+struct IsStdSpan {
+ static constexpr bool value = false;
+};
+
+#if GTEST_INTERNAL_HAS_STD_SPAN
+template
+struct IsStdSpan> {
+ static constexpr bool value = true;
+};
+#endif // GTEST_INTERNAL_HAS_STD_SPAN
+
// Used to print an STL-style container when the user doesn't define
// a PrintTo() for it.
+//
+// NOTE: Since std::span does not have const_iterator until C++23, it would
+// fail IsContainerTest before C++23. However, IsContainerTest only uses
+// the presence of const_iterator to avoid treating iterators as containers
+// because of iterator::iterator. Which means std::span satisfies the *intended*
+// condition of IsContainerTest.
struct ContainerPrinter {
template (0)) == sizeof(IsContainer)) &&
- !IsRecursiveContainer::value>::type>
+ ((sizeof(IsContainerTest(0)) == sizeof(IsContainer)) &&
+ !IsRecursiveContainer::value) ||
+ IsStdSpan::value>::type>
static void PrintValue(const T& container, std::ostream* os) {
const size_t kMaxCount = 32; // The maximum number of elements to print.
*os << '{';
@@ -218,8 +241,8 @@ struct StreamPrinter {
// ADL (possibly involving implicit conversions).
// (Use SFINAE via return type, because it seems GCC < 12 doesn't handle name
// lookup properly when we do it in the template parameter list.)
- static auto PrintValue(const T& value, ::std::ostream* os)
- -> decltype((void)(*os << value)) {
+ static auto PrintValue(const T& value,
+ ::std::ostream* os) -> decltype((void)(*os << value)) {
// Call streaming operator found by ADL, possibly with implicit conversions
// of the arguments.
*os << value;
@@ -269,10 +292,9 @@ struct ConvertibleToStringViewPrinter {
#ifdef GTEST_HAS_ABSL
struct ConvertibleToAbslStringifyPrinter {
- template <
- typename T,
- typename = typename std::enable_if<
- absl::strings_internal::HasAbslStringify::value>::type> // NOLINT
+ template ::value>::type> // NOLINT
static void PrintValue(const T& value, ::std::ostream* os) {
*os << absl::StrCat(value);
}
@@ -530,49 +552,63 @@ int AppropriateResolution(FloatType val) {
int full = std::numeric_limits::max_digits10;
if (val < 0) val = -val;
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
if (val < 1000000) {
FloatType mulfor6 = 1e10;
- if (val >= 100000.0) { // 100,000 to 999,999
+ // Without these static casts, the template instantiation for float would
+ // fail to compile when -Wdouble-promotion is enabled, as the arithmetic and
+ // comparison logic would promote floats to doubles.
+ if (val >= static_cast(100000.0)) { // 100,000 to 999,999
mulfor6 = 1.0;
- } else if (val >= 10000.0) {
+ } else if (val >= static_cast(10000.0)) {
mulfor6 = 1e1;
- } else if (val >= 1000.0) {
+ } else if (val >= static_cast(1000.0)) {
mulfor6 = 1e2;
- } else if (val >= 100.0) {
+ } else if (val >= static_cast(100.0)) {
mulfor6 = 1e3;
- } else if (val >= 10.0) {
+ } else if (val >= static_cast(10.0)) {
mulfor6 = 1e4;
- } else if (val >= 1.0) {
+ } else if (val >= static_cast(1.0)) {
mulfor6 = 1e5;
- } else if (val >= 0.1) {
+ } else if (val >= static_cast(0.1)) {
mulfor6 = 1e6;
- } else if (val >= 0.01) {
+ } else if (val >= static_cast(0.01)) {
mulfor6 = 1e7;
- } else if (val >= 0.001) {
+ } else if (val >= static_cast(0.001)) {
mulfor6 = 1e8;
- } else if (val >= 0.0001) {
+ } else if (val >= static_cast(0.0001)) {
mulfor6 = 1e9;
}
- if (static_cast(static_cast(val * mulfor6 + 0.5)) /
+ if (static_cast(static_cast(
+ val * mulfor6 + (static_cast(0.5)))) /
mulfor6 ==
val)
return 6;
- } else if (val < 1e10) {
- FloatType divfor6 = 1.0;
- if (val >= 1e9) { // 1,000,000,000 to 9,999,999,999
+ } else if (val < static_cast(1e10)) {
+ FloatType divfor6 = static_cast(1.0);
+ if (val >= static_cast(1e9)) { // 1,000,000,000 to 9,999,999,999
divfor6 = 10000;
- } else if (val >= 1e8) { // 100,000,000 to 999,999,999
+ } else if (val >=
+ static_cast(1e8)) { // 100,000,000 to 999,999,999
divfor6 = 1000;
- } else if (val >= 1e7) { // 10,000,000 to 99,999,999
+ } else if (val >=
+ static_cast(1e7)) { // 10,000,000 to 99,999,999
divfor6 = 100;
- } else if (val >= 1e6) { // 1,000,000 to 9,999,999
+ } else if (val >= static_cast(1e6)) { // 1,000,000 to 9,999,999
divfor6 = 10;
}
- if (static_cast(static_cast(val / divfor6 + 0.5)) *
+ if (static_cast(static_cast(
+ val / divfor6 + (static_cast(0.5)))) *
divfor6 ==
val)
return 6;
}
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
return full;
}
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest.h
index a932e686af4..45400fd0b2c 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/gtest.h
@@ -1751,6 +1751,7 @@ class TestWithParam : public Test, public WithParamInterface {};
// generic name and clashes with some other libraries.
#if !(defined(GTEST_DONT_DEFINE_FAIL) && GTEST_DONT_DEFINE_FAIL)
#define FAIL() GTEST_FAIL()
+#define FAIL_AT(file, line) GTEST_FAIL_AT(file, line)
#endif
// Generates a success with a generic message.
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h
index 8e9c988b98c..61536d6572d 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h
@@ -52,9 +52,7 @@ GTEST_DECLARE_string_(internal_run_death_test);
namespace testing {
namespace internal {
-// Names of the flags (needed for parsing Google Test flags).
-const char kDeathTestStyleFlag[] = "death_test_style";
-const char kDeathTestUseFork[] = "death_test_use_fork";
+// Name of the flag (needed for parsing Google Test flag).
const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
#ifdef GTEST_HAS_DEATH_TEST
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-internal.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-internal.h
index 97a983393a3..806b08624cb 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-internal.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-internal.h
@@ -78,7 +78,7 @@
//
// will result in the token foo__LINE__, instead of foo followed by
// the current line number. For more details, see
-// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
+// https://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo##bar
@@ -169,7 +169,7 @@ namespace edit_distance {
// All edits cost the same, with replace having lower priority than
// add/remove.
// Simple implementation of the Wagner-Fischer algorithm.
-// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
+// See https://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
enum EditType { kMatch, kAdd, kRemove, kReplace };
GTEST_API_ std::vector CalculateOptimalEdits(
const std::vector& left, const std::vector& right);
@@ -236,7 +236,7 @@ GTEST_API_ std::string GetBoolAssertionFailureMessage(
// For double, there are 11 exponent bits and 52 fraction bits.
//
// More details can be found at
-// http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
+// https://en.wikipedia.org/wiki/IEEE_floating-point_standard.
//
// Template parameter:
//
@@ -281,7 +281,7 @@ class FloatingPoint {
// bits. Therefore, 4 should be enough for ordinary use.
//
// See the following article for more details on ULP:
- // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
+ // https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
static const uint32_t kMaxUlps = 4;
// Constructs a FloatingPoint from a raw floating-point number.
@@ -362,7 +362,7 @@ class FloatingPoint {
// N - 1 (the biggest number representable using
// sign-and-magnitude) is represented by 2N - 1.
//
- // Read http://en.wikipedia.org/wiki/Signed_number_representations
+ // Read https://en.wikipedia.org/wiki/Signed_number_representations
// for more details on signed number representations.
static Bits SignAndMagnitudeToBiased(const Bits& sam) {
if (kSignBitMask & sam) {
@@ -555,7 +555,7 @@ struct SuiteApiResolver : T {
// type_param: the name of the test's type parameter, or NULL if
// this is not a typed or a type-parameterized test.
// value_param: text representation of the test's value parameter,
-// or NULL if this is not a type-parameterized test.
+// or NULL if this is not a value-parameterized test.
// code_location: code location where the test is defined
// fixture_class_id: ID of the test fixture class
// set_up_tc: pointer to the function that sets up the test suite
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-param-util.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-param-util.h
index 6a81c37fa6a..b04f7020636 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-param-util.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-param-util.h
@@ -584,7 +584,9 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
GTEST_CHECK_(IsValidParamName(param_name))
<< "Parameterized test name '" << param_name
- << "' is invalid, in " << file << " line " << line << std::endl;
+ << "' is invalid (contains spaces, dashes, or any "
+ "non-alphanumeric characters other than underscores), in "
+ << file << " line " << line << "" << std::endl;
GTEST_CHECK_(test_param_names.count(param_name) == 0)
<< "Duplicate parameterized test name '" << param_name << "', in "
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-port.h b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-port.h
index b887e24edcd..fa457b7880e 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-port.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/include/gtest/internal/gtest-port.h
@@ -208,6 +208,8 @@
// or
// UniversalPrinter
// specializations. Always defined to 0 or 1.
+// GTEST_INTERNAL_HAS_STD_SPAN - for enabling UniversalPrinter
+// specializations. Always defined to 0 or 1
// GTEST_INTERNAL_HAS_STRING_VIEW - for enabling Matcher or
// Matcher
// specializations. Always defined to 0 or 1.
@@ -279,6 +281,22 @@
#error C++ versions less than C++14 are not supported.
#endif
+// MSVC >= 19.11 (VS 2017 Update 3) supports __has_include.
+#ifdef __has_include
+#define GTEST_INTERNAL_HAS_INCLUDE __has_include
+#else
+#define GTEST_INTERNAL_HAS_INCLUDE(...) 0
+#endif
+
+// Detect C++ feature test macros as gracefully as possible.
+// MSVC >= 19.15, Clang >= 3.4.1, and GCC >= 4.1.2 support feature test macros.
+#if GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L && \
+ (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE())
+#include // C++20 and later
+#elif (!defined(__has_include) || GTEST_INTERNAL_HAS_INCLUDE())
+#include // Pre-C++20
+#endif
+
#include // for isspace, etc
#include // for ptrdiff_t
#include
@@ -320,9 +338,10 @@
#define GTEST_HAS_NOTIFICATION_ 0
#endif
-#ifdef GTEST_HAS_ABSL
-#include "absl/flags/declare.h"
+#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS)
+#define GTEST_INTERNAL_HAS_ABSL_FLAGS // Used only in this file.
#include "absl/flags/flag.h"
+#include "absl/flags/declare.h"
#include "absl/flags/reflection.h"
#endif
@@ -609,7 +628,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// Determines whether clone(2) is supported.
// Usually it will only be available on Linux, excluding
// Linux on the Itanium architecture.
-// Also see http://linux.die.net/man/2/clone.
+// Also see https://linux.die.net/man/2/clone.
#ifndef GTEST_HAS_CLONE
// The user didn't tell us, so we need to figure it out.
@@ -827,9 +846,9 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#ifndef GTEST_API_
#ifdef _MSC_VER
-#if GTEST_LINKED_AS_SHARED_LIBRARY
+#if defined(GTEST_LINKED_AS_SHARED_LIBRARY) && GTEST_LINKED_AS_SHARED_LIBRARY
#define GTEST_API_ __declspec(dllimport)
-#elif GTEST_CREATE_SHARED_LIBRARY
+#elif defined(GTEST_CREATE_SHARED_LIBRARY) && GTEST_CREATE_SHARED_LIBRARY
#define GTEST_API_ __declspec(dllexport)
#endif
#elif GTEST_HAVE_ATTRIBUTE_(visibility)
@@ -1987,7 +2006,9 @@ inline std::string StripTrailingSpaces(std::string str) {
namespace posix {
// File system porting.
-#if GTEST_HAS_FILE_SYSTEM
+// Note: Not every I/O-related function is related to file systems, so don't
+// just disable all of them here. For example, fileno() and isatty(), etc. must
+// always be available in order to detect if a pipe points to a terminal.
#ifdef GTEST_OS_WINDOWS
typedef struct _stat StatStruct;
@@ -1998,27 +2019,32 @@ inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); }
// time and thus not defined there.
#else
inline int FileNo(FILE* file) { return _fileno(file); }
+#if GTEST_HAS_FILE_SYSTEM
inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
inline int RmDir(const char* dir) { return _rmdir(dir); }
inline bool IsDir(const StatStruct& st) { return (_S_IFDIR & st.st_mode) != 0; }
+#endif
#endif // GTEST_OS_WINDOWS_MOBILE
#elif defined(GTEST_OS_ESP8266)
typedef struct stat StatStruct;
inline int FileNo(FILE* file) { return fileno(file); }
+#if GTEST_HAS_FILE_SYSTEM
inline int Stat(const char* path, StatStruct* buf) {
// stat function not implemented on ESP8266
return 0;
}
inline int RmDir(const char* dir) { return rmdir(dir); }
inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
+#endif
#else
typedef struct stat StatStruct;
inline int FileNo(FILE* file) { return fileno(file); }
+#if GTEST_HAS_FILE_SYSTEM
inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
#ifdef GTEST_OS_QURT
// QuRT doesn't support any directory functions, including rmdir
@@ -2027,9 +2053,9 @@ inline int RmDir(const char*) { return 0; }
inline int RmDir(const char* dir) { return rmdir(dir); }
#endif
inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
+#endif
#endif // GTEST_OS_WINDOWS
-#endif // GTEST_HAS_FILE_SYSTEM
// Other functions with a different name on Windows.
@@ -2227,7 +2253,7 @@ using TimeInMillis = int64_t; // Represents time in milliseconds.
#endif // !defined(GTEST_FLAG)
// Pick a command line flags implementation.
-#ifdef GTEST_HAS_ABSL
+#ifdef GTEST_INTERNAL_HAS_ABSL_FLAGS
// Macros for defining flags.
#define GTEST_DEFINE_bool_(name, default_val, doc) \
@@ -2252,7 +2278,8 @@ using TimeInMillis = int64_t; // Represents time in milliseconds.
(void)(::absl::SetFlag(>EST_FLAG(name), value))
#define GTEST_USE_OWN_FLAGFILE_FLAG_ 0
-#else // GTEST_HAS_ABSL
+#undef GTEST_INTERNAL_HAS_ABSL_FLAGS
+#else // ndef GTEST_INTERNAL_HAS_ABSL_FLAGS
// Macros for defining flags.
#define GTEST_DEFINE_bool_(name, default_val, doc) \
@@ -2294,7 +2321,7 @@ using TimeInMillis = int64_t; // Represents time in milliseconds.
#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
#define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
-#endif // GTEST_HAS_ABSL
+#endif // GTEST_INTERNAL_HAS_ABSL_FLAGS
// Thread annotations
#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
@@ -2349,9 +2376,9 @@ using Any = ::absl::any;
} // namespace internal
} // namespace testing
#else
-#ifdef __has_include
-#if __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
- (!defined(_MSC_VER) || GTEST_HAS_RTTI)
+#if defined(__cpp_lib_any) || (GTEST_INTERNAL_HAS_INCLUDE() && \
+ GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L && \
+ (!defined(_MSC_VER) || GTEST_HAS_RTTI))
// Otherwise for C++17 and higher use std::any for UniversalPrinter<>
// specializations.
#define GTEST_INTERNAL_HAS_ANY 1
@@ -2363,8 +2390,7 @@ using Any = ::std::any;
} // namespace testing
// The case where absl is configured NOT to alias std::any is not
// supported.
-#endif // __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
-#endif // __has_include
+#endif // __cpp_lib_any
#endif // GTEST_HAS_ABSL
#ifndef GTEST_INTERNAL_HAS_ANY
@@ -2384,8 +2410,8 @@ inline ::absl::nullopt_t Nullopt() { return ::absl::nullopt; }
} // namespace internal
} // namespace testing
#else
-#ifdef __has_include
-#if __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
+#if defined(__cpp_lib_optional) || (GTEST_INTERNAL_HAS_INCLUDE() && \
+ GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L)
// Otherwise for C++17 and higher use std::optional for UniversalPrinter<>
// specializations.
#define GTEST_INTERNAL_HAS_OPTIONAL 1
@@ -2399,14 +2425,22 @@ inline ::std::nullopt_t Nullopt() { return ::std::nullopt; }
} // namespace testing
// The case where absl is configured NOT to alias std::optional is not
// supported.
-#endif // __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
-#endif // __has_include
+#endif // __cpp_lib_optional
#endif // GTEST_HAS_ABSL
#ifndef GTEST_INTERNAL_HAS_OPTIONAL
#define GTEST_INTERNAL_HAS_OPTIONAL 0
#endif
+#if defined(__cpp_lib_span) || (GTEST_INTERNAL_HAS_INCLUDE() && \
+ GTEST_INTERNAL_CPLUSPLUS_LANG >= 202002L)
+#define GTEST_INTERNAL_HAS_STD_SPAN 1
+#endif // __cpp_lib_span
+
+#ifndef GTEST_INTERNAL_HAS_STD_SPAN
+#define GTEST_INTERNAL_HAS_STD_SPAN 0
+#endif
+
#ifdef GTEST_HAS_ABSL
// Always use absl::string_view for Matcher<> specializations if googletest
// is built with absl support.
@@ -2418,8 +2452,9 @@ using StringView = ::absl::string_view;
} // namespace internal
} // namespace testing
#else
-#ifdef __has_include
-#if __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
+#if defined(__cpp_lib_string_view) || \
+ (GTEST_INTERNAL_HAS_INCLUDE() && \
+ GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L)
// Otherwise for C++17 and higher use std::string_view for Matcher<>
// specializations.
#define GTEST_INTERNAL_HAS_STRING_VIEW 1
@@ -2431,9 +2466,7 @@ using StringView = ::std::string_view;
} // namespace testing
// The case where absl is configured NOT to alias std::string_view is not
// supported.
-#endif // __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >=
- // 201703L
-#endif // __has_include
+#endif // __cpp_lib_string_view
#endif // GTEST_HAS_ABSL
#ifndef GTEST_INTERNAL_HAS_STRING_VIEW
@@ -2452,8 +2485,8 @@ using Variant = ::absl::variant;
} // namespace internal
} // namespace testing
#else
-#ifdef __has_include
-#if __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
+#if defined(__cpp_lib_variant) || (GTEST_INTERNAL_HAS_INCLUDE() && \
+ GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L)
// Otherwise for C++17 and higher use std::variant for UniversalPrinter<>
// specializations.
#define GTEST_INTERNAL_HAS_VARIANT 1
@@ -2465,16 +2498,16 @@ using Variant = ::std::variant;
} // namespace internal
} // namespace testing
// The case where absl is configured NOT to alias std::variant is not supported.
-#endif // __has_include() && GTEST_INTERNAL_CPLUSPLUS_LANG >= 201703L
-#endif // __has_include
+#endif // __cpp_lib_variant
#endif // GTEST_HAS_ABSL
#ifndef GTEST_INTERNAL_HAS_VARIANT
#define GTEST_INTERNAL_HAS_VARIANT 0
#endif
-#if defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \
- GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L
+#if (defined(__cpp_constexpr) && !defined(__cpp_inline_variables)) || \
+ (defined(GTEST_INTERNAL_CPLUSPLUS_LANG) && \
+ GTEST_INTERNAL_CPLUSPLUS_LANG < 201703L)
#define GTEST_INTERNAL_NEED_REDUNDANT_CONSTEXPR_DECL 1
#endif
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-death-test.cc b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-death-test.cc
index 0eb6e38b2a9..8417a300f7c 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-death-test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-death-test.cc
@@ -783,7 +783,7 @@ DeathTest::TestRole WindowsDeathTest::AssumeRole() {
StreamableToString(static_cast(::GetCurrentProcessId())) +
// size_t has the same width as pointers on both 32-bit and 64-bit
// Windows platforms.
- // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
+ // See https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
"|" + StreamableToString(reinterpret_cast(write_handle)) + "|" +
StreamableToString(reinterpret_cast(event_handle_.Get()));
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-filepath.cc b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-filepath.cc
index 513e947f570..902d8c7f64b 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-filepath.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-filepath.cc
@@ -336,7 +336,7 @@ bool FilePath::CreateDirectoriesRecursively() const {
return false;
}
- if (pathname_.length() == 0 || this->DirectoryExists()) {
+ if (pathname_.empty() || this->DirectoryExists()) {
return true;
}
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-internal-inl.h b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-internal-inl.h
index 5b7fcbd0650..4799a1e7ba5 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-internal-inl.h
+++ b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-internal-inl.h
@@ -312,7 +312,7 @@ void ShuffleRange(internal::Random* random, int begin, int end,
<< begin << ", " << size << "].";
// Fisher-Yates shuffle, from
- // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
+ // https://en.wikipedia.org/wiki/Fisher-Yates_shuffle
for (int range_width = end - begin; range_width >= 2; range_width--) {
const int last_in_range = begin + range_width - 1;
const int selected =
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-port.cc b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-port.cc
index 2aaf2bcc26c..3bb7dd45081 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-port.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest-port.cc
@@ -158,13 +158,13 @@ size_t GetThreadCount() {
// we cannot detect it.
size_t GetThreadCount() {
int mib[] = {
- CTL_KERN,
- KERN_PROC,
- KERN_PROC_PID,
- getpid(),
+ CTL_KERN,
+ KERN_PROC,
+ KERN_PROC_PID,
+ getpid(),
#ifdef GTEST_OS_NETBSD
- sizeof(struct kinfo_proc),
- 1,
+ sizeof(struct kinfo_proc),
+ 1,
#endif
};
u_int miblen = sizeof(mib) / sizeof(mib[0]);
@@ -697,13 +697,24 @@ bool RE::PartialMatch(const char* str, const RE& re) {
void RE::Init(const char* regex) {
pattern_ = regex;
+ // NetBSD (and Android, which takes its regex implemntation from NetBSD) does
+ // not include the GNU regex extensions (such as Perl style character classes
+ // like \w) in REG_EXTENDED. REG_EXTENDED is only specified to include the
+ // [[:alpha:]] style character classes. Enable REG_GNU wherever it is defined
+ // so users can use those extensions.
+#if defined(REG_GNU)
+ constexpr int reg_flags = REG_EXTENDED | REG_GNU;
+#else
+ constexpr int reg_flags = REG_EXTENDED;
+#endif
+
// Reserves enough bytes to hold the regular expression used for a
// full match.
const size_t full_regex_len = strlen(regex) + 10;
char* const full_pattern = new char[full_regex_len];
snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
- is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
+ is_valid_ = regcomp(&full_regex_, full_pattern, reg_flags) == 0;
// We want to call regcomp(&partial_regex_, ...) even if the
// previous expression returns false. Otherwise partial_regex_ may
// not be properly initialized can may cause trouble when it's
@@ -714,7 +725,7 @@ void RE::Init(const char* regex) {
// regex. We change it to an equivalent form "()" to be safe.
if (is_valid_) {
const char* const partial_regex = (*regex == '\0') ? "()" : regex;
- is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
+ is_valid_ = regcomp(&partial_regex_, partial_regex, reg_flags) == 0;
}
EXPECT_TRUE(is_valid_)
<< "Regular expression \"" << regex
@@ -1028,6 +1039,16 @@ GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
#if GTEST_HAS_STREAM_REDIRECTION
+namespace {
+
+#if defined(GTEST_OS_LINUX_ANDROID) || defined(GTEST_OS_IOS)
+bool EndsWithPathSeparator(const std::string& path) {
+ return !path.empty() && path.back() == GTEST_PATH_SEP_[0];
+}
+#endif
+
+} // namespace
+
// Object that captures an output stream (stdout/stderr).
class CapturedStream {
public:
@@ -1064,7 +1085,13 @@ class CapturedStream {
// The location /data/local/tmp is directly accessible from native code.
// '/sdcard' and other variants cannot be relied on, as they are not
// guaranteed to be mounted, or may have a delay in mounting.
- name_template = "/data/local/tmp/";
+ //
+ // However, prefer using the TMPDIR environment variable if set, as newer
+ // devices may have /data/local/tmp read-only.
+ name_template = TempDir();
+ if (!EndsWithPathSeparator(name_template))
+ name_template.push_back(GTEST_PATH_SEP_[0]);
+
#elif defined(GTEST_OS_IOS)
char user_temp_dir[PATH_MAX + 1];
@@ -1084,7 +1111,7 @@ class CapturedStream {
::confstr(_CS_DARWIN_USER_TEMP_DIR, user_temp_dir, sizeof(user_temp_dir));
name_template = user_temp_dir;
- if (name_template.back() != GTEST_PATH_SEP_[0])
+ if (!EndsWithPathSeparator(name_template))
name_template.push_back(GTEST_PATH_SEP_[0]);
#else
name_template = "/tmp/";
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest.cc b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest.cc
index 30a5cc3f83a..6d6ff1bb0be 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/src/gtest.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/src/gtest.cc
@@ -43,6 +43,7 @@
#include
#include // NOLINT
#include
+#include // NOLINT: raise(3) is used on some platforms
#include
#include
#include
@@ -161,6 +162,10 @@
#define GTEST_HAS_BUILTIN(x) 0
#endif // defined(__has_builtin)
+#if defined(GTEST_HAS_ABSL) && !defined(GTEST_NO_ABSL_FLAGS)
+#define GTEST_HAS_ABSL_FLAGS
+#endif
+
namespace testing {
using internal::CountIf;
@@ -446,6 +451,19 @@ static bool ShouldRunTestSuite(const TestSuite* test_suite) {
return test_suite->should_run();
}
+namespace {
+
+// Returns true if test part results of type `type` should include a stack
+// trace.
+bool ShouldEmitStackTraceForResultType(TestPartResult::Type type) {
+ // Suppress emission of the stack trace for SUCCEED() since it likely never
+ // requires investigation, and GTEST_SKIP() since skipping is an intentional
+ // act by the developer rather than a failure requiring investigation.
+ return type != TestPartResult::kSuccess && type != TestPartResult::kSkip;
+}
+
+} // namespace
+
// AssertHelper constructor.
AssertHelper::AssertHelper(TestPartResult::Type type, const char* file,
int line, const char* message)
@@ -458,7 +476,9 @@ void AssertHelper::operator=(const Message& message) const {
UnitTest::GetInstance()->AddTestPartResult(
data_->type, data_->file, data_->line,
AppendUserMessage(data_->message, message),
- UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1)
+ ShouldEmitStackTraceForResultType(data_->type)
+ ? UnitTest::GetInstance()->impl()->CurrentOsStackTraceExceptTop(1)
+ : ""
// Skips the stack frame for this function itself.
); // NOLINT
}
@@ -879,7 +899,7 @@ int UnitTestOptions::GTestProcessSEH(DWORD seh_code, const char* location) {
// apparently).
//
// SEH exception code for C++ exceptions.
- // (see http://support.microsoft.com/kb/185294 for more information).
+ // (see https://support.microsoft.com/kb/185294 for more information).
const DWORD kCxxExceptionCode = 0xe06d7363;
if (!GTEST_FLAG_GET(catch_exceptions) || seh_code == kCxxExceptionCode ||
@@ -3228,7 +3248,8 @@ static const char* GetAnsiColorCode(GTestColor color) {
case GTestColor::kYellow:
return "3";
default:
- return nullptr;
+ assert(false);
+ return "9";
}
}
@@ -3281,11 +3302,9 @@ static void ColoredPrintf(GTestColor color, const char* fmt, ...) {
va_start(args, fmt);
static const bool in_color_mode =
-#if GTEST_HAS_FILE_SYSTEM
+ // We don't condition this on GTEST_HAS_FILE_SYSTEM because we still need
+ // to be able to detect terminal I/O regardless.
ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
-#else
- false;
-#endif // GTEST_HAS_FILE_SYSTEM
const bool use_color = in_color_mode && (color != GTestColor::kDefault);
@@ -5399,7 +5418,7 @@ void UnitTest::RecordProperty(const std::string& key,
int UnitTest::Run() {
#ifdef GTEST_HAS_DEATH_TEST
const bool in_death_test_child_process =
- GTEST_FLAG_GET(internal_run_death_test).length() > 0;
+ !GTEST_FLAG_GET(internal_run_death_test).empty();
// Google Test implements this protocol for catching that a test
// program exits before returning control to Google Test:
@@ -6201,8 +6220,8 @@ void UnitTestImpl::ListTestsMatchingFilter() {
#if GTEST_HAS_FILE_SYSTEM
const std::string& output_format = UnitTestOptions::GetOutputFormat();
if (output_format == "xml" || output_format == "json") {
- FILE* fileout = OpenFileForWriting(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
+ FILE* fileout =
+ OpenFileForWriting(UnitTestOptions::GetAbsolutePathToOutputFile());
std::stringstream stream;
if (output_format == "xml") {
XmlUnitTestResultPrinter(
@@ -6683,7 +6702,7 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
// remain in place. Unrecognized flags are not reported and do not cause the
// program to exit.
void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
-#ifdef GTEST_HAS_ABSL
+#ifdef GTEST_HAS_ABSL_FLAGS
if (*argc <= 0) return;
std::vector positional_args;
@@ -6769,11 +6788,13 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
#ifdef GTEST_HAS_ABSL
absl::InitializeSymbolizer(g_argvs[0].c_str());
+#ifdef GTEST_HAS_ABSL_FLAGS
// When using the Abseil Flags library, set the program usage message to the
// help message, but remove the color-encoding from the message first.
absl::SetProgramUsageMessage(absl::StrReplaceAll(
kColorEncodedHelpMessage,
{{"@D", ""}, {"@R", ""}, {"@G", ""}, {"@Y", ""}, {"@@", "@"}}));
+#endif // GTEST_HAS_ABSL_FLAGS
#endif // GTEST_HAS_ABSL
ParseGoogleTestFlagsOnly(argc, argv);
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-options-test.cc b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-options-test.cc
index b712c06fa3f..91d06a50975 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-options-test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-options-test.cc
@@ -115,11 +115,14 @@ TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
strcasecmp("gtest_dll_test", exe_str.c_str()) == 0;
#elif defined(GTEST_OS_FUCHSIA)
const bool success = exe_str == "app";
+#elif defined(__EMSCRIPTEN__)
+ const bool success = exe_str == "patched_googletest-options-test.js";
#else
const bool success =
exe_str == "googletest-options-test" || exe_str == "gtest_all_test" ||
exe_str == "lt-gtest_all_test" || exe_str == "gtest_dll_test";
-#endif // GTEST_OS_WINDOWS
+#endif // platform ifdefs
+
if (!success) FAIL() << "GetCurrentExecutableName() returns " << exe_str;
}
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-output-test-golden-lin.txt b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-output-test-golden-lin.txt
index 6ddf822ffb4..533eb8c6e07 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-output-test-golden-lin.txt
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-output-test-golden-lin.txt
@@ -696,7 +696,6 @@ Expected: 1 fatal failure
Actual:
googletest-output-test_.cc:#: Success:
Succeeded
-Stack trace: (omitted)
Stack trace: (omitted)
@@ -733,7 +732,6 @@ Expected: 1 non-fatal failure
Actual:
googletest-output-test_.cc:#: Success:
Succeeded
-Stack trace: (omitted)
Stack trace: (omitted)
@@ -770,7 +768,6 @@ Expected: 1 fatal failure
Actual:
googletest-output-test_.cc:#: Success:
Succeeded
-Stack trace: (omitted)
Stack trace: (omitted)
@@ -807,7 +804,6 @@ Expected: 1 non-fatal failure
Actual:
googletest-output-test_.cc:#: Success:
Succeeded
-Stack trace: (omitted)
Stack trace: (omitted)
@@ -970,7 +966,6 @@ googletest-output-test_.cc:#: Skipped
[0;32m[----------] [m1 test from TestSuiteThatSkipsInSetUp
googletest-output-test_.cc:#: Skipped
Skip entire test suite
-Stack trace: (omitted)
[0;32m[ RUN ] [mTestSuiteThatSkipsInSetUp.ShouldNotRun
googletest-output-test_.cc:#: Skipped
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-port-test.cc b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-port-test.cc
index 32a2a7b4d64..9f05a019933 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-port-test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-port-test.cc
@@ -296,7 +296,7 @@ void* ThreadFunc(void* data) {
TEST(GetThreadCountTest, ReturnsCorrectValue) {
size_t starting_count;
size_t thread_count_after_create;
- size_t thread_count_after_join;
+ size_t thread_count_after_join = 0;
// We can't guarantee that no other thread was created or destroyed between
// any two calls to GetThreadCount(). We make multiple attempts, hoping that
@@ -316,9 +316,9 @@ TEST(GetThreadCountTest, ReturnsCorrectValue) {
const int status = pthread_create(&thread_id, &attr, &ThreadFunc, &mutex);
ASSERT_EQ(0, pthread_attr_destroy(&attr));
ASSERT_EQ(0, status);
- }
- thread_count_after_create = GetThreadCount();
+ thread_count_after_create = GetThreadCount();
+ }
void* dummy;
ASSERT_EQ(0, pthread_join(thread_id, &dummy));
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-printers-test.cc b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-printers-test.cc
index bee0ca4abe1..d5061bef26d 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-printers-test.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/googletest-printers-test.cc
@@ -54,11 +54,16 @@
#include "gtest/gtest-printers.h"
#include "gtest/gtest.h"
+#include "gtest/internal/gtest-port.h"
#ifdef GTEST_HAS_ABSL
#include "absl/strings/str_format.h"
#endif
+#if GTEST_INTERNAL_HAS_STD_SPAN
+#include // NOLINT
+#endif // GTEST_INTERNAL_HAS_STD_SPAN
+
// Some user-defined types for testing the universal value printer.
// An anonymous enum type.
@@ -1179,6 +1184,17 @@ TEST(PrintStlContainerTest, Vector) {
EXPECT_EQ("{ 1, 2 }", Print(v));
}
+TEST(PrintStlContainerTest, StdSpan) {
+#if GTEST_INTERNAL_HAS_STD_SPAN
+ int a[] = {3, 6, 5};
+ std::span s = a;
+
+ EXPECT_EQ("{ 3, 6, 5 }", Print(s));
+#else
+ GTEST_SKIP() << "Does not have std::span.";
+#endif // GTEST_INTERNAL_HAS_STD_SPAN
+}
+
TEST(PrintStlContainerTest, LongSequence) {
const int a[100] = {1, 2, 3};
const vector v(a, a + 100);
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_help_test.py b/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_help_test.py
index 85a0c33c982..38fc90ff1f0 100755
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_help_test.py
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_help_test.py
@@ -43,11 +43,22 @@
from googletest.test import gtest_test_utils
+FREEBSD = ('FreeBSD', 'GNU/kFreeBSD')
+NETBSD = ('NetBSD',)
+OPENBSD = ('OpenBSD',)
+
+
+def is_bsd_based_os() -> bool:
+ """Determine whether or not the OS is BSD-based."""
+ if os.name != 'posix':
+ return False
+
+ return os.uname()[0] in (FREEBSD + NETBSD + OPENBSD)
+
+
IS_DARWIN = os.name == 'posix' and os.uname()[0] == 'Darwin'
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_GNUHURD = os.name == 'posix' and os.uname()[0] == 'GNU'
-IS_GNUKFREEBSD = os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
-IS_OPENBSD = os.name == 'posix' and os.uname()[0] == 'OpenBSD'
IS_WINDOWS = os.name == 'nt'
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
@@ -96,7 +107,7 @@
)
-def RunWithFlag(flag):
+def run_with_flag(flag):
"""Runs gtest_help_test_ with the given flag.
Returns:
@@ -116,17 +127,14 @@ def RunWithFlag(flag):
class GTestHelpTest(gtest_test_utils.TestCase):
"""Tests the --help flag and its equivalent forms."""
- def TestHelpFlag(self, flag):
+ def test_prints_help_with_full_flag(self):
"""Verifies correct behavior when help flag is specified.
The right message must be printed and the tests must
skipped when the given flag is specified.
-
- Args:
- flag: A flag to pass to the binary or None.
"""
- exit_code, output = RunWithFlag(flag)
+ exit_code, output = run_with_flag('--help')
if HAS_ABSL_FLAGS:
# The Abseil flags library prints the ProgramUsageMessage() with
# --help and returns 1.
@@ -136,7 +144,7 @@ def TestHelpFlag(self, flag):
self.assertTrue(HELP_REGEX.search(output), output)
- if IS_DARWIN or IS_LINUX or IS_GNUHURD or IS_GNUKFREEBSD or IS_OPENBSD:
+ if IS_DARWIN or IS_LINUX or IS_GNUHURD or is_bsd_based_os():
self.assertIn(STREAM_RESULT_TO_FLAG, output)
else:
self.assertNotIn(STREAM_RESULT_TO_FLAG, output)
@@ -146,53 +154,27 @@ def TestHelpFlag(self, flag):
else:
self.assertNotIn(DEATH_TEST_STYLE_FLAG, output)
- def TestUnknownFlagWithAbseil(self, flag):
- """Verifies correct behavior when an unknown flag is specified.
-
- The right message must be printed and the tests must
- skipped when the given flag is specified.
-
- Args:
- flag: A flag to pass to the binary or None.
- """
- exit_code, output = RunWithFlag(flag)
- self.assertEqual(1, exit_code)
- self.assertIn('ERROR: Unknown command line flag', output)
-
- def TestNonHelpFlag(self, flag):
+ def test_runs_tests_without_help_flag(self):
"""Verifies correct behavior when no help flag is specified.
Verifies that when no help flag is specified, the tests are run
and the help message is not printed.
-
- Args:
- flag: A flag to pass to the binary or None.
"""
- exit_code, output = RunWithFlag(flag)
+ exit_code, output = run_with_flag(None)
self.assertNotEqual(exit_code, 0)
self.assertFalse(HELP_REGEX.search(output), output)
- def testPrintsHelpWithFullFlag(self):
- self.TestHelpFlag('--help')
-
- def testRunsTestsWithoutHelpFlag(self):
- """Verifies correct behavior when no help flag is specified.
-
- Verifies that when no help flag is specified, the tests are run
- and the help message is not printed.
- """
-
- self.TestNonHelpFlag(None)
-
- def testRunsTestsWithGtestInternalFlag(self):
+ def test_runs_tests_with_gtest_internal_flag(self):
"""Verifies correct behavior when internal testing flag is specified.
Verifies that the tests are run and no help message is printed when
a flag starting with Google Test prefix and 'internal_' is supplied.
"""
- self.TestNonHelpFlag(INTERNAL_FLAG_FOR_TESTING)
+ exit_code, output = run_with_flag(INTERNAL_FLAG_FOR_TESTING)
+ self.assertNotEqual(exit_code, 0)
+ self.assertFalse(HELP_REGEX.search(output), output)
if __name__ == '__main__':
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_unittest.cc b/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_unittest.cc
index 67d776ed861..0b383ea7c87 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_unittest.cc
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_unittest.cc
@@ -422,11 +422,14 @@ TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) {
EXPECT_EQ("-1234567.89", FormatTimeInMillisAsSeconds(-1234567890));
}
+// TODO: b/287046337 - In emscripten, local time zone modification is not
+// supported.
+#if !defined(__EMSCRIPTEN__)
// Tests FormatEpochTimeInMillisAsIso8601(). The correctness of conversion
// for particular dates below was verified in Python using
// datetime.datetime.fromutctimestamp(/1000).
-// FormatEpochTimeInMillisAsIso8601 depends on the current timezone, so we
+// FormatEpochTimeInMillisAsIso8601 depends on the local timezone, so we
// have to set up a particular timezone to obtain predictable results.
class FormatEpochTimeInMillisAsIso8601Test : public Test {
public:
@@ -445,9 +448,8 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test {
}
GTEST_DISABLE_MSC_DEPRECATED_POP_()
- // Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We
- // cannot use the local time zone because the function's output depends
- // on the time zone.
+ // Set the local time zone for FormatEpochTimeInMillisAsIso8601 to be
+ // a fixed time zone for reproducibility purposes.
SetTimeZone("UTC+00");
}
@@ -514,6 +516,8 @@ TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsEpochStart) {
EXPECT_EQ("1970-01-01T00:00:00.000", FormatEpochTimeInMillisAsIso8601(0));
}
+#endif // __EMSCRIPTEN__
+
#ifdef __BORLANDC__
// Silences warnings: "Condition is always true", "Unreachable code"
#pragma option push -w-ccc -w-rch
diff --git a/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_xml_output_unittest.py b/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_xml_output_unittest.py
index 422569e4839..c3fea2c0a3a 100755
--- a/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_xml_output_unittest.py
+++ b/src/aspnetcore/src/submodules/googletest/googletest/test/gtest_xml_output_unittest.py
@@ -112,20 +112,23 @@
-
+
-
+
-
+
diff --git a/src/aspnetcore/src/submodules/googletest/googletest_deps.bzl b/src/aspnetcore/src/submodules/googletest/googletest_deps.bzl
index e25f5a1ada6..8958890c7ec 100644
--- a/src/aspnetcore/src/submodules/googletest/googletest_deps.bzl
+++ b/src/aspnetcore/src/submodules/googletest/googletest_deps.bzl
@@ -7,16 +7,16 @@ def googletest_deps():
if not native.existing_rule("com_googlesource_code_re2"):
http_archive(
- name = "com_googlesource_code_re2", # 2023-03-17T11:36:51Z
- sha256 = "cb8b5312a65f2598954545a76e8bce913f35fbb3a21a5c88797a4448e9f9b9d9",
- strip_prefix = "re2-578843a516fd1da7084ae46209a75f3613b6065e",
- urls = ["https://github.com/google/re2/archive/578843a516fd1da7084ae46209a75f3613b6065e.zip"],
+ name = "com_googlesource_code_re2",
+ sha256 = "828341ad08524618a626167bd320b0c2acc97bd1c28eff693a9ea33a7ed2a85f",
+ strip_prefix = "re2-2023-11-01",
+ urls = ["https://github.com/google/re2/releases/download/2023-11-01/re2-2023-11-01.zip"],
)
if not native.existing_rule("com_google_absl"):
http_archive(
- name = "com_google_absl", # 2023-08-01T14:59:13Z
- sha256 = "d2c09bf3b3aba57ad87a56082020bee2948445407756e92ddaf3595396086853",
- strip_prefix = "abseil-cpp-22091f4c0d6626b3ef40446ce3d4ccab19425ca3",
- urls = ["https://github.com/abseil/abseil-cpp/archive/22091f4c0d6626b3ef40446ce3d4ccab19425ca3.zip"],
+ name = "com_google_absl",
+ sha256 = "338420448b140f0dfd1a1ea3c3ce71b3bc172071f24f4d9a57d59b45037da440",
+ strip_prefix = "abseil-cpp-20240116.0",
+ urls = ["https://github.com/abseil/abseil-cpp/releases/download/20240116.0/abseil-cpp-20240116.0.tar.gz"],
)
diff --git a/src/source-manifest.json b/src/source-manifest.json
index d9427663137..8afe44e5a94 100644
--- a/src/source-manifest.json
+++ b/src/source-manifest.json
@@ -13,10 +13,10 @@
"commitSha": "48e42f59d64d84b404e904996a9ed61f2a17a569"
},
{
- "packageVersion": "8.0.2-servicing.24068.4",
+ "packageVersion": "8.0.3-servicing.24116.15",
"path": "aspnetcore",
"remoteUri": "https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore",
- "commitSha": "da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644"
+ "commitSha": "88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343"
},
{
"packageVersion": "0.11.4-alpha.23509.2",
@@ -167,7 +167,7 @@
{
"path": "aspnetcore/src/submodules/googletest",
"remoteUri": "https://github.com/google/googletest",
- "commitSha": "7e33b6a1c497ced1e98fc60175aeb4678419281c"
+ "commitSha": "48729681ad88a89061344ee541b4548833077e00"
},
{
"path": "aspnetcore/src/submodules/MessagePack-CSharp",
From 3484c59c3aaa9a0e77a0522787b94e5dada47fff Mon Sep 17 00:00:00 2001
From: "dotnet-maestro[bot]"
Date: Sat, 17 Feb 2024 01:01:52 +0000
Subject: [PATCH 3/4] =?UTF-8?q?[sdk]=20Sync=205e0154f=20=E2=86=92=20413c87?=
=?UTF-8?q?0=20Diff:=20https://dev.azure.com/dnceng/internal/=5Fgit/dotnet?=
=?UTF-8?q?-sdk/compare/5e0154f6ab1a1cf576bc524b9d97753413997046..413c870a?=
=?UTF-8?q?447075a90b8827353acb28ed37bab9dc?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: https://dev.azure.com/dnceng/internal/_git/dotnet-sdk/commit/5e0154f6ab1a1cf576bc524b9d97753413997046
To: https://dev.azure.com/dnceng/internal/_git/dotnet-sdk/commit/413c870a447075a90b8827353acb28ed37bab9dc
[[ commit created by automation ]]
---
Components.md | 2 +-
prereqs/git-info/AllRepoVersions.props | 4 +-
prereqs/git-info/sdk.props | 6 +-
src/sdk/NuGet.config | 30 ++------
src/sdk/eng/Version.Details.xml | 96 +++++++++++++-------------
src/sdk/eng/Versions.props | 20 +++---
src/source-manifest.json | 4 +-
7 files changed, 71 insertions(+), 91 deletions(-)
diff --git a/Components.md b/Components.md
index aa28da950f8..f01fb3a8edf 100644
--- a/Components.md
+++ b/Components.md
@@ -48,7 +48,7 @@ To enable full offline source-building of the VMR, we have no other choice than
- `src/runtime`
*[_git/dotnet-runtime@9f4b1f5](https://dev.azure.com/dnceng/internal/_git/dotnet-runtime/?version=GC9f4b1f5d664afdfc80e1508ab7ed099dff210fbd)*
- `src/sdk`
-*[_git/dotnet-sdk@5e0154f](https://dev.azure.com/dnceng/internal/_git/dotnet-sdk/?version=GC5e0154f6ab1a1cf576bc524b9d97753413997046)*
+*[_git/dotnet-sdk@413c870](https://dev.azure.com/dnceng/internal/_git/dotnet-sdk/?version=GC413c870a447075a90b8827353acb28ed37bab9dc)*
- `src/source-build-externals`
*[_git/dotnet-source-build-externals@0f0f1f0](https://dev.azure.com/dnceng/internal/_git/dotnet-source-build-externals/?version=GC0f0f1f0f33830f27ed0ff357145d2464b96b1a3e)*
- `src/source-build-externals/src/abstractions-xunit`
diff --git a/prereqs/git-info/AllRepoVersions.props b/prereqs/git-info/AllRepoVersions.props
index 25192ffcc77..a7264050454 100644
--- a/prereqs/git-info/AllRepoVersions.props
+++ b/prereqs/git-info/AllRepoVersions.props
@@ -35,8 +35,8 @@
4.8.0-7.24067.249f4b1f5d664afdfc80e1508ab7ed099dff210fbd8.0.3-servicing.24114.23
- 5e0154f6ab1a1cf576bc524b9d97753413997046
- 8.0.103-servicing.24116.29
+ 413c870a447075a90b8827353acb28ed37bab9dc
+ 8.0.103-servicing.24116.860f0f1f0f33830f27ed0ff357145d2464b96b1a3e8.0.0-alpha.1.23577.695f83e27806330fec09edd96e06bba3acabe3f35
diff --git a/prereqs/git-info/sdk.props b/prereqs/git-info/sdk.props
index 19037258441..ef5c9d5a1d4 100644
--- a/prereqs/git-info/sdk.props
+++ b/prereqs/git-info/sdk.props
@@ -1,9 +1,9 @@
- 5e0154f6ab1a1cf576bc524b9d97753413997046
- 20240216.29
- 8.0.103-servicing.24116.29
+ 413c870a447075a90b8827353acb28ed37bab9dc
+ 20240216.86
+ 8.0.103-servicing.24116.86servicingfalse
diff --git a/src/sdk/NuGet.config b/src/sdk/NuGet.config
index 0e254608028..a832bb0b3ca 100644
--- a/src/sdk/NuGet.config
+++ b/src/sdk/NuGet.config
@@ -5,15 +5,12 @@
-
-
-
-
-
+
+
@@ -22,21 +19,12 @@
-
-
-
-
-
-
-
-
-
-
+
@@ -61,24 +49,16 @@
+
-
-
-
-
-
-
-
-
-
-
+
diff --git a/src/sdk/eng/Version.Details.xml b/src/sdk/eng/Version.Details.xml
index 332c860d788..b151c5bf631 100644
--- a/src/sdk/eng/Version.Details.xml
+++ b/src/sdk/eng/Version.Details.xml
@@ -77,9 +77,9 @@
fc5e9eda234e2b69aa479f4f83faddc31fdd4da7
-
+ https://github.com/dotnet/format
- 4ffa2f1691a4ac3ebad3fe840d7a25f35feba635
+ d237e172b324021b97effa244af44d63d1a8bb7e
@@ -111,13 +111,13 @@
https://github.com/dotnet/roslyn263571123fc3dc4a638e071234ac9fbf91913962
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343https://dev.azure.com/devdiv/DevDiv/_git/NuGet-NuGet.Client-Trusted
@@ -216,70 +216,70 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime5535e31a712343a63f5d7d796cd874e563e5ac14
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop
- 593444ad8328a5a933c006c6564469666f45ad2e
+ baf3c0df45e13d065884f7e84260f645295f219e
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop
- 593444ad8328a5a933c006c6564469666f45ad2e
+ baf3c0df45e13d065884f7e84260f645295f219e
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop
- 593444ad8328a5a933c006c6564469666f45ad2e
+ baf3c0df45e13d065884f7e84260f645295f219e
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop
- 593444ad8328a5a933c006c6564469666f45ad2e
+ baf3c0df45e13d065884f7e84260f645295f219e
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-wpf
- 472140dd926227876848e48f41cfc9acb9275492
+ 46fb08cfa8160d0885b74c7f28a7b187ab86efed
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343https://github.com/dotnet/razor
@@ -294,21 +294,21 @@
https://github.com/dotnet/razord135dd8d2ec1c2fbdee220e8656b308694e17a4b
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343https://github.com/dotnet/xdt
@@ -425,9 +425,9 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-runtime5535e31a712343a63f5d7d796cd874e563e5ac14
-
+ https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore
- da7e9894ce22ef8cc02e5acc56e95a6f8cf8f644
+ 88ec3bc3f37e76fbcc932a25f9f0c1c29fe2b343https://dev.azure.com/dnceng/internal/_git/dotnet-runtime
diff --git a/src/sdk/eng/Versions.props b/src/sdk/eng/Versions.props
index de228ef2042..1f15e4ce125 100644
--- a/src/sdk/eng/Versions.props
+++ b/src/sdk/eng/Versions.props
@@ -61,7 +61,7 @@
8.0.38.0.08.0.0
- 8.0.2
+ 8.0.38.0.08.0.08.0.0
@@ -108,7 +108,7 @@
- 8.0.510703
+ 8.0.511601
@@ -161,13 +161,13 @@
- 8.0.2
- 8.0.2-servicing.24068.4
- 8.0.2-servicing.24068.4
- 8.0.2-servicing.24068.4
- 8.0.2-servicing.24068.4
- 8.0.2-servicing.24068.4
- 8.0.2
+ 8.0.3
+ 8.0.3-servicing.24116.15
+ 8.0.3-servicing.24116.15
+ 8.0.3-servicing.24116.15
+ 8.0.3-servicing.24116.15
+ 8.0.3-servicing.24116.15
+ 8.0.3
@@ -177,7 +177,7 @@
- 8.0.2-servicing.24068.6
+ 8.0.3-servicing.24116.6
diff --git a/src/source-manifest.json b/src/source-manifest.json
index 8afe44e5a94..30f8d645624 100644
--- a/src/source-manifest.json
+++ b/src/source-manifest.json
@@ -103,10 +103,10 @@
"commitSha": "9f4b1f5d664afdfc80e1508ab7ed099dff210fbd"
},
{
- "packageVersion": "8.0.103-servicing.24116.29",
+ "packageVersion": "8.0.103-servicing.24116.86",
"path": "sdk",
"remoteUri": "https://dev.azure.com/dnceng/internal/_git/dotnet-sdk",
- "commitSha": "5e0154f6ab1a1cf576bc524b9d97753413997046"
+ "commitSha": "413c870a447075a90b8827353acb28ed37bab9dc"
},
{
"packageVersion": "8.0.0-alpha.1.23577.6",
From 412b359334806287787c92e1952a84a30965837a Mon Sep 17 00:00:00 2001
From: "dotnet-maestro[bot]"
Date: Sat, 17 Feb 2024 01:01:54 +0000
Subject: [PATCH 4/4] =?UTF-8?q?[format]=20Sync=204ffa2f1=20=E2=86=92=20d23?=
=?UTF-8?q?7e17=20Diff:=20https://github.com/dotnet/format/compare/4ffa2f1?=
=?UTF-8?q?691a4ac3ebad3fe840d7a25f35feba635..d237e172b324021b97effa244af4?=
=?UTF-8?q?4d63d1a8bb7e?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: https://github.com/dotnet/format/commit/4ffa2f1691a4ac3ebad3fe840d7a25f35feba635
To: https://github.com/dotnet/format/commit/d237e172b324021b97effa244af44d63d1a8bb7e
[[ commit created by automation ]]
---
Components.md | 2 +-
prereqs/git-info/AllRepoVersions.props | 4 ++--
prereqs/git-info/format.props | 6 +++---
src/format/src/Resources.resx | 2 +-
src/format/src/xlf/Resources.cs.xlf | 6 +++---
src/format/src/xlf/Resources.de.xlf | 6 +++---
src/format/src/xlf/Resources.es.xlf | 6 +++---
src/format/src/xlf/Resources.fr.xlf | 6 +++---
src/format/src/xlf/Resources.it.xlf | 6 +++---
src/format/src/xlf/Resources.ja.xlf | 6 +++---
src/format/src/xlf/Resources.ko.xlf | 6 +++---
src/format/src/xlf/Resources.pl.xlf | 6 +++---
src/format/src/xlf/Resources.pt-BR.xlf | 6 +++---
src/format/src/xlf/Resources.ru.xlf | 6 +++---
src/format/src/xlf/Resources.tr.xlf | 6 +++---
src/format/src/xlf/Resources.zh-Hans.xlf | 6 +++---
src/format/src/xlf/Resources.zh-Hant.xlf | 6 +++---
src/source-manifest.json | 4 ++--
18 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/Components.md b/Components.md
index f01fb3a8edf..dcf4c672320 100644
--- a/Components.md
+++ b/Components.md
@@ -28,7 +28,7 @@ To enable full offline source-building of the VMR, we have no other choice than
- `src/emsdk`
*[dotnet/emsdk@9a29abd](https://github.com/dotnet/emsdk/tree/9a29abdd764a4de0f253ed368871877a47725247)*
- `src/format`
-*[dotnet/format@4ffa2f1](https://github.com/dotnet/format/tree/4ffa2f1691a4ac3ebad3fe840d7a25f35feba635)*
+*[dotnet/format@d237e17](https://github.com/dotnet/format/tree/d237e172b324021b97effa244af44d63d1a8bb7e)*
- `src/fsharp`
*[dotnet/fsharp@fc5e9ed](https://github.com/dotnet/fsharp/tree/fc5e9eda234e2b69aa479f4f83faddc31fdd4da7)*
- `src/installer`
diff --git a/prereqs/git-info/AllRepoVersions.props b/prereqs/git-info/AllRepoVersions.props
index a7264050454..ae4b94987fe 100644
--- a/prereqs/git-info/AllRepoVersions.props
+++ b/prereqs/git-info/AllRepoVersions.props
@@ -17,8 +17,8 @@
7.0.0-preview.23211.19a29abdd764a4de0f253ed368871877a477252478.0.3-servicing.24108.3
- 4ffa2f1691a4ac3ebad3fe840d7a25f35feba635
- 8.0.510703
+ d237e172b324021b97effa244af44d63d1a8bb7e
+ 8.0.511601fc5e9eda234e2b69aa479f4f83faddc31fdd4da78.0.102-beta.24081.26a90b4b4bc6034fa0cf75368f0ccb9ed98b4651c
diff --git a/prereqs/git-info/format.props b/prereqs/git-info/format.props
index ad84e2d9ccb..98d1ca2a419 100644
--- a/prereqs/git-info/format.props
+++ b/prereqs/git-info/format.props
@@ -1,9 +1,9 @@
- 4ffa2f1691a4ac3ebad3fe840d7a25f35feba635
- 20240216.1
- 8.0.510703
+ d237e172b324021b97effa244af44d63d1a8bb7e
+ 20240217.1
+ 8.0.511601true
diff --git a/src/format/src/Resources.resx b/src/format/src/Resources.resx
index cf038110c65..999aa66a5a2 100644
--- a/src/format/src/Resources.resx
+++ b/src/format/src/Resources.resx
@@ -334,7 +334,7 @@
Cannot specify the '--folder' option when writing a binary log.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTIONThe project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
diff --git a/src/format/src/xlf/Resources.cs.xlf b/src/format/src/xlf/Resources.cs.xlf
index 033ac47173c..1423925215b 100644
--- a/src/format/src/xlf/Resources.cs.xlf
+++ b/src/format/src/xlf/Resources.cs.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ Soubor projektu nebo řešení, se kterým se má operace provést. Pokud soubor není zadaný, příkaz ho bude hledat v aktuálním adresáři.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.de.xlf b/src/format/src/xlf/Resources.de.xlf
index 678cd3e3ed8..7c7bc4bb625 100644
--- a/src/format/src/xlf/Resources.de.xlf
+++ b/src/format/src/xlf/Resources.de.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ Das Projekt oder die Projektmappendatei, die verwendet werden soll. Wenn keine Datei angegeben ist, durchsucht der Befehl das aktuelle Verzeichnis nach einer Datei.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.es.xlf b/src/format/src/xlf/Resources.es.xlf
index 7e1cb4fac26..098f102e48e 100644
--- a/src/format/src/xlf/Resources.es.xlf
+++ b/src/format/src/xlf/Resources.es.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ El archivo de proyecto o solución donde operar. Si no se especifica un archivo, el comando buscará uno en el directorio actual.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.fr.xlf b/src/format/src/xlf/Resources.fr.xlf
index bbb5e2602c9..e978b44516f 100644
--- a/src/format/src/xlf/Resources.fr.xlf
+++ b/src/format/src/xlf/Resources.fr.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ Fichier projet ou solution à utiliser. Si vous ne spécifiez pas de fichier, la commande en recherche un dans le répertoire actuel.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.it.xlf b/src/format/src/xlf/Resources.it.xlf
index 3061e582b7c..0cbcb39ae36 100644
--- a/src/format/src/xlf/Resources.it.xlf
+++ b/src/format/src/xlf/Resources.it.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ File di progetto o di soluzione su cui intervenire. Se non si specifica un file, il comando ne cercherà uno nella directory corrente.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.ja.xlf b/src/format/src/xlf/Resources.ja.xlf
index 9b2d904ce35..f103dba3e35 100644
--- a/src/format/src/xlf/Resources.ja.xlf
+++ b/src/format/src/xlf/Resources.ja.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ 利用するプロジェクト ファイルまたはソリューション ファイル。指定しない場合、コマンドは現在のディレクトリを検索します。
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.ko.xlf b/src/format/src/xlf/Resources.ko.xlf
index 68d5abce17e..e3617020441 100644
--- a/src/format/src/xlf/Resources.ko.xlf
+++ b/src/format/src/xlf/Resources.ko.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ 수행할 프로젝트 또는 솔루션 파일입니다. 파일을 지정하지 않으면 명령이 현재 디렉토리에서 파일을 검색합니다.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.pl.xlf b/src/format/src/xlf/Resources.pl.xlf
index ea028918652..718e6a2f9d3 100644
--- a/src/format/src/xlf/Resources.pl.xlf
+++ b/src/format/src/xlf/Resources.pl.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ Plik projektu lub rozwiązania, dla którego ma zostać wykonana operacja. Jeśli plik nie zostanie podany, polecenie wyszuka go w bieżącym katalogu.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.pt-BR.xlf b/src/format/src/xlf/Resources.pt-BR.xlf
index 4f96090dbc2..9a8687ea74c 100644
--- a/src/format/src/xlf/Resources.pt-BR.xlf
+++ b/src/format/src/xlf/Resources.pt-BR.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ O arquivo de solução ou projeto para operar. Se um arquivo não for especificado, o comando pesquisará um no diretório atual.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.ru.xlf b/src/format/src/xlf/Resources.ru.xlf
index 77b7d973562..8898532273e 100644
--- a/src/format/src/xlf/Resources.ru.xlf
+++ b/src/format/src/xlf/Resources.ru.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ Файл проекта или решения. Если файл не указан, команда будет искать его в текущем каталоге.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.tr.xlf b/src/format/src/xlf/Resources.tr.xlf
index 9172271891b..8ca53319d83 100644
--- a/src/format/src/xlf/Resources.tr.xlf
+++ b/src/format/src/xlf/Resources.tr.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ Üzerinde işlem yapılacak proje veya çözüm dosyası. Bir dosya belirtilmezse komut geçerli dizinde dosya arar.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.zh-Hans.xlf b/src/format/src/xlf/Resources.zh-Hans.xlf
index 9977e59cd60..28792812f6e 100644
--- a/src/format/src/xlf/Resources.zh-Hans.xlf
+++ b/src/format/src/xlf/Resources.zh-Hans.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ 要操作的项目或解决方案文件。如果没有指定文件,则命令将在当前目录里搜索一个文件。
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/format/src/xlf/Resources.zh-Hant.xlf b/src/format/src/xlf/Resources.zh-Hant.xlf
index 63b9e4e4c8e..78caaaf3b6b 100644
--- a/src/format/src/xlf/Resources.zh-Hant.xlf
+++ b/src/format/src/xlf/Resources.zh-Hant.xlf
@@ -289,12 +289,12 @@
The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ 要操作的專案或解決方案。若未指定檔案,命令就會在目前的目錄中搜尋一個檔案。
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
- The project or solution file to operate on. If a file is not specified, the command will search the current directory for one.
+ PROJECT | SOLUTION
+ PROJECT | SOLUTION
diff --git a/src/source-manifest.json b/src/source-manifest.json
index 30f8d645624..3a33dcb9903 100644
--- a/src/source-manifest.json
+++ b/src/source-manifest.json
@@ -49,10 +49,10 @@
"commitSha": "9a29abdd764a4de0f253ed368871877a47725247"
},
{
- "packageVersion": "8.0.510703",
+ "packageVersion": "8.0.511601",
"path": "format",
"remoteUri": "https://github.com/dotnet/format",
- "commitSha": "4ffa2f1691a4ac3ebad3fe840d7a25f35feba635"
+ "commitSha": "d237e172b324021b97effa244af44d63d1a8bb7e"
},
{
"packageVersion": "8.0.102-beta.24081.2",