Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit e1f83ff

Browse files
committed
Set crate type to rlib when testing as well.
1 parent 4a16727 commit e1f83ff

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/Simulation/qdk_sim_rs/test-qdk-sim-rs.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ $IsCI = "$Env:TF_BUILD" -ne "" -or "$Env:CI" -eq "true";
44
$script:allOk = $true;
55

66
Push-Location $PSScriptRoot
7+
# Import ConvertFrom-Toml and ConvertTo-Toml, used for setting versions and
8+
# crate types. Note that because a workspace file is used, Cargo.toml must
9+
# exist in this directory before any call to cargo run. We copy over the
10+
# template unmodified to handle that limitation.
11+
Copy-Item Cargo.toml.template Cargo.toml
12+
13+
# We can now import TOML handling implemented in the t2j crate.
14+
# TODO @cgranade: Consider moving to use objconv instead to decouple
15+
# dependencies here.
16+
. (Join-Path $PSScriptRoot ".." ".." ".." "build" "t2j" "t2j.ps1");
17+
Write-Host -ForegroundColor Blue "##[info]Successfully loaded t2j: $(Invoke-T2J --version)"
18+
19+
# Now that we have prereqs, set the crate version and make sure we're using
20+
# rlib dependencies for Rust testing.
21+
$cargoManifest = ConvertFrom-Toml -Path "./Cargo.toml.template";
22+
$cargoManifest | Format-List | Out-String | Write-Host;
23+
$cargoManifest.package.version = $Env:NUGET_VERSION;
24+
$cargoManifest.lib."crate-type" = @("rlib");
25+
ConvertTo-Toml -InputObject $cargoManifest -Path "./Cargo.toml";
26+
727
# If running in CI, use cargo2junit to expose unit tests to the
828
# PublishTestResults task.
929
if ($IsCI) {

0 commit comments

Comments
 (0)