From 1413a95f553ef1882b8626acb1a3e7007054d844 Mon Sep 17 00:00:00 2001 From: smdn Date: Sat, 14 Dec 2024 13:31:10 +0900 Subject: [PATCH] make sure to disable emitting escape sequences --- tests/Smdn.LibHighlightSharp/AssemblyMetadata.cs | 6 +++++- .../Smdn.LibHighlightSharp.Tests.csproj | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/Smdn.LibHighlightSharp/AssemblyMetadata.cs b/tests/Smdn.LibHighlightSharp/AssemblyMetadata.cs index aaaab54..92e8d0e 100644 --- a/tests/Smdn.LibHighlightSharp/AssemblyMetadata.cs +++ b/tests/Smdn.LibHighlightSharp/AssemblyMetadata.cs @@ -1,6 +1,7 @@ // SPDX-FileCopyrightText: 2022 smdn // SPDX-License-Identifier: GPL-3.0-or-later using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -40,8 +41,11 @@ public void TestReferencedBindingsVersion() var commandLine = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? $"dotnet run --project \"{pathToToolProject}\" -- \"{pathToAssemblySmdnLibHighlight}\" \"{pathToAssemblySmdnLibHighlightBindings}\"" : $"dotnet run --project '{pathToToolProject}' -- '{pathToAssemblySmdnLibHighlight}' '{pathToAssemblySmdnLibHighlightBindings}'"; + var environmentVariables = new Dictionary() { + ["NO_COLOR"] = "NO_COLOR", // disable emitting ANSI color escape codes + }; - if (0 != Shell.Execute(commandLine, out var stdout, out var stderr)) { + if (0 != Shell.Execute(commandLine, arguments: null, environmentVariables, out var stdout, out var stderr)) { TestContext.Out.WriteLine("[command line]"); TestContext.Out.WriteLine(commandLine); TestContext.Out.WriteLine("[stdout]"); diff --git a/tests/Smdn.LibHighlightSharp/Smdn.LibHighlightSharp.Tests.csproj b/tests/Smdn.LibHighlightSharp/Smdn.LibHighlightSharp.Tests.csproj index 1dbfd0e..96f51a9 100644 --- a/tests/Smdn.LibHighlightSharp/Smdn.LibHighlightSharp.Tests.csproj +++ b/tests/Smdn.LibHighlightSharp/Smdn.LibHighlightSharp.Tests.csproj @@ -23,7 +23,7 @@ SPDX-License-Identifier: MIT - +