summaryrefslogtreecommitdiff
path: root/tests/projects/c++/modules/xmake_tests1
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_tests1
parentb024a424af7511f2d64794b84e08aced3de935e4 (diff)
add tests
Diffstat (limited to 'tests/projects/c++/modules/xmake_tests1')
-rw-r--r--tests/projects/c++/modules/xmake_tests1/src/foo.cppm3
-rw-r--r--tests/projects/c++/modules/xmake_tests1/src/main.cpp3
-rw-r--r--tests/projects/c++/modules/xmake_tests1/test.lua1
-rw-r--r--tests/projects/c++/modules/xmake_tests1/xmake.lua15
4 files changed, 22 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/xmake_tests1/src/foo.cppm b/tests/projects/c++/modules/xmake_tests1/src/foo.cppm
new file mode 100644
index 000000000..d0cb72703
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests1/src/foo.cppm
@@ -0,0 +1,3 @@
+export module Foo;
+
+export inline int foo() { return 0; }
diff --git a/tests/projects/c++/modules/xmake_tests1/src/main.cpp b/tests/projects/c++/modules/xmake_tests1/src/main.cpp
new file mode 100644
index 000000000..7a7488a3b
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests1/src/main.cpp
@@ -0,0 +1,3 @@
+import Foo;
+
+int main() { return foo(); }
diff --git a/tests/projects/c++/modules/xmake_tests1/test.lua b/tests/projects/c++/modules/xmake_tests1/test.lua
new file mode 100644
index 000000000..25ca8a7a3
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests1/test.lua
@@ -0,0 +1 @@
+inherit(".test_xmake_test")
diff --git a/tests/projects/c++/modules/xmake_tests1/xmake.lua b/tests/projects/c++/modules/xmake_tests1/xmake.lua
new file mode 100644
index 000000000..64198ec69
--- /dev/null
+++ b/tests/projects/c++/modules/xmake_tests1/xmake.lua
@@ -0,0 +1,15 @@
+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_target')
+ set_kind('moduleonly')
+ add_files('src/*.cppm')
+
+add_deps('module_dep')
+ add_tests('test', { kind = 'binary', files = 'src/main.cpp', build_should_pass = true })
+ add_tests('test2', { kind = 'binary', files = 'src/main.cpp', build_should_pass = true })