2022-12-28 12:20:27 +03:00
|
|
|
Set-StrictMode -Version latest
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
|
2023-04-05 12:07:50 +03:00
|
|
|
write-host -foregroundcolor Cyan "----- unit tests -----"
|
2023-10-20 11:32:57 +03:00
|
|
|
|
|
|
|
# exe dir
|
|
|
|
$original_env_path="$env:Path"
|
|
|
|
|
|
|
|
# lib dir
|
|
|
|
$vcpkg_dir=((Get-command vcpkg).Source | Split-Path)
|
|
|
|
$lib_dir="$vcpkg_dir\installed\x64-windows\bin"
|
|
|
|
|
|
|
|
# link libs
|
|
|
|
$env:Path = "$lib_dir" + ";" + "$original_env_path"
|
|
|
|
|
|
|
|
# execute test units
|
2023-09-29 14:44:57 +03:00
|
|
|
cargo test --release --tests
|
2022-12-28 12:20:27 +03:00
|
|
|
if ($LASTEXITCODE) { Throw }
|
2023-10-20 11:32:57 +03:00
|
|
|
|
|
|
|
# unlink libs
|
|
|
|
$env:Path = "$original_env_path"
|
|
|
|
|