Skip to content

Commit 145ccf8

Browse files
authored
Prevent powershell from adding a BOM to test input (#3595)
* Prevent addition of a BOM to test input (which would distort the names of output files)
1 parent 4dbdc28 commit 145ccf8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ endforeach()
2828
# $1 exec, $2 input, $3 output_result
2929
if(WIN32)
3030
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test_helper.ps1
31+
"[Console]::InputEncoding = New-Object Text.UTF8Encoding $false\n"
3132
"if (Test-Path $args[2]) { Remove-Item -Force $args[2] } \n"
3233
"$ErrorActionPreference = \"Stop\"\n"
33-
"If ((Get-Content $args[1] | & file - | %{$_ -match \"BOM\"}) -contains $true) {\n"
34-
"echo 'Skipped due to wrong input encoding'\n"
35-
"exit 0\n"
36-
"}\n"
37-
"Get-Content $args[1] | & $args[0]\n"
34+
"Get-Content $args[1] | & $args[0]\n"
3835
"If ((Get-Content $args[2] | %{$_ -match \"FATAL\"}) -contains $true) {\n"
3936
"echo Error\n"
4037
"exit 1\n"

0 commit comments

Comments
 (0)