summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-11-26 22:43:30 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-12-29 23:36:21 +0100
commit52c18e60929b64285d4bb333f87482d954c9b2e0 (patch)
tree836ab3a01d160f45cda4f5a28522fc0bf471011c /test
First commitfirst-step
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt5
-rwxr-xr-xtest/example.wasmbin0 -> 522 bytes
-rw-r--r--test/main.c18
3 files changed, 23 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..0a24f9a
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+project(test C)
+add_executable(${PROJECT_NAME} main.c)
+target_link_libraries(${PROJECT_NAME} PRIVATE wasmfs)
+target_link_options(${PROJECT_NAME} PRIVATE -Wl,--gc-sections)
diff --git a/test/example.wasm b/test/example.wasm
new file mode 100755
index 0000000..3e4bd01
--- /dev/null
+++ b/test/example.wasm
Binary files differ
diff --git a/test/main.c b/test/main.c
new file mode 100644
index 0000000..d88552e
--- /dev/null
+++ b/test/main.c
@@ -0,0 +1,18 @@
+#include <wasmfs.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+ struct wasmfs *const w = wasmfs_load("example.wasm");
+
+ if (!w)
+ {
+ fprintf(stderr, "%s: wasmfs_load failed\n", __func__);
+ return EXIT_FAILURE;
+ }
+
+ wasmfs_unload(w);
+ return EXIT_SUCCESS;
+}