summaryrefslogtreecommitdiff
path: root/tests/actions/package/localpkg/libfoo
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-02 22:48:05 +0800
committerruki <[email protected]>2021-06-02 22:48:05 +0800
commiteee121636be554cdeef8907bd0d2fac6a23304a6 (patch)
tree1fe24ca4d7fe8740bc222c75aa28ad03b978da63 /tests/actions/package/localpkg/libfoo
parent4223c60a70bf0220f15c18fe3ec4a5dda24b317a (diff)
add localpkg test
Diffstat (limited to 'tests/actions/package/localpkg/libfoo')
-rw-r--r--tests/actions/package/localpkg/libfoo/.gitignore8
-rw-r--r--tests/actions/package/localpkg/libfoo/src/interface.cpp6
-rw-r--r--tests/actions/package/localpkg/libfoo/src/interface.h16
-rw-r--r--tests/actions/package/localpkg/libfoo/xmake.lua8
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/actions/package/localpkg/libfoo/.gitignore b/tests/actions/package/localpkg/libfoo/.gitignore
new file mode 100644
index 000000000..152105761
--- /dev/null
+++ b/tests/actions/package/localpkg/libfoo/.gitignore
@@ -0,0 +1,8 @@
+# Xmake cache
+.xmake/
+build/
+
+# MacOS Cache
+.DS_Store
+
+
diff --git a/tests/actions/package/localpkg/libfoo/src/interface.cpp b/tests/actions/package/localpkg/libfoo/src/interface.cpp
new file mode 100644
index 000000000..598d07560
--- /dev/null
+++ b/tests/actions/package/localpkg/libfoo/src/interface.cpp
@@ -0,0 +1,6 @@
+#include "interface.h"
+
+int add(int a, int b)
+{
+ return a + b;
+}
diff --git a/tests/actions/package/localpkg/libfoo/src/interface.h b/tests/actions/package/localpkg/libfoo/src/interface.h
new file mode 100644
index 000000000..62a39427c
--- /dev/null
+++ b/tests/actions/package/localpkg/libfoo/src/interface.h
@@ -0,0 +1,16 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! calculate add(a, b)
+ *
+ * @param a the first argument
+ * @param b the second argument
+ *
+ * @return the result
+ */
+int add(int a, int b);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/tests/actions/package/localpkg/libfoo/xmake.lua b/tests/actions/package/localpkg/libfoo/xmake.lua
new file mode 100644
index 000000000..01419c241
--- /dev/null
+++ b/tests/actions/package/localpkg/libfoo/xmake.lua
@@ -0,0 +1,8 @@
+add_rules("mode.debug", "mode.release")
+
+target("foo")
+ set_kind("static")
+ add_files("src/interface.cpp")
+ add_headerfiles("src/*.h")
+
+