Commit Graph

274 Commits

Author SHA1 Message Date
Vincent Torri ba22016c4c tests: fix warnings and undef ref on Windows (using meson :-) )
Summary: we need to include evil_private.h so that some symbols are declared

Test Plan: compilation

Reviewers: raster, zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9129
2019-06-20 12:50:35 +01:00
Vitor Sousa a86a0931f1 eo: add events to track the ownership status of an Eo object
Some user code may want to track an object ownership in regard to whether it is
kept by just one owner or shared between many owners.

This is specially true for code provided by bindings to other programming
languages, where different kinds of resource management may take place.

The event `ownership,unique` is triggered whenever the object refcount goes
from two to one, as a signal that it has just one owner from now on.

The event `ownership,shared` is triggered whenever the object refcount goes
from one to two, as a signal that it has multiple owners from now on.
It will not trigger when further increasing the refcount to any value beyond
two.

We also add benchmarks for sharing (i.e. increasing the refcount) and them
unsharing objects, in order to evaluate the performance impact of this patch.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8678
2019-05-29 15:53:23 -07:00
Cedric BAIL bc12d9feb5 eo: make reflection getter const function.
Getter are usually not modifying there object. This is going to put a strong
limit on what a getter property for MVVM is, as it will prevent any side
effect on getting a property from a View.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7969
2019-03-08 14:31:08 -08:00
Marcel Hollerbach 8118330d2a eo: fix reflection
Summary:
the DFS tree walk was accidently stopped by a too early return
statement. We should only return if we found a reflection entry, if not,
then we should continue our search

Depends on D7996

Reviewers: cedric, zmike, q66, segfaultxavi

Reviewed By: cedric, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7997
2019-03-08 08:19:23 -05:00
Marcel Hollerbach 8d2d5ae3b8 build: test eo fallback add
Summary:
this enables tests with the fallback implementation of EO.
Depends on D7924

Reviewers: stefan_schmidt, cedric, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7931
2019-02-25 07:59:13 -05:00
Cedric BAIL 2b2bf31264 eo: add tests for efl_property_reflection_exist.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7938
2019-02-21 11:54:16 -08:00
Cedric BAIL 770750486c eo: return an Eina_Value error when a get for a property is not implemented.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7936
2019-02-21 11:54:12 -08:00
Cedric BAIL b23f65291f eo: make reflection setter able to return an error code in case of failure.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7935
2019-02-21 11:54:09 -08:00
Marcel Hollerbach 5284ac36ca eo: add API for querying the class type
a class can be a interface mixin abstract or regular.
This adds a API for getting this information
2019-02-21 08:56:13 +01:00
Marcel Hollerbach 46885653bc eo: remove class functions from eo
As in the previous commit explained, we want to get rid of class
functions in eo, and make them just c functions right away.

This commit removes the class parameter from the eo_class_function_set
call, and adjusts the tests to not depend on class functions anymore.
Class functions are now not tested anymore, tests that used them as a
way to test *things* are adjusted to test them now with object
functions, tests that just tested the working of class functions are
dropped.

This fixes T7675.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7902
2019-02-13 16:59:59 +01:00
Marcel Hollerbach 37d2d378ec eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.

After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.

This also means a change to the syntax created by eo:

Calling before:
  class_function(CLASS_A);
Calling after:
   class_function();

Implementation before:
   class_function(const Eo *obj, void *pd) { ... }
Implementation after:
   class_function(void) { ... }

This fixes T7675.

Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
2019-02-13 16:59:58 +01:00
Marcel Hollerbach e908142da6 build: also build eo-tests with debug profile
this checks that eo-dbg is also working in the same manner as normal eo

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D7911
2019-02-12 16:24:24 +01:00
Marcel Hollerbach 0221ff480d eo: the object size changes for the eo_debug profile
Differential Revision: https://phab.enlightenment.org/D7909
2019-02-12 11:20:21 +01:00
Marcel Hollerbach 0f32bb9047 eo: here comes reflection API
this adds support in eo to generate a reflection API. To get the actaul
reflection to the klass, the API efl_class_reflection_table_set needs to
be called, the table in the end can be generated by eolian. Reflection
API is inherited by the extended class. This means, if you have two
reflection tables, first, the most upperst is called, then the next
lower one is called.

For now this API accepts NULL setter or getter, and will ignore them
silently when they are called.

fix T7681

Differential Revision: https://phab.enlightenment.org/D7879
2019-02-07 14:43:25 +01:00
Marcel Hollerbach 0709bdea6f eo: change API call of efl_class_functions_set
The next commit will bring support for something like reflection. This
commit prepares the whole tree for getting another argument in
efl_class_functions_set.

ref T7681

