).generate(sink, attributes::unused, context))
return false;
- auto constructors = helpers::reorder_constructors(cls.get_all_constructors());
+ auto all_constructors = helpers::reorder_constructors(cls.get_all_constructors());
+ decltype (all_constructors) constructors;
+
+ std::copy_if(all_constructors.cbegin(), all_constructors.cend(), std::back_inserter(constructors), [&context](attributes::constructor_def const& ctor) {
+ return !blacklist::is_function_blacklisted(ctor.function, context);
+ });
// Public (API) constructors
if (!as_generator(
output : 'efl_mono.dll.config',
configuration : efl_mono_conf_data)
+extra_cs_args = runtime_assemblies
+
+if get_option('mono-beta')
+ extra_cs_args += '-d:EFL_BETA'
+endif
+
efl_mono = library('efl_mono',
mono_generator_target + mono_files + [efl_src],
install : true,
install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
- cs_args : runtime_assemblies
+ cs_args : extra_cs_args
)
efl_mono_test_suite_path=join_paths(meson.current_build_dir())
public sealed class GrandChild : Dummy.Child
{
+#if EFL_BETA
+ public GrandChild() : base(null, "", 0.0, 0) { }
+#else
public GrandChild() : base(null, "", 0.0) { }
+#endif
public int receivedValue = 0;
public override Efl.Object FinalizeAdd()
int iface_prop = 42;
string a = "LFE";
double b = 3.14;
+#if EFL_BETA
+ int beta = 1337;
+#endif
+
+#if EFL_BETA
+ var obj = new Dummy.Child(null, a, b, beta, iface_prop, 0);
+#else
var obj = new Dummy.Child(null, a, b, iface_prop);
+#endif
Test.AssertEquals(iface_prop, obj.IfaceProp);
+#if EFL_BETA
+ obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b,
+ obligatoryBetaCtor : beta,
+ optionalBetaCtor : -beta);
+#else
obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b);
+#endif
Test.AssertEquals(iface_prop, obj.IfaceProp);
+
+#if EFL_BETA
+ Test.Assert(obj.ObligatoryBetaCtorWasCalled);
+ Test.Assert(obj.OptionalBetaCtorWasCalled);
+#endif
}
public static void test_optional_constructor()
{
string a = "LFE";
double b = 3.14;
+#if EFL_BETA
+ int beta = 2241;
+ var obj = new Dummy.Child(null, a, b, obligatoryBetaCtor : beta);
+ Test.Assert(!obj.OptionalBetaCtorWasCalled);
+#else
var obj = new Dummy.Child(null, a, b);
+#endif
Test.Assert(!obj.GetIfaceWasSet());
}
}
public static void test_find_provider()
{
// Tests only the direction C# -> C
- var tmp = new Dummy.Numberwrapper();
var obj = new Dummy.TestObject();
Dummy.Numberwrapper provider = Dummy.Numberwrapper.static_cast(obj.FindProvider(typeof(Dummy.Numberwrapper)));
Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
@property iface_was_set {
get {}
values {
- data: bool;
- }
+ data: bool;
+ }
+ }
+
+ obligatory_beta_ctor @beta {
+ params {
+ @in a: int;
+ }
+ }
+
+ optional_beta_ctor @beta {
+ params {
+ @in a: int;
+ }
+ }
+
+ @property obligatory_beta_ctor_was_called {
+ get{}
+ values {
+ data: bool;
+ }
+ }
+
+ @property optional_beta_ctor_was_called {
+ get{}
+ values {
+ data: bool;
+ }
}
}
constructors {
Dummy.Test_Iface.iface_prop @optional;
.double_params;
+ .obligatory_beta_ctor;
+ .optional_beta_ctor @optional;
}
implements {
Dummy.Test_Iface.iface_prop { get; set; }
const char* a;
double b;
Eina_Bool iface_was_set;
+ Eina_Bool obligatory_beta_ctor_was_called;
+ Eina_Bool optional_beta_ctor_was_called;
} Dummy_Child_Data;
typedef struct Dummy_Inherit_Helper_Data
pd->iface_prop = 1984;
pd->iface_was_set = EINA_FALSE;
+ pd->obligatory_beta_ctor_was_called = EINA_FALSE;
+ pd->optional_beta_ctor_was_called = EINA_FALSE;
return obj;
}
{
return pd->iface_was_set;
}
+
+void _dummy_child_obligatory_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
+{
+ pd->obligatory_beta_ctor_was_called = EINA_TRUE;
+}
+
+void _dummy_child_optional_beta_ctor(EINA_UNUSED Eo* obj, Dummy_Child_Data *pd, EINA_UNUSED int a)
+{
+ pd->optional_beta_ctor_was_called = EINA_TRUE;
+}
+
+Eina_Bool _dummy_child_obligatory_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
+{
+ return pd->obligatory_beta_ctor_was_called;
+}
+
+Eina_Bool _dummy_child_optional_beta_ctor_was_called_get(EINA_UNUSED const Eo* obj, Dummy_Child_Data *pd)
+{
+ return pd->optional_beta_ctor_was_called;
+}
+
EOLIAN static void
_dummy_child_class_constructor(Efl_Class *klass)
{
eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
input : mono_gen_file,
output : [mono_gen_file + '.cs'],
- command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories,
+ command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories,
'--dllimport', 'efl_mono_native_test',
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
'@INPUT@'])
efl_mono_test = library('efl_mono_test',
eo_file_targets,
link_with : [efl_mono],
- cs_args : runtime_assemblies
+ cs_args : extra_cs_args
)
efl_mono_src = [
efl_mono_suite = executable('efl-mono-suite',
efl_mono_src,
link_with : [efl_mono, efl_mono_test],
- cs_args : runtime_assemblies
+ cs_args : extra_cs_args
)
env = environment()