1
1
use super :: { flags:: Flags , ChangeIdWrapper , Config } ;
2
2
use crate :: core:: build_steps:: clippy:: get_clippy_rules_in_order;
3
+ use crate :: core:: config:: Target ;
4
+ use crate :: core:: config:: TargetSelection ;
3
5
use crate :: core:: config:: { LldMode , TomlConfig } ;
4
6
5
7
use clap:: CommandFactory ;
@@ -124,6 +126,10 @@ fn override_toml() {
124
126
"--set=build.gdb=\" bar\" " . to_owned ( ) ,
125
127
"--set=build.tools=[\" cargo\" ]" . to_owned ( ) ,
126
128
"--set=llvm.build-config={\" foo\" = \" bar\" }" . to_owned ( ) ,
129
+ "--set=target.x86_64-unknown-linux-gnu.runner=bar" . to_owned ( ) ,
130
+ "--set=target.x86_64-unknown-linux-gnu.rpath=false" . to_owned ( ) ,
131
+ "--set=target.aarch64-unknown-linux-gnu.sanitizers=false" . to_owned ( ) ,
132
+ "--set=target.aarch64-apple-darwin.runner=apple" . to_owned ( ) ,
127
133
] ,
128
134
|& _| {
129
135
toml:: from_str (
@@ -140,6 +146,17 @@ tools = []
140
146
[llvm]
141
147
download-ci-llvm = false
142
148
build-config = {}
149
+
150
+ [target.aarch64-unknown-linux-gnu]
151
+ sanitizers = true
152
+ rpath = true
153
+ runner = "aarch64-runner"
154
+
155
+ [target.x86_64-unknown-linux-gnu]
156
+ sanitizers = true
157
+ rpath = true
158
+ runner = "x86_64-runner"
159
+
143
160
"# ,
144
161
)
145
162
. unwrap ( )
@@ -163,6 +180,30 @@ build-config = {}
163
180
[ ( "foo" . to_string( ) , "bar" . to_string( ) ) ] . into_iter( ) . collect( ) ,
164
181
"setting dictionary value"
165
182
) ;
183
+
184
+ let x86_64 = TargetSelection :: from_user ( "x86_64-unknown-linux-gnu" ) ;
185
+ let x86_64_values = Target {
186
+ sanitizers : Some ( true ) ,
187
+ rpath : Some ( false ) ,
188
+ runner : Some ( "bar" . into ( ) ) ,
189
+ ..Default :: default ( )
190
+ } ;
191
+ let aarch64 = TargetSelection :: from_user ( "aarch64-unknown-linux-gnu" ) ;
192
+ let aarch64_values = Target {
193
+ sanitizers : Some ( false ) ,
194
+ rpath : Some ( true ) ,
195
+ runner : Some ( "aarch64-runner" . into ( ) ) ,
196
+ ..Default :: default ( )
197
+ } ;
198
+ let darwin = TargetSelection :: from_user ( "aarch64-apple-darwin" ) ;
199
+ let darwin_values = Target { runner : Some ( "apple" . into ( ) ) , ..Default :: default ( ) } ;
200
+ assert_eq ! (
201
+ config. target_config,
202
+ [ ( x86_64, x86_64_values) , ( aarch64, aarch64_values) , ( darwin, darwin_values) ]
203
+ . into_iter( )
204
+ . collect( ) ,
205
+ "setting dictionary value"
206
+ ) ;
166
207
}
167
208
168
209
#[ test]
0 commit comments