summaryrefslogtreecommitdiffstats
path: root/test cases/csharp/2 library
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/csharp/2 library')
-rw-r--r--test cases/csharp/2 library/helper.cs7
-rw-r--r--test cases/csharp/2 library/meson.build15
-rw-r--r--test cases/csharp/2 library/prog.cs8
-rw-r--r--test cases/csharp/2 library/test.json9
4 files changed, 39 insertions, 0 deletions
diff --git a/test cases/csharp/2 library/helper.cs b/test cases/csharp/2 library/helper.cs
new file mode 100644
index 0000000..266e379
--- /dev/null
+++ b/test cases/csharp/2 library/helper.cs
@@ -0,0 +1,7 @@
+using System;
+
+public class Helper {
+ public void print() {
+ Console.WriteLine("Library class called.");
+ }
+}
diff --git a/test cases/csharp/2 library/meson.build b/test cases/csharp/2 library/meson.build
new file mode 100644
index 0000000..6b246a4
--- /dev/null
+++ b/test cases/csharp/2 library/meson.build
@@ -0,0 +1,15 @@
+project('C# library', 'cs')
+
+python3 = import('python3').find_python()
+generated_sources = custom_target('gen_sources',
+ input: 'helper.cs',
+ output: 'helper.cs',
+ command: [python3, '-c',
+ 'import shutil, sys; shutil.copyfile(sys.argv[1], sys.argv[2])',
+ '@INPUT@', '@OUTPUT@']
+)
+
+l = shared_library('helper', generated_sources, install : true)
+
+e = executable('prog', 'prog.cs', link_with : l, install : true)
+test('libtest', e)
diff --git a/test cases/csharp/2 library/prog.cs b/test cases/csharp/2 library/prog.cs
new file mode 100644
index 0000000..8bf6a31
--- /dev/null
+++ b/test cases/csharp/2 library/prog.cs
@@ -0,0 +1,8 @@
+using System;
+
+public class Prog {
+ static public void Main () {
+ Helper h = new Helper();
+ h.print();
+ }
+}
diff --git a/test cases/csharp/2 library/test.json b/test cases/csharp/2 library/test.json
new file mode 100644
index 0000000..0523f45
--- /dev/null
+++ b/test cases/csharp/2 library/test.json
@@ -0,0 +1,9 @@
+{
+ "installed": [
+ {"type": "file", "file": "usr/bin/prog.exe"},
+ {"type": "pdb", "file": "usr/bin/prog"},
+ {"type": "file", "platform": "msvc", "file": "usr/bin/helper.dll"},
+ {"type": "pdb", "file": "usr/bin/helper"},
+ {"type": "file", "platform": "gcc", "file": "usr/lib/helper.dll"}
+ ]
+}