From cce8dcb735e1c046aa76119bcc23e5ca8d1d6313 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 21 Sep 2023 10:05:23 +0200 Subject: [PATCH 1/2] guide: add missing and fix incorrect testing info in the contributing section. Some tests need `WASM_BINDGEN_SPLIT_LINKED_MODULES` set to run through, and the macro ui-tests are not a workspace package anymore Signed-off-by: Dominik Csapak --- guide/src/contributing/testing.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guide/src/contributing/testing.md b/guide/src/contributing/testing.md index fe3bca622a4..3e928312518 100644 --- a/guide/src/contributing/testing.md +++ b/guide/src/contributing/testing.md @@ -7,7 +7,7 @@ These are the largest test suites, and most common to run in day to day Node.js or a headless browser via the WebDriver protocol. ```bash -cargo test --target wasm32-unknown-unknown +WASM_BINDGEN_SPLIT_LINKED_MODULES=1 cargo test --target wasm32-unknown-unknown ``` See [the `wasm-bindgen-test` crate's @@ -34,8 +34,11 @@ cargo test -p webidl-tests --target wasm32-unknown-unknown These tests assert that we have reasonable error messages that point to the right source spans when the `#[wasm_bindgen]` proc-macro is misused. +You can run these tests by running `cargo test` in the `crates/macro` directory: + ``` -cargo test -p ui-tests +cd crates/macro +cargo test ``` ## The `js-sys` Tests From 6c6501a10d0e6a38950d9f9e0d6790d10e77afd0 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 21 Sep 2023 10:31:25 +0200 Subject: [PATCH 2/2] guide: improve macro test invocation by using `-p wasm-bindgen-macro` instead of changing dir to `crates/macro` Signed-off-by: Dominik Csapak --- guide/src/contributing/testing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guide/src/contributing/testing.md b/guide/src/contributing/testing.md index 3e928312518..4fa5ec0a2fc 100644 --- a/guide/src/contributing/testing.md +++ b/guide/src/contributing/testing.md @@ -34,11 +34,11 @@ cargo test -p webidl-tests --target wasm32-unknown-unknown These tests assert that we have reasonable error messages that point to the right source spans when the `#[wasm_bindgen]` proc-macro is misused. -You can run these tests by running `cargo test` in the `crates/macro` directory: +You can run these tests by running `cargo test` for the `wasm-bindgen-macro` +crate: ``` -cd crates/macro -cargo test +cargo test -p wasm-bindgen-macro ``` ## The `js-sys` Tests