Skip to content

Commit

Permalink
Align the integration tests to the support for debug builds on `wasm3…
Browse files Browse the repository at this point in the history
…2-unknown-unknown`
  • Loading branch information
koute committed Dec 11, 2018
1 parent 9d7bb16 commit 5a584c1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions integration-tests/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,7 @@ macro_rules! common_tests { (($($attr:tt)*) $namespace:ident, $target:expr) => {
fn prepend_js() {
let cwd = crate_path( "prepend-js" );
assert_builds( $target, "prepend-js" );
// TODO: We should run cargo-web with `--message-format=json` and grab this path automatically.
let build_dir = if $target == Wasm32UnknownUnknown { "release" } else { "debug" };
let output = cwd.join( "target" ).join( $target.to_str() ).join( build_dir ).join( "prepend-js.js" );
let output = cwd.join( "target" ).join( $target.to_str() ).join( "debug" ).join( "prepend-js.js" );
assert_file_contains( output, "alert('THIS IS A TEST');" );
}

Expand Down Expand Up @@ -451,15 +449,15 @@ fn cdylib() {
let cwd = crate_path( "cdylib" );
run( &cwd, &*CARGO_WEB, &["build", "--target", "wasm32-unknown-unknown"] ).assert_success();
run( &cwd, &*CARGO_WEB, &["deploy", "--target", "wasm32-unknown-unknown"] ).assert_success();
run( &cwd, &*NODEJS, &[cwd.join( "target/wasm32-unknown-unknown/release/cdylib.js" )] ).assert_success();
run( &cwd, &*NODEJS, &[cwd.join( "target/wasm32-unknown-unknown/debug/cdylib.js" )] ).assert_success();
}

#[cfg_attr(not(test_wasm32_unknown_unknown), ignore)]
#[test]
fn default_target_wasm32_unknown_unknown() {
let cwd = crate_path( "default-target-wasm32-unknown-unknown" );
run( &cwd, &*CARGO_WEB, &["build"] ).assert_success();
assert_file_exists( cwd.join( "target/wasm32-unknown-unknown/release/default-target-wasm32-unknown-unknown.js" ) );
assert_file_exists( cwd.join( "target/wasm32-unknown-unknown/debug/default-target-wasm32-unknown-unknown.js" ) );
run( &cwd, &*CARGO_WEB, &["deploy"] ).assert_success();
}

Expand Down

0 comments on commit 5a584c1

Please sign in to comment.