]> git.proxmox.com Git - cargo.git/commitdiff
Remove test that requires Emscripten
authorAlex Crichton <alex@alexcrichton.com>
Wed, 24 Jan 2018 17:45:01 +0000 (09:45 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 24 Jan 2018 17:45:01 +0000 (09:45 -0800)
This seems relatively unlikely to regress in the future and otherwise arranging
Cargo to have a rustc that has Emscripten support will become difficult in the
near future in the Rust repo. All in all it seems like the course of action to
take is to delete this test for now.

tests/build.rs

index 1ca01cabffe901f8fccd44eb9da30b4147b6fa91..14237e4c9b14e8f82c40ba9d8d5f00e4ce72e5c1 100644 (file)
@@ -3764,107 +3764,6 @@ fn cdylib_final_outputs() {
     }
 }
 
-#[test]
-fn wasm32_final_outputs() {
-    use cargo::core::{Shell, Target, Workspace};
-    use cargo::ops::{self, BuildConfig, Context, CompileMode, CompileOptions, Kind, Unit};
-    use cargo::util::Config;
-    use cargo::util::important_paths::find_root_manifest_for_wd;
-
-    let target_triple = "wasm32-unknown-emscripten";
-
-    let p = project("foo")
-        .file("Cargo.toml", r#"
-            [project]
-            name = "foo-bar"
-            authors = []
-            version = "0.1.0"
-        "#)
-        .file("src/main.rs", "fn main() {}")
-        .build();
-
-    // We can't cross-compile the project to wasm target unless we have emscripten installed.
-    // So here we will not run `cargo build`, but just create cargo_rustc::Context and ask it
-    // what the target file names would be.
-
-    // Create various stuff required to build cargo_rustc::Context.
-    let shell = Shell::new();
-    let config = Config::new(shell, p.root(), p.root());
-    let root = find_root_manifest_for_wd(None, config.cwd()).expect("Can't find the root manifest");
-    let ws = Workspace::new(&root, &config).expect("Can't create workspace");
-
-    let opts = CompileOptions {
-        target: Some(target_triple),
-        .. CompileOptions::default(&config, CompileMode::Build)
-    };
-
-    let specs = opts.spec.into_package_id_specs(&ws).expect("Can't create specs");
-
-    let (packages, resolve) = ops::resolve_ws_precisely(
-        &ws,
-        None,
-        opts.features,
-        opts.all_features,
-        opts.no_default_features,
-        &specs,
-    ).expect("Can't create resolve");
-
-    let build_config = BuildConfig {
-        requested_target: Some(target_triple.to_string()),
-        jobs: 1,
-        .. BuildConfig::default()
-    };
-
-    let pkgid = packages
-        .package_ids()
-        .filter(|id| id.name() == "foo-bar")
-        .collect::<Vec<_>>();
-    let pkg = packages.get(pkgid[0]).expect("Can't get package");
-
-    let target = Target::bin_target("foo-bar", p.root().join("src/main.rs"), None);
-
-    let unit = Unit {
-        pkg: &pkg,
-        target: &target,
-        profile: &ws.profiles().dev,
-        kind: Kind::Target,
-    };
-    let units = vec![unit];
-
-    // Finally, create the cargo_rustc::Context.
-    let mut ctx = Context::new(
-        &ws,
-        &resolve,
-        &packages,
-        &config,
-        build_config,
-        ws.profiles(),
-    ).expect("Can't create context");
-
-    // Ask the context to resolve target file names.
-    ctx.probe_target_info(&units).expect("Can't probe target info");
-    let target_filenames = ctx.target_filenames(&unit).expect("Can't get target file names");
-
-    // Verify the result.
-    let mut expected = vec!["debug/foo-bar.js", "debug/foo_bar.wasm"];
-
-    assert_eq!(target_filenames.len(), expected.len());
-
-    let mut target_filenames = target_filenames
-        .iter()
-        .map(|&(_, ref link_dst, _)| link_dst.clone().unwrap())
-        .collect::<Vec<_>>();
-    target_filenames.sort();
-    expected.sort();
-
-    for (expected, actual) in expected.iter().zip(target_filenames.iter()) {
-        assert!(
-            actual.ends_with(expected),
-            format!("{:?} does not end with {}", actual, expected)
-        );
-    }
-}
-
 #[test]
 fn deterministic_cfg_flags() {
     // This bug is non-deterministic