diff options
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/vala/sharedlib/src/main.vala | 6 | ||||
| -rw-r--r-- | tests/projects/vala/sharedlib/src/mymath.vala | 9 | ||||
| -rw-r--r-- | tests/projects/vala/sharedlib/xmake.lua | 18 | ||||
| -rw-r--r-- | tests/projects/vala/staticlib/src/main.vala | 6 | ||||
| -rw-r--r-- | tests/projects/vala/staticlib/src/mymath.vala | 9 | ||||
| -rw-r--r-- | tests/projects/vala/staticlib/xmake.lua | 18 |
6 files changed, 66 insertions, 0 deletions
diff --git a/tests/projects/vala/sharedlib/src/main.vala b/tests/projects/vala/sharedlib/src/main.vala new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/tests/projects/vala/sharedlib/src/main.vala @@ -0,0 +1,6 @@ +using MyMath; + +public void main() { + stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); + stdout.printf("\n\t8 squared is %d\n", square(8)); +} diff --git a/tests/projects/vala/sharedlib/src/mymath.vala b/tests/projects/vala/sharedlib/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/tests/projects/vala/sharedlib/src/mymath.vala @@ -0,0 +1,9 @@ +namespace MyMath { + public int sum(int a, int b) { + return(a + b); + } + + public int square(int a) { + return(a * a); + } +} diff --git a/tests/projects/vala/sharedlib/xmake.lua b/tests/projects/vala/sharedlib/xmake.lua new file mode 100644 index 000000000..10c90c88b --- /dev/null +++ b/tests/projects/vala/sharedlib/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.release", "mode.debug") + +add_requires("glib") + +target("mymath") + set_kind("shared") + add_rules("vala") + add_files("src/mymath.vala") + add_values("vala.header", "mymath.h") + add_values("vala.vapi", "mymath-1.0.vapi") + add_packages("glib") + +target("test") + set_kind("binary") + add_deps("mymath") + add_rules("vala") + add_files("src/main.vala") + add_packages("glib") diff --git a/tests/projects/vala/staticlib/src/main.vala b/tests/projects/vala/staticlib/src/main.vala new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/tests/projects/vala/staticlib/src/main.vala @@ -0,0 +1,6 @@ +using MyMath; + +public void main() { + stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); + stdout.printf("\n\t8 squared is %d\n", square(8)); +} diff --git a/tests/projects/vala/staticlib/src/mymath.vala b/tests/projects/vala/staticlib/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/tests/projects/vala/staticlib/src/mymath.vala @@ -0,0 +1,9 @@ +namespace MyMath { + public int sum(int a, int b) { + return(a + b); + } + + public int square(int a) { + return(a * a); + } +} diff --git a/tests/projects/vala/staticlib/xmake.lua b/tests/projects/vala/staticlib/xmake.lua new file mode 100644 index 000000000..d37f1b974 --- /dev/null +++ b/tests/projects/vala/staticlib/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.release", "mode.debug") + +add_requires("glib") + +target("mymath") + set_kind("static") + add_rules("vala") + add_files("src/mymath.vala") + add_values("vala.header", "mymath.h") + add_values("vala.vapi", "mymath-1.0.vapi") + add_packages("glib") + +target("test") + set_kind("binary") + add_deps("mymath") + add_rules("vala") + add_files("src/main.vala") + add_packages("glib") |
