summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-10-12 22:49:05 +0800
committerruki <[email protected]>2023-10-12 22:49:05 +0800
commitacccacadd43f998d144865322eb2561698a2173d (patch)
treea127b6cf1bccc27d4dd0886d267f4753e285d3dd
parent74633ce5a35b554125c13c922c43287119adce34 (diff)
add custom scopeapis test
-rw-r--r--tests/apis/custom_scopeapis/.gitignore8
-rw-r--r--tests/apis/custom_scopeapis/src/main.cpp9
-rw-r--r--tests/apis/custom_scopeapis/xmake.lua13
3 files changed, 30 insertions, 0 deletions
diff --git a/tests/apis/custom_scopeapis/.gitignore b/tests/apis/custom_scopeapis/.gitignore
new file mode 100644
index 000000000..152105761
--- /dev/null
+++ b/tests/apis/custom_scopeapis/.gitignore
@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+
diff --git a/tests/apis/custom_scopeapis/src/main.cpp b/tests/apis/custom_scopeapis/src/main.cpp
new file mode 100644
index 000000000..7c435d251
--- /dev/null
+++ b/tests/apis/custom_scopeapis/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/apis/custom_scopeapis/xmake.lua b/tests/apis/custom_scopeapis/xmake.lua
new file mode 100644
index 000000000..ae88c3f73
--- /dev/null
+++ b/tests/apis/custom_scopeapis/xmake.lua
@@ -0,0 +1,13 @@
+add_rules("mode.debug", "mode.release")
+
+interp_add_scopeapis("myscope.set_name", "myscope.add_list", {kind = "values"})
+
+myscope("hello")
+ set_name("foo")
+ add_list("value1", "value2")
+
+target("test")
+ set_kind("binary")
+ add_files("src/*.cpp")
+
+