refactor: move server rs workspace entries into crates

This commit is contained in:
2026-04-21 11:01:25 +08:00
parent 5a60ab3972
commit f6bf5f665e
47 changed files with 244 additions and 233 deletions

View File

@@ -2,7 +2,8 @@
param(
[Alias("h")]
[switch]$Help,
[string]$Package = ""
[Alias("Package")]
[string]$Crate = ""
)
$ErrorActionPreference = "Stop"
@@ -11,11 +12,11 @@ function Write-Usage {
@(
'Usage:'
' ./server-rs/scripts/test.ps1'
' ./server-rs/scripts/test.ps1 -Package api-server'
' ./server-rs/scripts/test.ps1 -Crate api-server'
''
'Notes:'
' 1. Run cargo test for the server-rs workspace by default'
' 2. Use -Package to target one workspace package only'
' 2. Use -Crate to target one workspace crate only'
) -join [Environment]::NewLine
}
@@ -36,12 +37,12 @@ Write-Host "[server-rs:test] working dir: $serverRsDir"
Push-Location $serverRsDir
try {
if ([string]::IsNullOrWhiteSpace($Package)) {
if ([string]::IsNullOrWhiteSpace($Crate)) {
cargo test --manifest-path $manifestPath
}
else {
Write-Host "[server-rs:test] target package: $Package"
cargo test -p $Package --manifest-path $manifestPath
Write-Host "[server-rs:test] target crate: $Crate"
cargo test -p $Crate --manifest-path $manifestPath
}
}
finally {