efl-csharp: Respect beta in constructor parameters.
Summary: Fixes compilation after Efl.Ui.Win parameter changes. Also removed an unused var and now we pass the beta option to the eolian mono invocation for the tests. Fixes T7723 Reviewers: segfaultxavi, felipealmeida, vitor.sousa Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7723 Differential Revision: https://phab.enlightenment.org/D8150
This commit is contained in:
parent
76c67957b0
commit
c67f199b2f
|
@ -510,7 +510,12 @@ struct klass
|
||||||
).generate(sink, attributes::unused, context))
|
).generate(sink, attributes::unused, context))
|
||||||
return false;
|
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
|
// Public (API) constructors
|
||||||
if (!as_generator(
|
if (!as_generator(
|
||||||
|
|
|
@ -146,11 +146,17 @@ efl_mono_dll_config = configure_file(input : 'efl_mono.dll.config.in',
|
||||||
output : 'efl_mono.dll.config',
|
output : 'efl_mono.dll.config',
|
||||||
configuration : efl_mono_conf_data)
|
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',
|
efl_mono = library('efl_mono',
|
||||||
mono_generator_target + mono_files + [efl_src],
|
mono_generator_target + mono_files + [efl_src],
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : join_paths(dir_lib, 'efl-mono-'+version_major),
|
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())
|
efl_mono_test_suite_path=join_paths(meson.current_build_dir())
|
||||||
|
|
|
@ -354,7 +354,11 @@ class TestEoGrandChildrenFinalize
|
||||||
public sealed class GrandChild : Dummy.Child
|
public sealed class GrandChild : Dummy.Child
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if EFL_BETA
|
||||||
|
public GrandChild() : base(null, "", 0.0, 0) { }
|
||||||
|
#else
|
||||||
public GrandChild() : base(null, "", 0.0) { }
|
public GrandChild() : base(null, "", 0.0) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
public int receivedValue = 0;
|
public int receivedValue = 0;
|
||||||
public override Efl.Object FinalizeAdd()
|
public override Efl.Object FinalizeAdd()
|
||||||
|
@ -378,18 +382,43 @@ class TestConstructors
|
||||||
int iface_prop = 42;
|
int iface_prop = 42;
|
||||||
string a = "LFE";
|
string a = "LFE";
|
||||||
double b = 3.14;
|
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);
|
var obj = new Dummy.Child(null, a, b, iface_prop);
|
||||||
|
#endif
|
||||||
Test.AssertEquals(iface_prop, obj.IfaceProp);
|
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);
|
obj = new Dummy.Child(parent: null, ifaceProp : iface_prop, doubleParamsA : a, doubleParamsB : b);
|
||||||
|
#endif
|
||||||
Test.AssertEquals(iface_prop, obj.IfaceProp);
|
Test.AssertEquals(iface_prop, obj.IfaceProp);
|
||||||
|
|
||||||
|
#if EFL_BETA
|
||||||
|
Test.Assert(obj.ObligatoryBetaCtorWasCalled);
|
||||||
|
Test.Assert(obj.OptionalBetaCtorWasCalled);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void test_optional_constructor()
|
public static void test_optional_constructor()
|
||||||
{
|
{
|
||||||
string a = "LFE";
|
string a = "LFE";
|
||||||
double b = 3.14;
|
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);
|
var obj = new Dummy.Child(null, a, b);
|
||||||
|
#endif
|
||||||
Test.Assert(!obj.GetIfaceWasSet());
|
Test.Assert(!obj.GetIfaceWasSet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -412,7 +441,6 @@ class TestProvider
|
||||||
public static void test_find_provider()
|
public static void test_find_provider()
|
||||||
{
|
{
|
||||||
// Tests only the direction C# -> C
|
// Tests only the direction C# -> C
|
||||||
var tmp = new Dummy.Numberwrapper();
|
|
||||||
var obj = new Dummy.TestObject();
|
var obj = new Dummy.TestObject();
|
||||||
Dummy.Numberwrapper provider = Dummy.Numberwrapper.static_cast(obj.FindProvider(typeof(Dummy.Numberwrapper)));
|
Dummy.Numberwrapper provider = Dummy.Numberwrapper.static_cast(obj.FindProvider(typeof(Dummy.Numberwrapper)));
|
||||||
Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
|
Test.AssertEquals(provider.GetType(), typeof(Dummy.Numberwrapper));
|
||||||
|
|
|
@ -13,13 +13,41 @@ class Dummy.Child extends Dummy.Test_Object {
|
||||||
@property iface_was_set {
|
@property iface_was_set {
|
||||||
get {}
|
get {}
|
||||||
values {
|
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 {
|
constructors {
|
||||||
Dummy.Test_Iface.iface_prop @optional;
|
Dummy.Test_Iface.iface_prop @optional;
|
||||||
.double_params;
|
.double_params;
|
||||||
|
.obligatory_beta_ctor;
|
||||||
|
.optional_beta_ctor @optional;
|
||||||
}
|
}
|
||||||
implements {
|
implements {
|
||||||
Dummy.Test_Iface.iface_prop { get; set; }
|
Dummy.Test_Iface.iface_prop { get; set; }
|
||||||
|
|
|
@ -87,6 +87,8 @@ typedef struct Dummy_Child_Data
|
||||||
const char* a;
|
const char* a;
|
||||||
double b;
|
double b;
|
||||||
Eina_Bool iface_was_set;
|
Eina_Bool iface_was_set;
|
||||||
|
Eina_Bool obligatory_beta_ctor_was_called;
|
||||||
|
Eina_Bool optional_beta_ctor_was_called;
|
||||||
} Dummy_Child_Data;
|
} Dummy_Child_Data;
|
||||||
|
|
||||||
typedef struct Dummy_Inherit_Helper_Data
|
typedef struct Dummy_Inherit_Helper_Data
|
||||||
|
@ -3946,6 +3948,8 @@ _dummy_child_efl_object_constructor(Eo *obj, Dummy_Child_Data *pd)
|
||||||
|
|
||||||
pd->iface_prop = 1984;
|
pd->iface_prop = 1984;
|
||||||
pd->iface_was_set = EINA_FALSE;
|
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 obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3974,6 +3978,27 @@ Eina_Bool _dummy_child_iface_was_set_get(EINA_UNUSED const Eo* obj, Dummy_Child_
|
||||||
{
|
{
|
||||||
return pd->iface_was_set;
|
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
|
EOLIAN static void
|
||||||
_dummy_child_class_constructor(Efl_Class *klass)
|
_dummy_child_class_constructor(Efl_Class *klass)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ foreach mono_gen_file : eo_files
|
||||||
eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
eo_file_targets += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'',
|
||||||
input : mono_gen_file,
|
input : mono_gen_file,
|
||||||
output : [mono_gen_file + '.cs'],
|
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',
|
'--dllimport', 'efl_mono_native_test',
|
||||||
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
'-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'),
|
||||||
'@INPUT@'])
|
'@INPUT@'])
|
||||||
|
@ -34,7 +34,7 @@ endforeach
|
||||||
efl_mono_test = library('efl_mono_test',
|
efl_mono_test = library('efl_mono_test',
|
||||||
eo_file_targets,
|
eo_file_targets,
|
||||||
link_with : [efl_mono],
|
link_with : [efl_mono],
|
||||||
cs_args : runtime_assemblies
|
cs_args : extra_cs_args
|
||||||
)
|
)
|
||||||
|
|
||||||
efl_mono_src = [
|
efl_mono_src = [
|
||||||
|
@ -64,7 +64,7 @@ efl_mono_src = [
|
||||||
efl_mono_suite = executable('efl-mono-suite',
|
efl_mono_suite = executable('efl-mono-suite',
|
||||||
efl_mono_src,
|
efl_mono_src,
|
||||||
link_with : [efl_mono, efl_mono_test],
|
link_with : [efl_mono, efl_mono_test],
|
||||||
cs_args : runtime_assemblies
|
cs_args : extra_cs_args
|
||||||
)
|
)
|
||||||
|
|
||||||
env = environment()
|
env = environment()
|
||||||
|
|
Loading…
Reference in New Issue