Differential Revision: https://phab.enlightenment.org/D7882
2019-02-07 14:43:25 +01:00
Mike Blumenkrantz c946b1477d eo: implement class overriding (+unit tests)
this enables an app or a platform to add an override for a given class,
then return a different object when that class is created. the benefit is
that a class can be internally customized by the app without needing to
modify upstream versions of that class

@feature
fix T7516

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7702
2019-02-04 19:31:17 +01:00
Marcel Hollerbach 32a2268f46 eo: fix efl_isa to work propertly with interfaces
mro only contains special interfaces, not in general all, in order to
have a working function, while NOT having a bad performance. In order to
achive that we just copy the code that is done on efl_isa for a object.
which is a linear walk of a list

ref D7857

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7860
2019-02-01 11:32:43 +01:00
Cedric BAIL 549bf6e269 eo: improve efl_isa to be able to know if a class is part of the hierarchy of another class.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7703
2019-01-24 16:29:25 -08:00
Cedric BAIL 6a144f5008 eo: add a test to enforce the upper limit of our base object size.
Differential Revision: https://phab.enlightenment.org/D7523
2019-01-09 11:02:07 -08:00
Cedric BAIL e9a434df9b eo: test that event cancel before emitting does propagate event.
Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D7496
2019-01-02 13:39:12 -08:00
Marcel Hollerbach e43f090265 cmake: remove!
This build was never complete and also was not maintained probebly.

It is also dropped in favour of meson which is cool, merged, works & is fast.

Differential Revision: https://phab.enlightenment.org/D7010
2018-12-20 20:07:26 +01:00
Carsten Haitzler 832620f8fd eo suit - warn - include ptr indirection not privater to avoid warnings 2018-11-09 11:43:59 +00:00
Marcel Hollerbach 0270b20378 eo: add log domain to the testsuite
Summary:
when the compiler is instructed that symbols are local by default. Then
the testsuite will fail, due to eo_test_general.c including the
indirection header, which uses the ERR macro, which needs the
_eo_log_dom symbol.
Depends on D7145

Reviewers: netstar, zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7147
2018-10-12 14:59:14 +09:00
Marcel Hollerbach 46d464e5bf here comes meson
a new shiny buildtool that currently completes in the total of ~ 4 min..
1 min. conf time
2:30 min. build time
Where autotools takes:
1:50 min. conf time
3:40 min. build time.

meson was taken because it went quite good for enlightenment, and is a traction gaining system that is also used by other mayor projects. Additionally, the DSL that is defined my meson makes the configuration of the builds a lot easier to read.

Further informations can be gathered from the README.meson

Right now, bindings & windows support are missing.

It is highly recommented to use meson 0.48 due to optimizations in meson
that reduced the time the meson call would need.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>

Differential Revision: https://phab.enlightenment.org/D7012
Depends on D7011
2018-10-02 17:22:50 +02:00
Marcel Hollerbach 068e09cf2e eo: add funktion for alive checks
The function simply checks if the object is finalized and not
started to be invalidated or invalidated.

Differential Revision: https://phab.enlightenment.org/D6723
2018-09-14 11:18:56 +02:00
Marcel Hollerbach 365c0334ff efl_object: add call for getting invalidating
Summary:
there is now invalidated & invalidating.

invalidated returns true when all children are invalidated, and the
object is / was requested to be invalidated.

invalidating return true when the object is called to be invalidated but
not all children are invalidated yet. However, the object is garanteed
to be invalidated in near future.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric

Tags: #efl, #do_not_merge

Differential Revision: https://phab.enlightenment.org/D6722
2018-08-20 13:15:57 -04:00
Mike Blumenkrantz 0f2a9e15cd tests/eo: add explicit test case for setting an object as its own parent
Summary: Depends on D6489

Reviewers: bu5hm4n, devilhorns

Reviewed By: bu5hm4n

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6490
2018-07-05 15:11:55 -04:00
Mike Blumenkrantz a62d254306 tests/eo: add explicit ref check when setting an invalid parent
Summary: ref f4a55e9266

Reviewers: bu5hm4n, devilhorns, Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6473
2018-06-29 10:21:02 +09:00
Mike Blumenkrantz f4a55e9266 tests: add coverage for efl_parent_set with invalidated parent object
this hits a codepath which was otherwise never triggered by unit tests
2018-06-25 15:14:30 -04:00
Mike Blumenkrantz d2a703e7b8 tests: add some more failure cases for efl_parent_set in eo tests
ref T6837

Differential Revision: https://phab.enlightenment.org/D6358
2018-06-25 17:17:13 +02:00
Mike Blumenkrantz b2e3c483a8 tests: ensure class constructor is called in eo_domain test
failing to call this prior to the thread invocation would result in a CRI
from class initialization in a thread

ref T7003

