11use super :: { flags:: Flags , ChangeIdWrapper , Config } ;
22use crate :: core:: build_steps:: clippy:: get_clippy_rules_in_order;
3+ use crate :: core:: config:: Target ;
4+ use crate :: core:: config:: TargetSelection ;
35use crate :: core:: config:: { LldMode , TomlConfig } ;
46
57use clap:: CommandFactory ;
@@ -124,6 +126,10 @@ fn override_toml() {
124126 "--set=build.gdb=\" bar\" " . to_owned ( ) ,
125127 "--set=build.tools=[\" cargo\" ]" . to_owned ( ) ,
126128 "--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 ( ) ,
127133 ] ,
128134 |& _| {
129135 toml:: from_str (
@@ -140,6 +146,17 @@ tools = []
140146[llvm]
141147download-ci-llvm = false
142148build-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+
143160 "# ,
144161 )
145162 . unwrap ( )
@@ -163,6 +180,30 @@ build-config = {}
163180 [ ( "foo" . to_string( ) , "bar" . to_string( ) ) ] . into_iter( ) . collect( ) ,
164181 "setting dictionary value"
165182 ) ;
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+ ) ;
166207}
167208
168209#[ test]
0 commit comments