summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/xmake_tests2
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2025-11-04 12:15:52 +0100
committerArthur LAURENT <[email protected]>2025-11-04 12:15:52 +0100
commit791bb25721f76b49b384b6f8657bac7660036b4a (patch)
tree081cae413a516844b1d7459fa58205c1e262bce9 /tests/projects/c++/modules/xmake_tests2
parentb024a424af7511f2d64794b84e08aced3de935e4 (diff)
add tests
Diffstat (limited to 'tests/projects/c++/modules/xmake_tests2')
-rw-r--r--tests/projects/c++/modules/xmake_tests2/src/foo.cppm3
-rw-r--r--tests/projects/c++/modules/xmake_tests2/src/main.cpp3
-rw-r--r--tests/projects/c++/modules/xmake_tests2/test.lua1
-rw-r--r--tests/projects/c++/modules/xmake_tests2/xmake.lua21
4 files changed, 28 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/xmake_tests2/src/foo.cppm b/tests/projects/c++/modules/xmake_tests2/src/foo.cppm
new file mode 100644
index 000000000..d0cb72703
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests2/src/foo.cppm
@@ -0,0 +1,3 @@
+export module Foo;
+
+export inline int foo() { return 0; }
diff --git a/tests/projects/c++/modules/xmake_tests2/src/main.cpp b/tests/projects/c++/modules/xmake_tests2/src/main.cpp
new file mode 100644
index 000000000..7a7488a3b
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests2/src/main.cpp
@@ -0,0 +1,3 @@
+import Foo;
+
+int main() { return foo(); }
diff --git a/tests/projects/c++/modules/xmake_tests2/test.lua b/tests/projects/c++/modules/xmake_tests2/test.lua
new file mode 100644
index 000000000..25ca8a7a3
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests2/test.lua
@@ -0,0 +1 @@
+inherit(".test_xmake_test")
diff --git a/tests/projects/c++/modules/xmake_tests2/xmake.lua b/tests/projects/c++/modules/xmake_tests2/xmake.lua
new file mode 100644
index 000000000..e5326b36d
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests2/xmake.lua
@@ -0,0 +1,21 @@
+add_rules("mode.debug", "mode.release")
+set_languages("c++23")
+set_policy("build.c++.modules.std", false)
+
+target("module_dep")
+ set_kind("moduleonly")
+ add_files("src/*.cppm")
+
+target("module_target1")
+ set_kind("moduleonly")
+ add_files("src/*.cppm")
+
+ add_deps("module_dep")
+ add_tests("tests", {kind = "binary", files = "src/main.cpp", build_should_pass = true})
+
+target("module_target2")
+ set_kind("moduleonly")
+ add_files("src/*.cppm")
+
+ add_deps("module_dep")
+ add_tests("tests", {kind = "binary", files = "src/main.cpp", build_should_pass = true})