mirror of
https://github.com/actions/runner-images.git
synced 2025-12-28 12:48:21 +08:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
72
images/windows/scripts/tests/MSYS2.Tests.ps1
Normal file
72
images/windows/scripts/tests/MSYS2.Tests.ps1
Normal file
@@ -0,0 +1,72 @@
|
||||
BeforeAll {
|
||||
$msys2Dir = "C:\msys64\usr\bin"
|
||||
$originalPath = $env:PATH
|
||||
}
|
||||
|
||||
Describe "MSYS2 packages" {
|
||||
BeforeEach {
|
||||
$env:PATH = "$msys2Dir;$env:PATH"
|
||||
}
|
||||
|
||||
It "msys2Dir exists" {
|
||||
$msys2Dir | Should -Exist
|
||||
}
|
||||
|
||||
$TestCases = @(
|
||||
@{ ToolName = "bash.exe" }
|
||||
)
|
||||
|
||||
if (Test-IsWin19) {
|
||||
$TestCases += @(
|
||||
@{ ToolName = "tar.exe" }
|
||||
@{ ToolName = "make.exe" }
|
||||
)
|
||||
}
|
||||
|
||||
It "<ToolName> is installed in <msys2Dir>" -TestCases $TestCases {
|
||||
(Get-Command "$ToolName").Source | Should -BeLike "$msys2Dir*"
|
||||
}
|
||||
|
||||
It "<ToolName> is avaialable" -TestCases $TestCases {
|
||||
"$ToolName" | Should -ReturnZeroExitCodeWithParam
|
||||
}
|
||||
|
||||
AfterEach {
|
||||
$env:PATH = $originalPath
|
||||
}
|
||||
}
|
||||
|
||||
$mingwTypes = (Get-ToolsetContent).MsysPackages.mingw
|
||||
foreach ($mingwType in $mingwTypes) {
|
||||
Describe "$($mingwType.arch) packages" {
|
||||
$tools = $mingwType.runtime_packages
|
||||
$execDir = Join-Path "C:\msys64" $mingwType.exec_dir | Join-Path -ChildPath "bin"
|
||||
|
||||
foreach ($tool in $tools) {
|
||||
Context "$($tool.name) package"{
|
||||
$executables = $tool.executables | ForEach-Object {
|
||||
@{
|
||||
ExecName = $_
|
||||
ExecDir = $execDir
|
||||
}
|
||||
}
|
||||
|
||||
BeforeEach {
|
||||
$env:PATH = "$execDir;$env:PATH"
|
||||
}
|
||||
|
||||
It "<ExecName> is installed in <ExecDir>" -TestCases $executables {
|
||||
(Get-Command "$ExecName").Source | Should -BeLike "$ExecDir*"
|
||||
}
|
||||
|
||||
It "<ExecName> is available" -TestCases $executables {
|
||||
"$ExecName" | Should -ReturnZeroExitCodeWithParam
|
||||
}
|
||||
|
||||
AfterEach {
|
||||
$env:PATH = $originalPath
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user