Commit Graph

46 Commits

Author SHA1 Message Date
a1f2b27957 chore: Fix clippy lints in API create
Fix clippy lints in the API crate.

The fixes are in test code, which is ingored on CI, but the warnings are
annoying when developing.
2024-01-06 02:07:57 +01:00
b24025ad01 cargo clippy --fix --all 2022-12-21 00:49:45 +01:00
0a1a71fd6e Revert #3145
This reverst buggy commit e1e08f44b7
2022-11-21 11:09:19 -08:00
ba5c1b8b7c Try fixing CI issue w. TokenStream 2022-10-14 14:26:13 +02:00
67d650146c cargo clippy --fix 2022-10-14 13:00:55 +02:00
2552aec8b7 Fix "make lint" 2022-09-05 15:27:39 +02:00
d1062ae851 Fix "table_get" test again 2022-09-05 14:49:02 +02:00
d7fc2899b3 Switch Result<(), anyhow::Error> to Result<(), String>
This will make the tests pass on no-std JS
2022-09-05 13:41:36 +02:00
8eba3c3245 Fix universal_test panicking 2022-09-05 13:24:49 +02:00
0f1db67115 Disable table_get test (was not enabled previously) 2022-09-05 12:19:51 +02:00
f6c58990d3 Comment out tests that weren't run on JS before 2022-09-05 12:15:39 +02:00
416dbfa2b8 Remove ExternRef tests on -js target 2022-09-02 16:27:56 +02:00
3a24731985 Use #[universal_test] (PR review) 2022-09-02 16:25:38 +02:00
12a0261051 Unify tests between -sys and -js API 2022-08-31 14:25:46 +02:00
b30284897e feat(api) Merge js-api into api.
This patch takes the entire `wasmer-js` crate and merges it into the
`wasmer` crate.

Inside the `lib/api/src/` directory, there are 2 new directories:

1. a new `sys` directory, which contains the usual `wasmer` crate
   implementation,
2. a new directory `js`, which contains the implementation of
   `wasmer-js`.

The `Cargo.toml` file is still compatible. The `default` feature
fallbacks to `sys-default`, which enables the `sys` feature. All
features related to compilers or engines or anything else prior this
patch, activates the `sys` feature.

Parallel to that, there is a `js-default` and `js` features.

The `Cargo.toml` file is extensively documented to explain what are
dependencies, dev-dependencies, features and other sections related to
`sys` or to `js`.

There is a bug with `wasm_bindgen_test` where it doesn't compile or
look for tests in `tests/*/<test>.rs`. The hack is to name files
`tests/js_<test>.rs`. Ugly, but it works.
2021-07-23 12:10:49 +02:00
9b216cc5e5 Address testing related feedback
Expose inner VM externals as an unsafe method and move logic into the tests
2021-05-28 11:41:57 -07:00
97c4a03e67 Recompute Memory::ty, make it return by value
This is a requirement of the updated `imports.wast` spectest
2021-05-05 07:50:35 -07:00
dadc81296a cargo fmt 2021-04-21 16:06:12 -07:00
24bcc9349e cargo fmt 2021-04-21 15:42:47 -07:00
92af25a585 resolve conflict, replace two primary map to hash map 2021-04-20 16:50:05 -07:00
6a2116917f Fix up tests, make WasmerEnv: Send 2020-12-15 13:35:19 -08:00
69f834a9e8 Accept Into<FunctionType> as signatures 2020-12-14 13:08:15 +01:00
de6cb9c4c4 Merge branch 'master' into feature/host-env-prototype 2020-11-20 15:54:35 -08:00
84370c7930 Merge branch 'master' into feature/make-env-immutable 2020-11-18 15:40:11 -08:00
655ac093a2 Fix up helpers generated by WasmerEnv; add unchecked variant 2020-11-17 11:19:42 -08:00
75707106d9 Add test initializing and calling host function manually 2020-11-16 17:04:08 -08:00
5b67b2f3dc Merge branch 'master' into feature/host-env-prototype 2020-10-27 16:24:00 -07:00
962f3be626 Merge #1772
1772: Remove lifetime parameter from `NativeFunc` r=MarkMcCaskey a=MarkMcCaskey

Ran into this as an annoyance on #1739 ; will need to account for this when we fix the memory leak in `InstanceHandle`.

Note: the lifetime wasn't doing anything useful for us, this change doesn't make anything new possible (other than not having to deal with the lifetime parameter)

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <mark@wasmer.io>
2020-10-27 22:13:57 +00:00
608fbdca2a Remove lifetime parameter from NativeFunc
It wasn't doing anything anyways.
2020-10-27 14:37:24 -07:00
c9181e39c7 Enable these tests now that they pass.
Also fix a syntax error, use assert_eq! instead of assert! to compare two values for equality.

Also in passing, convert a comment about something not being done into a TODO.
2020-10-27 12:25:12 -07:00
a7abee6fb7 Add lazy abstraction, improve macro, use macro internally 2020-10-23 12:50:36 -07:00
d64908dc83 Fix package tests 2020-10-20 18:03:22 -07:00
e7ba7c1154 Fix remaining tests 2020-10-01 17:25:13 -07:00
b06f021612 Improved Function API 2020-07-21 20:02:01 -07:00
80ad395441 Fixed code linting 2020-07-16 12:33:00 -07:00
296f0969f0 Fixed tests 2020-07-16 12:28:42 -07:00
ffc1e28aa2 Remove all nightly dependencies 2020-07-01 15:11:41 -07:00
ef285aae6c Merge pull request #110 from wasmerio/feature/functions-own-their-envs
Change functions to own their `env`s
2020-06-16 13:36:05 -07:00
b00f899913 Update to Cranelift 0.65, wasmparser 0.57 2020-06-15 18:00:48 -07:00
b232b237b5 Fix API tests 2020-06-12 16:56:15 -07:00
5f5c7d6725 Clean up and comment out some NativeFunc tests for now 2020-06-09 12:36:07 -07:00
eb928e739c Implement host functions in 1 case, optimize NativeFunc::call
`NativeFunc::call` is about 8% faster in the case we're benchmarking
by avoiding allocating a vector for the params / returns, instead we
do logic to determine which is larger and use that, conditionally
copying it back to the rets array if needed.
2020-06-09 11:35:58 -07:00
3c76999925 Implement Exportable for &Ts too (for some T) 2020-06-08 16:26:47 -07:00
b46ea5b9cb Get NativeFunc passing basic tests 2020-06-08 12:53:00 -07:00
62fb4f79c1 Moved misc test into api test 2020-05-27 11:55:21 -07:00
7db247e07c Added basic external tests 2020-05-26 18:12:01 -07:00