Differential Revision: https://phab.enlightenment.org/D6333
2018-06-25 17:03:05 +02:00
Marcel Hollerbach 2ce15216c7 eo: get back the eo test suite
Summary: I accidently broke the test suite, due to missing rebuilds.

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6421
2018-06-25 11:00:59 -04:00
Marcel Hollerbach 6e46950169 eo: get rid of eo_id
Summary:
build with this disabled is just not working as the thread model of eo
falls apart. The threadmodel is required to have eo_id, as it decoded
the thread information in the eo_id, which is not working without eo_id.

This also fixes the testcases that have never been executed due to the
fact of the missing HAVE_EO_ID

fix T6610

Depends on D6327

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T6610

Differential Revision: https://phab.enlightenment.org/D6328
2018-06-19 13:35:53 -04:00
Mike Blumenkrantz dfe703b9bc tests: wrap critical errors to disable aborting in eo tests
ref T7002

Differential Revision: https://phab.enlightenment.org/D6271
2018-06-18 12:11:27 +02:00
Mike Blumenkrantz e5d4f9f63c tests: disable eo test timeouts when not forked
this makes debugging much easier

Differential Revision: https://phab.enlightenment.org/D6270
2018-06-18 12:11:27 +02:00
Marcel Hollerbach 4e386c883a eo: add testcase for basic eventing and lifetime checking
checks if a object is really freed, even under error conditions.

The test suite now has the following timing:

TC TIME Eo general: 0.035713
SUITE TIME(8227) Eo: 0.036046

Differential Revision: https://phab.enlightenment.org/D6253
2018-06-07 09:39:10 +02:00
Cedric BAIL 5b9694da3e eo: match raise of error level in tests. 2018-05-24 16:02:21 -07:00
Cedric BAIL 3489708052 eo: we are actually testing internal function too here. 2018-05-24 16:02:20 -07:00
Cedric BAIL 0c0f2b75e4 eo: add infrastructure to test critical Eina Error. 2018-05-24 16:02:20 -07:00
Cedric BAIL 48738d125c eo: improve tests suite debugging by always displaying the error message before abort. 2018-05-24 16:02:20 -07:00
Mike Blumenkrantz 5490db74a0 tests: remove sleep() calls from eo tests
Summary: fix T6854

Reviewers: stefan_schmidt

Reviewed By: stefan_schmidt

Subscribers: cedric

Maniphest Tasks: T6854

Differential Revision: https://phab.enlightenment.org/D5910
2018-04-13 13:53:39 +02:00
Mike Blumenkrantz 624925fe6e tests: move to using checked fixtures for all test suites
individual tests should not need to explicitly call init/shutdown functions
in most cases, and many did not properly do this anyway

see followup commit which resolves some issues with eina tests

ref T6813
ref T6811

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:26 +02:00
Mike Blumenkrantz adc601aca2 tests: add instrumentation to existing tests to find slow tests
efl_check.h must be included and the EFL_START/END_TEST macros must be
used in place of normal START/END_TEST macros

timing is enabled when TIMING_ENABLED is set
https://phab.enlightenment.org/w/improve_tests/

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:25 +02:00
Cedric BAIL bc18b7e7ad efl: replace efl_del with efl_unref for cases where no parent exists
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Cedric BAIL 4c4177ac20 efl: use efl_add_ref to create objects which have no parent
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:56 -07:00
Cedric Bail fccaeb182e eo: update tests to also use efl_add_ref correctly. 2018-03-19 14:27:01 -07:00
Cedric Bail fae4ad5fbb eo: fix warning. 2018-03-07 11:01:25 -08:00
Cedric Bail 21c80b027e eo: adjust test suite to take invalidate state into account. 2018-03-07 11:00:06 -08:00
Carsten Haitzler 4a97c7d387 tests - eo - found eo_signals test is wrong... amazing it passed before
so it was listening for cb adds and dels... and or del of any cb
except the cb add/del catcher was done.. it would fail...

but ... the test actually added other cbs than this ... like:

   efl_event_callback_array_priority_add(obj, _eo_signals_callbacks(),
-100, (void *) 1);

a while array of cb's:

{ EV_A_CHANGED, _eo_signals_a_changed_cb },
{ EV_A_CHANGED, _eo_signals_a_changed_cb2 },
{ EV_A_CHANGED, _eo_signals_a_changed_never },
{ EFL_EVENT_DEL, _eo_signals_efl_del_cb });

none of which were _eo_signals_cb_added_deled. i am amazed it passed
before...

now switch its checks to check for itself and then check for anything
BUT itself...
2018-03-03 13:40:33 +09:00
Carsten Haitzler 1bdd9e4dd1 ecore - a different take on efl.app class as a super class to efl.loop
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.

every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical

no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit

for really quick examples on using this see:

https://phab.enlightenment.org/F2983118
https://phab.enlightenment.org/F2983142

they are just my test code for this.

Please see this design document:

https://phab.enlightenment.org/w/efl-loops-threads/
2018-03-03 13:40:33 +09:00