mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-12 16:41:21 +00:00
Add first c test to test the C api
This commit is contained in:
12
lib/runtime-c-api/tests/.gitignore
vendored
Normal file
12
lib/runtime-c-api/tests/.gitignore
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
CMakeLists.txt.user
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
test-instantiate
|
11
lib/runtime-c-api/tests/CMakeLists.txt
Normal file
11
lib/runtime-c-api/tests/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
cmake_minimum_required (VERSION 2.6)
|
||||
project (WasmerCApiTests)
|
||||
|
||||
add_executable(test-instantiate test-instantiate.c)
|
||||
|
||||
target_link_libraries(test-instantiate
|
||||
general "${CMAKE_SOURCE_DIR}/../../../target/debug/libwasmer_runtime_c_api.dylib")
|
||||
|
||||
enable_testing()
|
||||
add_test(test-instantiate test-instantiate)
|
||||
|
4
lib/runtime-c-api/tests/runtime_c_api_tests.rs
Normal file
4
lib/runtime-c-api/tests/runtime_c_api_tests.rs
Normal file
@ -0,0 +1,4 @@
|
||||
#[test]
|
||||
fn test_c_api() {
|
||||
// TODO run `cmake . && make && make test`
|
||||
}
|
9
lib/runtime-c-api/tests/test-instantiate.c
Normal file
9
lib/runtime-c-api/tests/test-instantiate.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include "../wasmer.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
wasmer_import_object_t *import_object = wasmer_import_object_new();
|
||||
wasmer_import_object_destroy(import_object);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user