summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh7
-rw-r--r--src/bindings/mono/meson.build8
-rw-r--r--src/tests/efl_mono/Eo.cs30
-rw-r--r--src/tests/efl_mono/dummy_child.eo32
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c25
-rw-r--r--src/tests/efl_mono/meson.build6
6 files changed, 100 insertions, 8 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 993378f..199dd8c 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -510,7 +510,12 @@ struct klass
510 ).generate(sink, attributes::unused, context)) 510 ).generate(sink, attributes::unused, context))
511 return false; 511 return false;
512 512
513 auto constructors = helpers::reorder_constructors(cls.get_all_constructors()); 513 auto all_constructors = helpers::reorder_constructors(cls.get_all_constructors());
514 decltype (all_constructors) constructors;
515
516 std::copy_if(all_constructors.cbegin(), all_constructors.cend(), std::back_inserter(constructors), [&context](attributes::constructor_def const& ctor) {
517 return !blacklist::is_function_blacklisted(ctor.function, context);
518 });
514 519
515 // Public (API) constructors 520 // Public (API) constructors
516 if (!as_generator( 521 if (!as_generator(
diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build
index 7582fc2..60401dc 100644
--- a/src/bindings/mono/meson.build
+++ b/src/bindings/mono/meson.build
@@ -146,11 +146,17 @@ efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in',
146 output : 'efl_mono.dll.config', 146 output : 'efl_mono.dll.config',
147 configuration : efl_mono_conf_data) 147 configuration : efl_mono_conf_data)
148 148
149extra_cs_args = runtime_assemblies
150
151if get_option('mono-beta')
152 extra_cs_args += '-d:EFL_BETA'
153endif
154
149efl_mono = library('efl_mono', 155efl_mono = library('efl_mono',
150 mono_generator_target + mono_files + [efl_src], 156 mono_generator_target + mono_files + [efl_src],
151 install : true, 157 install : true,
152 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major), 158 install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
153 cs_args : runtime_assemblies 159 cs_args : extra_cs_args
154) 160)
155 161
156efl_mono_test_suite_path=join_paths(meson.current_build_dir()) 162efl_mono_test_suite_path=join_paths(meson.current_build_dir())
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs
index e955888..08c5e2d 100644
--- a/src/tests/efl_mono/Eo.cs
+++ b/src/tests/efl_mono/Eo.cs
@@ -354,7 +354,11 @@ class TestEoGrandChildrenFinalize
354 public sealed class GrandChild : Dummy.Child 354 public sealed class GrandChild : Dummy.Child
355 { 355 {
356 356
357#if EFL_BETA
358 public GrandChild() : base(null, "", 0.0, 0) { }
359#else
357 public GrandChild() : base(null, "", 0.0) { } 360 public GrandChild() : base(null, "", 0.0) { }
361#endif
358 362
359 public int receivedValue = 0; 363 public int receivedValue = 0;
360 public override Efl.Object FinalizeAdd() 364 public override Efl.Object FinalizeAdd()
@@ -378,18 +382,43 @@ class TestConstructors
378 int iface_prop = 42; 382 int iface_prop = 42;
379 string a = "LFE"; 383 string a = "LFE";
380 double b = 3.14; 384 double b = 3.14;
385#if EFL_BETA
386 int beta = 1337;
387#endif
388
389#if EFL_BETA
390 var obj = new Dummy.Child(null, a, b, beta, iface_prop, 0);
391#else
381 var obj = new Dummy.Child(null, a, b, iface_prop); 392 var obj = new Dummy.Child(null, a, b, iface_prop);
393#endif
382 Test.AssertEquals(iface_prop, obj.IfaceProp); 394 Test.AssertEquals(iface_prop, obj.IfaceProp);
383 395
396#if EFL_BETA
397 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b,
398 obligatoryBetaCtor : beta,
399 optionalBetaCtor : -beta);
400#else
384 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b); 401 obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b);
402#endif
385 Test.AssertEquals(iface_prop, obj.IfaceProp); 403 Test.AssertEquals(iface_prop, obj.IfaceProp);
404
405#if EFL_BETA
406 Test.Assert(obj.ObligatoryBetaCtorWasCalled);
407 Test.Assert(obj.OptionalBetaCtorWasCalled);
408#endif
386 } 409 }
387 410
388 public static void test_optional_constructor() 411 public static void test_optional_constructor()
389 { 412 {
390 string a = "LFE"; 413 string a = "LFE";
391 double b = 3.14; 414 double b = 3.14;
415#if EFL_BETA
416 int beta = 2241;
417 var obj = new Dummy.Child(null, a, b, obligatoryBetaCtor : beta);
418 Test.Assert(!obj.OptionalBetaCtorWasCalled);
419#else
392 var obj = new Dummy.Child(null, a, b); 420 var obj = new Dummy.Child(null, a, b);
421#endif
393 Test.Assert(!obj.GetIfaceWasSet()); 422 Test.Assert(!obj.GetIfaceWasSet());
394 } 423 }
395} 424}
@@ -412,7 +441,6 @@ class TestProvider
412 public static void test_find_provider() 441 public static void test_find_provider()
413 { 442 {
414 // Tests only the direction C# -> C 443 // Tests only the direction C# -> C
415 var tmp = new Dummy.Numberwrapper();
416 var obj = new Dummy.TestObject(); 444 var obj = new Dummy.TestObject();
417 Dummy.Numberwrapper provider = Dummy.Numberwrapper.static_cast(obj.FindProvider(typeof(Dummy.Numberwrapper))); 445 Dummy.Numberwrapper provider = Dummy.Numberwrapper.static_cast(obj.FindProvider(typeof(Dummy.Numberwrapper)));
418 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper)); 446 Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
diff --git a/src/tests/efl_mono/dummy_child.eo b/src/tests/efl_mono/dummy_child.eo
index b7845d9..f6de361 100644
--- a/src/tests/efl_mono/dummy_child.eo
+++ b/src/tests/efl_mono/dummy_child.eo
@@ -13,13 +13,41 @@ class Dummy.Child extends Dummy.Test_Object {
13 @property iface_was_set { 13 @property iface_was_set {
14 get {} 14 get {}
15 values { 15 values {
16 data: bool; 16 data: bool;
17 } 17 }
18 }
19
20 obligatory_beta_ctor @beta {
21 params {
22 @in a: int;
23 }
24 }
25
26 optional_beta_ctor @beta {
27 params {
28 @in a: int;
29 }
30 }
31
32 @property obligatory_beta_ctor_was_called {
33 get{}
34 values {
35 data: bool;
36 }
37 }
38
39 @property optional_beta_ctor_was_called {
40 get{}
41 values {
42 data: bool;
43 }
18 } 44 }
19 } 45 }
20 constructors { 46 constructors {
21 Dummy.Test_Iface.iface_prop @optional; 47 Dummy.Test_Iface.iface_prop @optional;
22 .double_params; 48 .double_params;
49 .obligatory_beta_ctor;
50 .optional_beta_ctor @optional;
23 } 51 }
24 implements { 52 implements {
25 Dummy.Test_Iface.iface_prop { get; set; } 53 Dummy.Test_Iface.iface_prop { get; set; }
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 8c17e05..e4c7d72 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -87,6 +87,8 @@ typedef struct Dummy_Child_Data
87 const char* a; 87 const char* a;
88 double b; 88 double b;
89 Eina_Bool iface_was_set; 89 Eina_Bool iface_was_set;
90 Eina_Bool obligatory_beta_ctor_was_called;
91 Eina_Bool optional_beta_ctor_was_called;
90} Dummy_Child_Data; 92} Dummy_Child_Data;
91 93
92typedef struct Dummy_Inherit_Helper_Data 94typedef struct Dummy_Inherit_Helper_Data
@@ -3946,6 +3948,8 @@ _dummy_child_efl_object_constructor(Eo *obj, Dummy_Child_Data *pd)
3946 3948
3947 pd->iface_prop = 1984; 3949 pd->iface_prop = 1984;
3948 pd->iface_was_set = EINA_FALSE; 3950 pd->iface_was_set = EINA_FALSE;
3951 pd->obligatory_beta_ctor_was_called = EINA_FALSE;
3952 pd->optional_beta_ctor_was_called = EINA_FALSE;
3949 return obj; 3953 return obj;
3950} 3954}
3951 3955
@@ -3974,6 +3978,27 @@ Eina_Bool _dummy_child_iface_was_set_get(EINA_UNUSED const Eo* obj, Dummy_Child_
3974{ 3978{
3975 return pd->iface_was_set; 3979 return pd->iface_was_set;
3976} 3980}
3981
3982void _dummy_child_obligatory_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
3983{
3984 pd->obligatory_beta_ctor_was_called = EINA_TRUE;
3985}
3986
3987void _dummy_child_optional_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
3988{
3989 pd->optional_beta_ctor_was_called = EINA_TRUE;
3990}
3991
3992Eina_Bool _dummy_child_obligatory_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
3993{
3994 return pd->obligatory_beta_ctor_was_called;
3995}
3996
3997Eina_Bool _dummy_child_optional_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
3998{
3999 return pd->optional_beta_ctor_was_called;
4000}
4001
3977EOLIAN static void 4002EOLIAN static void
3978_dummy_child_class_constructor(Efl_Class *klass) 4003_dummy_child_class_constructor(Efl_Class *klass)
3979{ 4004{
diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build
index ae1d76f..52c6e31 100644
--- a/src/tests/efl_mono/meson.build
+++ b/src/tests/efl_mono/meson.build
@@ -25,7 +25,7 @@ foreach mono_gen_file : eo_files
25 eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', 25 eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
26 input : mono_gen_file, 26 input : mono_gen_file,
27 output : [mono_gen_file + '.cs'], 27 output : [mono_gen_file + '.cs'],
28 command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories, 28 command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
29 '--dllimport', 'efl_mono_native_test', 29 '--dllimport', 'efl_mono_native_test',
30 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), 30 '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
31 '@INPUT@']) 31 '@INPUT@'])
@@ -34,7 +34,7 @@ endforeach
34efl_mono_test = library('efl_mono_test', 34efl_mono_test = library('efl_mono_test',
35 eo_file_targets, 35 eo_file_targets,
36 link_with : [efl_mono], 36 link_with : [efl_mono],
37 cs_args : runtime_assemblies 37 cs_args : extra_cs_args
38) 38)
39 39
40efl_mono_src = [ 40efl_mono_src = [
@@ -64,7 +64,7 @@ efl_mono_src = [
64efl_mono_suite = executable('efl-mono-suite', 64efl_mono_suite = executable('efl-mono-suite',
65 efl_mono_src, 65 efl_mono_src,
66 link_with : [efl_mono, efl_mono_test], 66 link_with : [efl_mono, efl_mono_test],
67 cs_args : runtime_assemblies 67 cs_args : extra_cs_args
68) 68)
69 69
70env = environment() 70env = environment()