@@ -3764,107 +3764,6 @@ fn cdylib_final_outputs() {
3764
3764
}
3765
3765
}
3766
3766
3767
- #[ test]
3768
- fn wasm32_final_outputs ( ) {
3769
- use cargo:: core:: { Shell , Target , Workspace } ;
3770
- use cargo:: ops:: { self , BuildConfig , Context , CompileMode , CompileOptions , Kind , Unit } ;
3771
- use cargo:: util:: Config ;
3772
- use cargo:: util:: important_paths:: find_root_manifest_for_wd;
3773
-
3774
- let target_triple = "wasm32-unknown-emscripten" ;
3775
-
3776
- let p = project ( "foo" )
3777
- . file ( "Cargo.toml" , r#"
3778
- [project]
3779
- name = "foo-bar"
3780
- authors = []
3781
- version = "0.1.0"
3782
- "# )
3783
- . file ( "src/main.rs" , "fn main() {}" )
3784
- . build ( ) ;
3785
-
3786
- // We can't cross-compile the project to wasm target unless we have emscripten installed.
3787
- // So here we will not run `cargo build`, but just create cargo_rustc::Context and ask it
3788
- // what the target file names would be.
3789
-
3790
- // Create various stuff required to build cargo_rustc::Context.
3791
- let shell = Shell :: new ( ) ;
3792
- let config = Config :: new ( shell, p. root ( ) , p. root ( ) ) ;
3793
- let root = find_root_manifest_for_wd ( None , config. cwd ( ) ) . expect ( "Can't find the root manifest" ) ;
3794
- let ws = Workspace :: new ( & root, & config) . expect ( "Can't create workspace" ) ;
3795
-
3796
- let opts = CompileOptions {
3797
- target : Some ( target_triple) ,
3798
- .. CompileOptions :: default ( & config, CompileMode :: Build )
3799
- } ;
3800
-
3801
- let specs = opts. spec . into_package_id_specs ( & ws) . expect ( "Can't create specs" ) ;
3802
-
3803
- let ( packages, resolve) = ops:: resolve_ws_precisely (
3804
- & ws,
3805
- None ,
3806
- opts. features ,
3807
- opts. all_features ,
3808
- opts. no_default_features ,
3809
- & specs,
3810
- ) . expect ( "Can't create resolve" ) ;
3811
-
3812
- let build_config = BuildConfig {
3813
- requested_target : Some ( target_triple. to_string ( ) ) ,
3814
- jobs : 1 ,
3815
- .. BuildConfig :: default ( )
3816
- } ;
3817
-
3818
- let pkgid = packages
3819
- . package_ids ( )
3820
- . filter ( |id| id. name ( ) == "foo-bar" )
3821
- . collect :: < Vec < _ > > ( ) ;
3822
- let pkg = packages. get ( pkgid[ 0 ] ) . expect ( "Can't get package" ) ;
3823
-
3824
- let target = Target :: bin_target ( "foo-bar" , p. root ( ) . join ( "src/main.rs" ) , None ) ;
3825
-
3826
- let unit = Unit {
3827
- pkg : & pkg,
3828
- target : & target,
3829
- profile : & ws. profiles ( ) . dev ,
3830
- kind : Kind :: Target ,
3831
- } ;
3832
- let units = vec ! [ unit] ;
3833
-
3834
- // Finally, create the cargo_rustc::Context.
3835
- let mut ctx = Context :: new (
3836
- & ws,
3837
- & resolve,
3838
- & packages,
3839
- & config,
3840
- build_config,
3841
- ws. profiles ( ) ,
3842
- ) . expect ( "Can't create context" ) ;
3843
-
3844
- // Ask the context to resolve target file names.
3845
- ctx. probe_target_info ( & units) . expect ( "Can't probe target info" ) ;
3846
- let target_filenames = ctx. target_filenames ( & unit) . expect ( "Can't get target file names" ) ;
3847
-
3848
- // Verify the result.
3849
- let mut expected = vec ! [ "debug/foo-bar.js" , "debug/foo_bar.wasm" ] ;
3850
-
3851
- assert_eq ! ( target_filenames. len( ) , expected. len( ) ) ;
3852
-
3853
- let mut target_filenames = target_filenames
3854
- . iter ( )
3855
- . map ( |& ( _, ref link_dst, _) | link_dst. clone ( ) . unwrap ( ) )
3856
- . collect :: < Vec < _ > > ( ) ;
3857
- target_filenames. sort ( ) ;
3858
- expected. sort ( ) ;
3859
-
3860
- for ( expected, actual) in expected. iter ( ) . zip ( target_filenames. iter ( ) ) {
3861
- assert ! (
3862
- actual. ends_with( expected) ,
3863
- format!( "{:?} does not end with {}" , actual, expected)
3864
- ) ;
3865
- }
3866
- }
3867
-
3868
3767
#[ test]
3869
3768
fn deterministic_cfg_flags ( ) {
3870
3769
// This bug is non-deterministic
0 commit comments