Commit Graph

16 Commits

Author SHA1 Message Date
Lukas Lihotzki
5c3f6ed46a
Fix links to WASM audio worklet example (#3030) 2022-08-14 09:17:45 +10:00
Lukas Lihotzki
d881d9da64
Add example with WASM audio worklet (#3017) 2022-08-13 20:12:17 +10:00
Liam Murphy
643a773429
Test examples in CI (#3015)
* Add a test that examples don't throw any errors

TODO:
- run all the tests, not just the ones which use webpack (also an issue with CI)
- fix webxr test
- run in CI
- share WebDriver instance between tests
- maybe ditch async, since we don't really need it here and it adds a bunch of dependencies and build time.

* Disable testing WebXR example

It isn't supported in Firefox yet, which is where we're running our tests.

* Test examples that aren't built with webpack

* Remove `WEBDRIVER` environment variable

It wouldn't have worked anyway because at least for the moment, I'm using one WebDriver session per test, and Firefox at least only allows one session to be connected.

I would like to make them share a session, in which case I could add this back, but I can't right now because Firefox hasn't implemented `LogEntry.source` yet, which is needed to figure out which log entries should fail which tests.

* Run in CI

* Use `Once` instead of `Mutex`

* Build `webxr` and `synchronous-instantiation` in CI

Although we can't test them, we can still build them.

* Add missing '`'

* Fix running of tests

* Only include dev deps when not compiling for wasm

* oops, those are the native tests

* Create build dirs before copying to them

* Install binaryen

* decompress

* Follow redirects

* Set `PATH` properly

* Use an absolute path

* Don't symlink `node_modules` and fix artifact download

* Enable `web_sys_unstable_apis`

This is needed for the `webxr` example.

* Increase timeout to 10s

* Increase timeout to 20s

This seems excessive but 10s is still sometimes failing.

* Disable testing the webgl example

* Add binaryen to PATH directly after installing

* Properly download the raytrace example artifacts

* Disable example tests instead of enabling everything else

* Move to a separate `example-tests` crate
2022-08-05 10:51:41 -05:00
Liam Murphy
0aa23f0897
Don't attempt to update rustup in CI (#2998)
For whatever reason, updating rustup sometimes fails on Windows (such as https://github.com/rustwasm/wasm-bindgen/runs/7375883557?check_suite_focus=true), so disable that since the version of rustup used has no effect on us anyway.
2022-07-18 08:21:45 -05:00
João Freires
321595803c
update nightly version (#2960) 2022-06-21 13:07:47 -05:00
Dominic Elm
3822e67149
Expose helpers to allow synchronous initialization (#2924)
* Expose helpers to allow synchronous initialization

* fixup: fix tests
2022-06-08 14:18:05 -05:00
Ivan Enderlin
6ec0ce1b3f
test(ci) Remove duplicate actions. (#2918)
I was wondering if running `cargo test --target wasm32-unknown-unknown`
_twice_ is necessary. If not, please discard this commit.
2022-05-31 09:23:38 -05:00
Liam Murphy
bea87f04de
Fix memory getter checks when using shared memory (#2899)
* Fix memory getter check for shared memory

* Run tests with multithreading enabled in CI
2022-05-18 09:50:58 -05:00
Liam Murphy
152816c101
Make Closure::new work on stable (#2891)
* Make `Closure::new` work on stable

I've removed the nightly requirement by replacing `Unsize<T>` with a custom `IntoWasmClosure<T>` trait, implemented for `Fn` and `FnMut`.

I don't think this is a breaking change, since I don't think any stability guarantees are provided for nightly.

* Update docs

I also removed an outdated note about closures only being able to take WASM primitive types.

* Remove nightly CI

* Don't attempt to enable the removed nightly feature in doc generation
2022-05-09 09:17:13 -05:00
Alex Crichton
0f083069ea Remove Windows from CI
I don't have the time right now to investigate this unfortunately.
2022-02-14 07:37:25 -08:00
HKalbasi
542ec7e222
init temporal apis (#2788) 2022-02-14 09:36:49 -06:00
Cormac Relf
ac87c8215b
Fix fn () -> Result<T, JsValue> leaking stack space (#2710)
* add Descriptor RESULT and Instruction::UnwrapResult

* ResultAbi / ResultAbiUnion

basic wasmresult support

one WasmResult ctor per WasmAbi

Remove WasmResult class

* Reverse the fields on ResultAbi, remove is_ok as err can be 0

impl OptionIntoWasmAbi for JsValue

* implement ResultAbi

* Add tests for `-> Result<T, JsError>`

* split result.rs tests in two

remove console_log

* initial implementation of `-> Result<T, JsError>`

describe Result<_,  JsError>

implement Intrinsics::ErrorNew

Revert impl From<()> for JsValue (src/lib.rs)

impl WasmDescribe etc for JsError

remove unused JsError

* docs on JsError, move to lib.rs

* Add test for returning Result<(), _>

* Add failing test for returning `Result<Option<f64>, _>`

This fails because the generated LoadRetptr instructions do not
have any conception of how big the previous args are. It only fails
when any part of T is an f64.

* Make LoadRetptr offsets factor in alignment and previously read values

* Add a doc comment to UnwrapResult

* Slight correction to a comment

* Better error message

* un-implement OptionIntoWasmAbi for JsValue, use discriminant instead

* Add some documentation from the PR discussion to ResultAbi

* un-implement OptionIntoWasmAbi for &'a JsValue too

* bless some UI tests, not sure why

* bless the CLI's output tests

* fix indentation of if (is_ok === 0) { throw ... } code

* add tests for async fn() -> Result<_, JsError> and custom error types

* cargo fmt

* fix bug where takeObject was missing

* support externref in UnwrapResult

* add a WASM_BINDGEN_EXTERNREF=1 test to ci

* getFromExternrefTable -> takeFromExternrefTable

Now we do not leak externrefs, as the take function
calls drop on them.

* rewrite outgoing_result

There was a crash where _outgoing inserted more than
one instruction, e.g. for string. In that case,
the deferred free() call was using the wrong popped
values, and tried to free nonsense formed by
the is_ok/err pair.

Now it does a similar idea, but without assuming exactly
one instruction will be pushed by self._outgoing().

* rename is_ok -> is_err, which makes generated glue easier to read

* update ui tests

* add a crashing (if you uncomment the throw) test of Result<String, _>

* add result-string reference test

* Fix the crashy Result<String, _> by setting ptr/len to 0 on error
2021-12-13 10:12:13 -06:00
Alex Crichton
a086f9442d
Use GitHub Actions for CI (#2720)
* Use GitHub Actions for CI

This commit migrates away from Azure Pipelines to GitHub Actions. I've
attempted to make sure everything is still tested and the various
auto-release mechanisms still work as well. Time will tell for sure
though!

* Tweak branch listings
2021-11-10 12:49:53 -06:00
Alex Crichton
128aed9611 Add dummy github actions config 2021-11-10 10:36:03 -08:00
Alex Crichton
b780348f55 Disable dependabot
It's not doing much for us any more, mostly just noise.
2021-08-19 08:19:48 -07:00
dependabot-preview[bot]
4e677bb73a
Upgrade to GitHub-native Dependabot (#2542)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-29 14:33:18 -05:00