Skip to content

Commit

Permalink
Merge #3117
Browse files Browse the repository at this point in the history
3117: Add tests for wasmer-cli create-{exe,obj} commands r=epilys a=epilys

Unified generated objects interfaces: both static and serialized objects
expose the same function signature to create the module:

  wasm_module_t* wasmer_object_module_new(wasm_store_t* store, const char* module_name);

Closes #3071 

Co-authored-by: Manos Pitsidianakis <[email protected]>
  • Loading branch information
bors[bot] and epilys authored Aug 22, 2022
2 parents a766959 + 4fdbd34 commit 8a6c987
Show file tree
Hide file tree
Showing 13 changed files with 433 additions and 420 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test-sys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ jobs:
'${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s
echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV
shell: bash
- name: Test
if: matrix.run_test && matrix.os != 'windows-2019'
run: |
make
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test
if: matrix.run_test && matrix.os != 'windows-2019'
run: |
Expand All @@ -215,6 +223,16 @@ jobs:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test integration CLI
if: matrix.run_test && matrix.os != 'windows-2019'
run: |
make && make build-capi && make package-capi && make package
export WASMER_DIR=`pwd`/package
make test-integration-cli
env:
TARGET: ${{ matrix.target }}
TARGET_DIR: target/${{ matrix.target }}/release
CARGO_TARGET: --target ${{ matrix.target }}
- name: Test
if: matrix.run_test && matrix.os == 'windows-2019'
run: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ test-examples:
$(CARGO_BINARY) test $(CARGO_TARGET) $(compiler_features) --features wasi --examples
$(CARGO_BINARY) test $(CARGO_TARGET) --release $(compiler_features) --features wasi --examples

test-integration:
$(CARGO_BINARY) test $(CARGO_TARGET) --no-fail-fast -p wasmer-integration-tests-cli
test-integration-cli:
$(CARGO_BINARY) test $(CARGO_TARGET) --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture

test-integration-ios:
$(CARGO_BINARY) test $(CARGO_TARGET) -p wasmer-integration-tests-ios
Expand Down
4 changes: 2 additions & 2 deletions lib/cli/src/c_gen/staticlib_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ wasm_byte_vec_t generate_serialized_data() {
return module_byte_vec;
}
wasm_module_t* wasmer_static_module_new(wasm_store_t* store, const char* wasm_name) {
// wasm_name intentionally unused for now: will be used in the future.
wasm_module_t* wasmer_object_module_new(wasm_store_t* store, const char* module_name) {
// module_name intentionally unused for now: will be used in the future.
wasm_byte_vec_t module_byte_vec = generate_serialized_data();
wasm_module_t* module = wasm_module_deserialize(store, &module_byte_vec);
free(module_byte_vec.data);
Expand Down
Loading

0 comments on commit 8a6c987

Please sign in to comment.