* 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
* 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
* 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
* 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