summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorruki <[email protected]>2024-07-05 23:01:33 +0800
committerGitHub <[email protected]>2024-07-05 23:01:33 +0800
commit3f1be27ffff37f07bbfe3f97f946d0d35c62ce1e (patch)
treeb230521b4b090ce757fd6886cbfd010c857a7c86 /tests
parent71db286a686ab5ecc4f7430fe8ee8e9200027b97 (diff)
parenta388acc43c93d75879b97698034ae72778cea295 (diff)
Merge pull request #5302 from al1-ce/dev
Improve Vala support
Diffstat (limited to 'tests')
-rw-r--r--tests/projects/vala/includec/src/main.vala9
-rw-r--r--tests/projects/vala/includec/src/printer.c6
-rw-r--r--tests/projects/vala/includec/src/printer.vala3
-rw-r--r--tests/projects/vala/includec/xmake.lua10
4 files changed, 28 insertions, 0 deletions
diff --git a/tests/projects/vala/includec/src/main.vala b/tests/projects/vala/includec/src/main.vala
new file mode 100644
index 000000000..acc6c7363
--- /dev/null
+++ b/tests/projects/vala/includec/src/main.vala
@@ -0,0 +1,9 @@
+extern void printer_from_c();
+
+int main (string[] args) {
+ printer_from_c();
+ printer_from_other_file();
+
+ return 0;
+}
+
diff --git a/tests/projects/vala/includec/src/printer.c b/tests/projects/vala/includec/src/printer.c
new file mode 100644
index 000000000..dc7a82c67
--- /dev/null
+++ b/tests/projects/vala/includec/src/printer.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void printer_from_c() {
+ printf("Calling from C");
+}
+
diff --git a/tests/projects/vala/includec/src/printer.vala b/tests/projects/vala/includec/src/printer.vala
new file mode 100644
index 000000000..4599c3529
--- /dev/null
+++ b/tests/projects/vala/includec/src/printer.vala
@@ -0,0 +1,3 @@
+void printer_from_other_file() {
+ stdout.printf("Calling from other file");
+}
diff --git a/tests/projects/vala/includec/xmake.lua b/tests/projects/vala/includec/xmake.lua
new file mode 100644
index 000000000..01b3e3eb3
--- /dev/null
+++ b/tests/projects/vala/includec/xmake.lua
@@ -0,0 +1,10 @@
+add_rules("mode.release", "mode.debug")
+
+add_requires("glib")
+
+target("test")
+ set_kind("binary")
+ add_rules("vala")
+ add_files("src/*.vala")
+ add_files("src/*.c")
+ add_packages("glib")