mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 06:38:22 +00:00
test(c-api) Create a tests/wasmer_wasm.h file.
Remove the `build.rs` hack to add helper functions that are used only in our tests. Now the tests can use the `tests/wasmer_wasm.h` file, which simplifies the test workflow: No need to hack the build script or anything if we want to add a helper function.
This commit is contained in:
@@ -123,8 +123,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_module_validate() {
|
||||
(assert_c! {
|
||||
#include <assert.h>
|
||||
#include "wasmer_wasm.h"
|
||||
#include "tests/wasmer_wasm.h"
|
||||
|
||||
int main() {
|
||||
wasm_engine_t* engine = wasm_engine_new();
|
||||
@@ -149,8 +148,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_module_new() {
|
||||
(assert_c! {
|
||||
#include <assert.h>
|
||||
#include "wasmer_wasm.h"
|
||||
#include "tests/wasmer_wasm.h"
|
||||
|
||||
int main() {
|
||||
wasm_engine_t* engine = wasm_engine_new();
|
||||
@@ -177,8 +175,7 @@ mod tests {
|
||||
fn test_module_exports() {
|
||||
(assert_c! {
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "wasmer_wasm.h"
|
||||
#include "tests/wasmer_wasm.h"
|
||||
|
||||
void assert_exporttype_name(const wasm_exporttype_t* exporttype, const char* expected) {
|
||||
assert(strncmp(wasm_exporttype_name(exporttype)->data, expected, strlen(expected)) == 0);
|
||||
|
||||
Reference in New Issue
Block a user