@@ -3505,3 +3505,80 @@ impl Step for CodegenGCC {
35053505 cargo. into_cmd ( ) . run ( builder) ;
35063506 }
35073507}
3508+
3509+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
3510+ pub struct TestFloatParse {
3511+ path : PathBuf ,
3512+ host : TargetSelection ,
3513+ }
3514+
3515+ impl Step for TestFloatParse {
3516+ type Output = ( ) ;
3517+ const ONLY_HOSTS : bool = true ;
3518+ const DEFAULT : bool = true ;
3519+
3520+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
3521+ run. path ( "src/etc/test-float-parse" )
3522+ }
3523+
3524+ fn make_run ( run : RunConfig < ' _ > ) {
3525+ for path in run. paths {
3526+ let path = path. assert_single_path ( ) . path . clone ( ) ;
3527+ run. builder . ensure ( Self { path, host : run. target } ) ;
3528+ }
3529+ }
3530+
3531+ fn run ( self , builder : & Builder < ' _ > ) {
3532+ let bootstrap_host = builder. config . build ;
3533+ let compiler = builder. compiler ( 0 , bootstrap_host) ;
3534+ let path = self . path . to_str ( ) . unwrap ( ) ;
3535+ let crate_name = self . path . components ( ) . last ( ) . unwrap ( ) . as_os_str ( ) . to_str ( ) . unwrap ( ) ;
3536+
3537+ builder. ensure ( compile:: Std :: new ( compiler, self . host ) ) ;
3538+
3539+ // Run any unit tests in the crate
3540+ let cargo_test = tool:: prepare_tool_cargo (
3541+ builder,
3542+ compiler,
3543+ Mode :: ToolStd ,
3544+ bootstrap_host,
3545+ "test" ,
3546+ path,
3547+ SourceType :: InTree ,
3548+ & [ ] ,
3549+ ) ;
3550+
3551+ run_cargo_test (
3552+ cargo_test,
3553+ & [ ] ,
3554+ & [ ] ,
3555+ crate_name,
3556+ crate_name,
3557+ compiler,
3558+ bootstrap_host,
3559+ builder,
3560+ ) ;
3561+
3562+ // Run the actual parse tests.
3563+ let mut cargo_run = tool:: prepare_tool_cargo (
3564+ builder,
3565+ compiler,
3566+ Mode :: ToolStd ,
3567+ bootstrap_host,
3568+ "run" ,
3569+ path,
3570+ SourceType :: InTree ,
3571+ & [ ] ,
3572+ ) ;
3573+
3574+ cargo_run. arg ( "--" ) ;
3575+ if builder. config . args ( ) . is_empty ( ) {
3576+ // By default, exclude tests that take longer than ~1m.
3577+ cargo_run. arg ( "--skip-huge" ) ;
3578+ } else {
3579+ cargo_run. args ( builder. config . args ( ) ) ;
3580+ }
3581+
3582+ cargo_run. into_cmd ( ) . run ( builder) ;
3583+ }
3584+ }
0 commit comments