Skip to content

Commit 1ecc3cd

Browse files
committed
difftest: forward use-installed-tools
1 parent 9ff38c4 commit 1ecc3cd

File tree

5 files changed

+30
-650
lines changed

5 files changed

+30
-650
lines changed

tests/difftests/bin/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ edition.workspace = true
66
license.workspace = true
77
repository.workspace = true
88

9+
# See rustc_codegen_spirv/Cargo.toml for details on these features
10+
[features]
11+
default = ["use-compiled-tools"]
12+
use-installed-tools = []
13+
use-compiled-tools = []
14+
915
[dependencies]
1016
anyhow = "1.0"
1117
tracing = "0.1"

tests/difftests/bin/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ fn main() -> Result<()> {
7878
.current_dir(&base)
7979
.stderr(std::process::Stdio::inherit())
8080
.stdout(std::process::Stdio::inherit());
81+
runner::forward_features(cmd);
8182
tracing::debug!("Running cargo command: {:?}", cmd);
8283

8384
let output = cmd.output().expect("build output");

tests/difftests/bin/src/runner.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ impl Runner {
154154
msg: "Invalid config file path".into(),
155155
})?,
156156
);
157+
forward_features(cmd);
157158
debug!("Running cargo command: {:?}", cmd);
158159

159160
let output = cmd
@@ -331,6 +332,18 @@ impl Runner {
331332
}
332333
}
333334

335+
pub fn forward_features(cmd: &mut Command) {
336+
cmd.arg("--no-default-features").arg("--features");
337+
#[cfg(feature = "use-compiled-tools")]
338+
{
339+
cmd.arg("use-compiled-tools");
340+
}
341+
#[cfg(feature = "use-installed-tools")]
342+
{
343+
cmd.arg("use-installed-tools");
344+
}
345+
}
346+
334347
#[cfg(test)]
335348
mod tests {
336349
use super::*;

tests/difftests/lib/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ repository.workspace = true
88

99
# See rustc_codegen_spirv/Cargo.toml for details on these features
1010
[features]
11-
default = ["use-compiled-tools"]
1211
use-installed-tools = [
1312
"spirv-builder/use-installed-tools"
1413
]

0 commit comments

Comments
 (0)