mirror of
https://github.com/actions/runner-images.git
synced 2025-12-24 10:28:00 +08:00
[Windows] Implement new directories hierarchy (#8616)
This commit is contained in:
committed by
GitHub
parent
84a7deae24
commit
d1f2c9a3be
35
images/windows/scripts/tests/Rust.Tests.ps1
Normal file
35
images/windows/scripts/tests/Rust.Tests.ps1
Normal file
@@ -0,0 +1,35 @@
|
||||
Describe "Rust" {
|
||||
BeforeAll {
|
||||
$env:RUSTUP_HOME = "C:\Users\Default\.rustup"
|
||||
$env:CARGO_HOME = "C:\Users\Default\.cargo"
|
||||
$env:Path += ";$env:CARGO_HOME\bin"
|
||||
}
|
||||
|
||||
$rustTools = @(
|
||||
@{ToolName = "rustup"; binPath = "C:\Users\Default\.cargo\bin\rustup.exe"}
|
||||
@{ToolName = "rustc"; binPath = "C:\Users\Default\.cargo\bin\rustc.exe"}
|
||||
@{ToolName = "bindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\bindgen.exe"}
|
||||
@{ToolName = "cbindgen.exe"; binPath = "C:\Users\Default\.cargo\bin\cbindgen.exe"}
|
||||
@{ToolName = "cargo"; binPath = "C:\Users\Default\.cargo\bin\cargo.exe"}
|
||||
@{ToolName = "cargo audit"; binPath = "C:\Users\Default\.cargo\bin\cargo-audit.exe"}
|
||||
@{ToolName = "cargo outdated"; binPath = "C:\Users\Default\.cargo\bin\cargo-outdated.exe"}
|
||||
)
|
||||
|
||||
$rustEnvNotExists = @(
|
||||
@{envVar = "RUSTUP_HOME"}
|
||||
@{envVar = "CARGO_HOME"}
|
||||
)
|
||||
|
||||
It "C:\Users\Default\.rustup and C:\Users\Default\.cargo folders exist" {
|
||||
"C:\Users\Default\.rustup", "C:\Users\Default\.cargo" | Should -Exist
|
||||
}
|
||||
|
||||
It "<envVar> environment variable does not exist" -TestCases $rustEnvNotExists {
|
||||
[Environment]::GetEnvironmentVariables("Machine").ContainsKey($envVar) | Should -BeFalse
|
||||
}
|
||||
|
||||
It "<ToolName> is installed to the '<binPath>' folder" -TestCases $rustTools {
|
||||
"$ToolName --version" | Should -ReturnZeroExitCode
|
||||
$binPath | Should -Exist
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user