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:
Ivan Enderlin
2020-11-03 10:41:00 +01:00
parent 059dfceb60
commit 1d208af530
7 changed files with 35 additions and 71 deletions

View File

@@ -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);