summaryrefslogtreecommitdiff
path: root/tests/projects
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-05-09 15:49:54 +0200
committerArthur LAURENT <[email protected]>2025-05-09 15:56:34 +0200
commit60b0eb86ed3291158e2bf82a1ff12730806194d4 (patch)
tree9da14cc3e806a1735f986f96d359d6d88c94b8ff /tests/projects
parent465e4dd065f1b6887189b07e29a0307213f7aca9 (diff)
(C++ modules support) add test for non named module with custom extension
Diffstat (limited to 'tests/projects')
-rw-r--r--tests/projects/c++/modules/hello_mpp/src/hello.mpp10
-rw-r--r--tests/projects/c++/modules/hello_mpp/src/main.mpp6
-rw-r--r--tests/projects/c++/modules/hello_mpp/test.lua1
-rw-r--r--tests/projects/c++/modules/hello_mpp/xmake.lua6
4 files changed, 23 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/hello_mpp/src/hello.mpp b/tests/projects/c++/modules/hello_mpp/src/hello.mpp
new file mode 100644
index 000000000..124bd72bc
--- /dev/null
+++ b/tests/projects/c++/modules/hello_mpp/src/hello.mpp
@@ -0,0 +1,10 @@
+module;
+#include <cstdio>
+
+export module hello;
+
+export namespace hello {
+ void say(const char* str) {
+ printf("%s\n", str);
+ }
+}
diff --git a/tests/projects/c++/modules/hello_mpp/src/main.mpp b/tests/projects/c++/modules/hello_mpp/src/main.mpp
new file mode 100644
index 000000000..3746aa4a4
--- /dev/null
+++ b/tests/projects/c++/modules/hello_mpp/src/main.mpp
@@ -0,0 +1,6 @@
+#include <print>
+
+int main() {
+ std::print("Hello world\n");
+ return 0;
+}
diff --git a/tests/projects/c++/modules/hello_mpp/test.lua b/tests/projects/c++/modules/hello_mpp/test.lua
new file mode 100644
index 000000000..7717f8049
--- /dev/null
+++ b/tests/projects/c++/modules/hello_mpp/test.lua
@@ -0,0 +1 @@
+inherit(".test_base")
diff --git a/tests/projects/c++/modules/hello_mpp/xmake.lua b/tests/projects/c++/modules/hello_mpp/xmake.lua
new file mode 100644
index 000000000..141a87a5b
--- /dev/null
+++ b/tests/projects/c++/modules/hello_mpp/xmake.lua
@@ -0,0 +1,6 @@
+add_rules("mode.release", "mode.debug")
+set_languages("c++23")
+
+target("hello")
+ set_kind("binary")
+ add_files("src/*.mpp")