diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-25 14:03:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-25 14:03:02 +0200 |
| commit | 8a68dc0179bc63303a8ef8c4a339cc01ca406084 (patch) | |
| tree | 9ee89c663207c3f5cfd5e16f42ff24ea16727879 /test cases/csharp | |
| parent | f1ce7af2d5866b5207c1f4036477a175f433655c (diff) | |
| parent | 67f3f803620cdf5cbabd2757211cb4c969ccf41f (diff) | |
| download | meson-8a68dc0179bc63303a8ef8c4a339cc01ca406084.tar.gz | |
Merge pull request #3132 from mesonbuild/csc
Visual Studio C# compiler support and some fixes
Diffstat (limited to 'test cases/csharp')
| -rw-r--r-- | test cases/csharp/1 basic/meson.build | 2 | ||||
| -rw-r--r-- | test cases/csharp/1 basic/prog.cs | 5 | ||||
| -rw-r--r-- | test cases/csharp/1 basic/text.cs | 7 | ||||
| -rw-r--r-- | test cases/csharp/4 external dep/meson.build | 7 | ||||
| -rw-r--r-- | test cases/csharp/4 pkgconfig/meson.build | 7 | ||||
| -rw-r--r-- | test cases/csharp/4 pkgconfig/test-lib.cs | 11 |
6 files changed, 17 insertions, 22 deletions
diff --git a/test cases/csharp/1 basic/meson.build b/test cases/csharp/1 basic/meson.build index 2ee6a4a93..09e46c293 100644 --- a/test cases/csharp/1 basic/meson.build +++ b/test cases/csharp/1 basic/meson.build @@ -1,4 +1,4 @@ project('simple c#', 'cs') -e = executable('prog', 'prog.cs', install : true) +e = executable('prog', 'prog.cs', 'text.cs', install : true) test('basic', e) diff --git a/test cases/csharp/1 basic/prog.cs b/test cases/csharp/1 basic/prog.cs index dfb24002b..6ee47b074 100644 --- a/test cases/csharp/1 basic/prog.cs +++ b/test cases/csharp/1 basic/prog.cs @@ -1,7 +1,8 @@ using System; - + public class Prog { static public void Main () { - Console.WriteLine("C# is working."); + TextGetter tg = new TextGetter(); + Console.WriteLine(tg.getText()); } } diff --git a/test cases/csharp/1 basic/text.cs b/test cases/csharp/1 basic/text.cs new file mode 100644 index 000000000..c83c424c8 --- /dev/null +++ b/test cases/csharp/1 basic/text.cs @@ -0,0 +1,7 @@ +using System; + +public class TextGetter { + public String getText() { + return "C# is working."; + } +} diff --git a/test cases/csharp/4 external dep/meson.build b/test cases/csharp/4 external dep/meson.build index 004d25ffc..019d618b7 100644 --- a/test cases/csharp/4 external dep/meson.build +++ b/test cases/csharp/4 external dep/meson.build @@ -1,4 +1,9 @@ project('C# external library', 'cs') -glib_sharp_2 = dependency('glib-sharp-2.0') +glib_sharp_2 = dependency('glib-sharp-2.0', required : false) + +if not glib_sharp_2.found() + error('MESON_SKIP_TEST glib# not found.') +endif + e = executable('prog', 'prog.cs', dependencies: glib_sharp_2, install : true) test('libtest', e, args: [join_paths(meson.current_source_dir(), 'hello.txt')]) diff --git a/test cases/csharp/4 pkgconfig/meson.build b/test cases/csharp/4 pkgconfig/meson.build deleted file mode 100644 index e2ba03578..000000000 --- a/test cases/csharp/4 pkgconfig/meson.build +++ /dev/null @@ -1,7 +0,0 @@ -project('C# pkg-config', 'cs') - -nunit_dep = dependency('nunit') -nunit_runner = find_program('nunit-console') - -test_lib = library('test_lib', 'test-lib.cs', dependencies: nunit_dep) -test('nunit test', nunit_runner, args: test_lib) diff --git a/test cases/csharp/4 pkgconfig/test-lib.cs b/test cases/csharp/4 pkgconfig/test-lib.cs deleted file mode 100644 index 29f679505..000000000 --- a/test cases/csharp/4 pkgconfig/test-lib.cs +++ /dev/null @@ -1,11 +0,0 @@ -using NUnit.Framework; - -[TestFixture] -public class NUnitTest -{ - [Test] - public void Test() - { - Assert.AreEqual(1 + 1, 2); - } -} |
