diff options
| author | ruki <[email protected]> | 2024-04-01 23:24:42 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-04-01 23:24:42 +0800 |
| commit | 15eb20076e2334387155c85b491c73da04e4a084 (patch) | |
| tree | a1ffcf5f99f666462adbd0ff6c2c10ffad3233a4 | |
| parent | 0a6b4953c793011f5a786214eb8f510ee0aad6aa (diff) | |
add native module tests
| -rw-r--r-- | tests/projects/other/native_module/.gitignore | 8 | ||||
| -rw-r--r-- | tests/projects/other/native_module/src/main.cpp | 9 | ||||
| -rw-r--r-- | tests/projects/other/native_module/xmake.lua | 14 |
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/projects/other/native_module/.gitignore b/tests/projects/other/native_module/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/tests/projects/other/native_module/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/tests/projects/other/native_module/src/main.cpp b/tests/projects/other/native_module/src/main.cpp new file mode 100644 index 000000000..7c435d251 --- /dev/null +++ b/tests/projects/other/native_module/src/main.cpp @@ -0,0 +1,9 @@ +#include <iostream> + +using namespace std; + +int main(int argc, char** argv) +{ + cout << "hello world!" << endl; + return 0; +} diff --git a/tests/projects/other/native_module/xmake.lua b/tests/projects/other/native_module/xmake.lua new file mode 100644 index 000000000..98a02399e --- /dev/null +++ b/tests/projects/other/native_module/xmake.lua @@ -0,0 +1,14 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("test") + set_kind("binary") + add_files("src/*.cpp") + on_config(function (target) + import("shared.foo") +-- import("binary.bar") + print("1 + 1 = %d", foo.add(1, 1)) +-- print("1 - 1 = %s", bar.sub("1", "1")) + end) + |
