File tree Expand file tree Collapse file tree 5 files changed +49
-675
lines changed Expand file tree Collapse file tree 5 files changed +49
-675
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ edition.workspace = true
6
6
license.workspace = true
7
7
repository.workspace = true
8
8
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
+
9
15
[dependencies ]
10
16
anyhow = " 1.0"
11
17
tracing = " 0.1"
Original file line number Diff line number Diff line change @@ -72,12 +72,11 @@ fn main() -> Result<()> {
72
72
// We build first to ensure that the tests are compiled before running them and to
73
73
// passthrough stdout and stderr from cargo to help debugging.
74
74
let mut cmd = Command :: new ( "cargo" ) ;
75
- let cmd = cmd
76
- . arg ( "build" )
77
- . arg ( "--release" )
78
- . current_dir ( & base)
79
- . stderr ( std:: process:: Stdio :: inherit ( ) )
80
- . stdout ( std:: process:: Stdio :: inherit ( ) ) ;
75
+ let cmd = cmd. arg ( "build" ) . arg ( "--release" ) ;
76
+ runner:: forward_features ( cmd) ;
77
+ cmd. current_dir ( & base)
78
+ . stderr ( process:: Stdio :: inherit ( ) )
79
+ . stdout ( process:: Stdio :: inherit ( ) ) ;
81
80
tracing:: debug!( "Running cargo command: {:?}" , cmd) ;
82
81
83
82
let output = cmd. output ( ) . expect ( "build output" ) ;
Original file line number Diff line number Diff line change @@ -135,25 +135,22 @@ impl Runner {
135
135
trace ! ( "Config file created at {}" , config_file. path( ) . display( ) ) ;
136
136
137
137
let mut cmd = Command :: new ( "cargo" ) ;
138
- let cmd = cmd
139
- . arg ( "run" )
140
- . arg ( "--release" )
141
- . arg ( "--manifest-path" )
142
- . arg (
143
- manifest_path
144
- . to_str ( )
145
- . ok_or_else ( || RunnerError :: Manifest {
146
- path : manifest_path. clone ( ) ,
147
- } ) ?,
148
- )
149
- . arg (
150
- config_file
151
- . path ( )
152
- . to_str ( )
153
- . ok_or_else ( || RunnerError :: Config {
154
- msg : "Invalid config file path" . into ( ) ,
155
- } ) ?,
156
- ) ;
138
+ cmd. arg ( "run" ) . arg ( "--release" ) . arg ( "--manifest-path" ) . arg (
139
+ manifest_path
140
+ . to_str ( )
141
+ . ok_or_else ( || RunnerError :: Manifest {
142
+ path : manifest_path. clone ( ) ,
143
+ } ) ?,
144
+ ) ;
145
+ forward_features ( & mut cmd) ;
146
+ cmd. arg ( "--" ) . arg (
147
+ config_file
148
+ . path ( )
149
+ . to_str ( )
150
+ . ok_or_else ( || RunnerError :: Config {
151
+ msg : "Invalid config file path" . into ( ) ,
152
+ } ) ?,
153
+ ) ;
157
154
debug ! ( "Running cargo command: {:?}" , cmd) ;
158
155
159
156
let output = cmd
@@ -331,6 +328,18 @@ impl Runner {
331
328
}
332
329
}
333
330
331
+ pub fn forward_features ( cmd : & mut Command ) {
332
+ cmd. arg ( "--features" ) ;
333
+ #[ cfg( feature = "use-compiled-tools" ) ]
334
+ {
335
+ cmd. arg ( "difftest/use-compiled-tools" ) ;
336
+ }
337
+ #[ cfg( feature = "use-installed-tools" ) ]
338
+ {
339
+ cmd. arg ( "difftest/use-installed-tools" ) ;
340
+ }
341
+ }
342
+
334
343
#[ cfg( test) ]
335
344
mod tests {
336
345
use super :: * ;
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ repository.workspace = true
8
8
9
9
# See rustc_codegen_spirv/Cargo.toml for details on these features
10
10
[features ]
11
- default = [" use-compiled-tools" ]
12
11
use-installed-tools = [
13
12
" spirv-builder/use-installed-tools"
14
13
]
You can’t perform that action at this time.
0 commit comments