Skip to content

Commit

Permalink
Use wasm32-unknown-unknown as the default build target (yewstack#702)
Browse files Browse the repository at this point in the history
* Use wasm32-unknown-unknown as the default build target

* Print rustup installed targets

* Add doc_test alias
  • Loading branch information
jstarry authored and llebout committed Jan 20, 2020
1 parent c18311a commit 33c1fe1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[target.'cfg(not(not(feature = "doc_test")))']
target = 'wasm32-unknown-unknown'

[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))']
runner = 'wasm-bindgen-test-runner'

[alias]
doc_test = "test --doc --features doc_test"
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ install:
- ./ci/install_cargo_web.sh

script:
- rustup target list --installed
- cargo fmt --all -- --check
- CHROMEDRIVER=$(pwd)/chromedriver ./ci/run_tests.sh
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ wasm-bindgen-test = "=0.2.50"

[features]
default = []
doc_test = []
web_test = []
wasm_test = []
yaml = ["serde_yaml"]
Expand Down
4 changes: 2 additions & 2 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ echo "Testing derive props macro..."
cargo test --test derive_props_test

echo "Testing docs"
cargo test --doc
cargo doc_test

echo "Testing macro docs..."
(cd crates/macro && cargo test)
(cd crates/macro && cargo doc_test)

check_example() {
echo "Checking example [$2]"
Expand Down
3 changes: 3 additions & 0 deletions crates/macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ yew = { path = "../.." }

[build-dependencies]
autocfg = "0.1.3"

[features]
doc_test = []

0 comments on commit 33c1fe1

Please sign in to comment.