mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	CI/Appveyor: set powershell strict mode
Set-PSDebug produces too much noise and has global scope. Strict mode is scoped to the script context and catches errors.
This commit is contained in:
		| @@ -1,10 +1,10 @@ | |||||||
|  | Set-StrictMode -Version Latest | ||||||
| $ErrorActionPreference = 'stop' | $ErrorActionPreference = 'stop' | ||||||
| Set-PSDebug -Strict -Trace 1 |  | ||||||
|  |  | ||||||
| $isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null) | $isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null) | ||||||
| $env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$' | $env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$' | ||||||
| $compiler = $Matches.compiler | $compiler = $Matches.compiler | ||||||
| $compileOption = $Matches.option | $compileOption = if ($Matches -contains 'option') {$Matches.option} else {''} | ||||||
| $bits = $Matches.bits | $bits = $Matches.bits | ||||||
| $cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'}); | $cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'}); | ||||||
| $buildDir = [System.IO.Path]::GetFullPath("$(pwd)") | $buildDir = [System.IO.Path]::GetFullPath("$(pwd)") | ||||||
| @@ -23,7 +23,6 @@ $uploadToCodeCov = $false | |||||||
|  |  | ||||||
| function exitIfFailed() { | function exitIfFailed() { | ||||||
|   if ($LastExitCode -ne 0) { |   if ($LastExitCode -ne 0) { | ||||||
|     Set-PSDebug -Off |  | ||||||
|     exit $LastExitCode |     exit $LastExitCode | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @@ -146,8 +145,6 @@ if ($env:USE_LUACOV -eq 1) { | |||||||
| # Functional tests | # Functional tests | ||||||
| # The $LastExitCode from MSBuild can't be trusted | # The $LastExitCode from MSBuild can't be trusted | ||||||
| $failed = $false | $failed = $false | ||||||
| # Temporarily turn off tracing to reduce log file output |  | ||||||
| Set-PSDebug -Off |  | ||||||
| cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 | | cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 | | ||||||
|   foreach { $failed = $failed -or |   foreach { $failed = $failed -or | ||||||
|     $_ -match 'functional tests failed with error'; $_ } |     $_ -match 'functional tests failed with error'; $_ } | ||||||
| @@ -161,7 +158,6 @@ if ($uploadToCodecov) { | |||||||
| if ($failed) { | if ($failed) { | ||||||
|   exit $LastExitCode |   exit $LastExitCode | ||||||
| } | } | ||||||
| Set-PSDebug -Strict -Trace 1 |  | ||||||
|  |  | ||||||
| # Old tests | # Old tests | ||||||
| # Add MSYS to path, required for e.g. `find` used in test scripts. | # Add MSYS to path, required for e.g. `find` used in test scripts. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jan Edmund Lazo
					Jan Edmund Lazo