Commit Graph

332 Commits

Author SHA1 Message Date
Carsten Haitzler f9e8839125 tests - let's have our own enforced master timeout of 240sec
let's not let check defaults decide. let us decide for everything with
one var. also timeout.c matches too... so 2 places i guess for now.
2024-01-09 08:14:42 +00:00
Carsten Haitzler 39b48ca430 Revert "fix warnings about redefinting EWAPI etc. due to windows EAPI changes"
This reverts commit e2d6691d52.
This reverts commit c02b796fdb.
This reverts commit 6c969f6b7d.
This reverts commit 74204bccd7.
This reverts commit 1304d95717.
This reverts commit 7c85be9674.

revert the EAPI changes that break cxx bindings build. sorry :( more
fixes needed than i thought
2021-05-26 15:46:25 +01:00
Felipe Magno de Almeida 74204bccd7 ecore: Rename EAPI macro to ECORE_API in Ecore library
Summary:
=  The Rationale =

EAPI was designed to be able to pass
`__attribute__ ((visibility ("default")))` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
`__atttribute__((visibility("default")))`.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
EAPI is the only solution that worked for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>

Reviewers: vtorri, raster

Reviewed By: raster

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12271
2021-05-23 20:47:23 +01:00
Carsten Haitzler 42c123d1d7 singularize srand in eina_init - only once in one place
simplify down to having a single srand() in eina_init and use urandom
if it works and is there - if not, time(NULL) will do. it's the best
we can...
2020-10-03 20:46:50 +01:00
Mike Blumenkrantz e0cf299ae5 tests: resolve float comparison warnings
Summary: Depends on D11788

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11789
2020-05-09 09:25:14 +01:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
Marcel Hollerbach 39f3ce42dc ecore_evas: Introduce cnp / dnd API for ecore evas
The idea of copy and paste here is:
- The user specifies the content he wants to have in the selection
  buffer with a Eina_Content, these content pointer ownerships are
  passed to the called. Internally ecore_evas code will memorieze the
  pointer, and pass on function callbacks to the modules, which then do
  not have to deal with the ownership.

- In case the module does not specify these APIs, the callback
  implementation will be called, which only works for cnp *not* dnd.

- Action and mime types are handled as strings, which allows way better
  custom organisations.

(The docs needs improvement)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11192
2020-03-08 10:59:25 +01:00
Cedric BAIL c7508d3d52 eina: add test for eina_future_all_iterator.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11181
2020-01-31 10:11:32 -08:00
Mike Blumenkrantz 78bc0b77b7 tests/efl_app: add port of intensive timer recursion
this is roughly the same as the similarly-named ecore_timer unit test

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10556
2019-10-30 08:49:12 -07:00
Mike Blumenkrantz 7a2fa2c614 tests/ecore: add intensive test for recursive timer usage
this recurses the mainloop to a depth of 8, continually creating and
triggering timers as it progresses and tracking the states to ensure that
everything is working as expected regardless of depth

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10547
2019-10-30 08:49:09 -07:00
Mike Blumenkrantz 7b374754cb tests/ecore: do not create global test timeout timer if running unforked
this is a pita for debugging

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10546
2019-10-30 08:49:08 -07:00
Mike Blumenkrantz 9870b7992d tests/loop_timer: add port of ecore_timer behavior tests for loop_timer
ensure that the behavior here is also working exactly as expected

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10531
2019-10-29 16:09:49 +01:00
Mike Blumenkrantz cb23d14d11 tests/ecore: make timer behavior test even more strict
we need to also verify that timers will process out of order solely based
on their timestamps and ignoring whether they are "recently-added"

additionally verify the behavior of timer interval changing and re-instantiating

ref T8434

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10530
2019-10-29 16:09:45 +01:00
Mike Blumenkrantz 0da0b8ea55 tests/ecore: add more grueling timer throughput test
this verifies that:
* newly-created timers are not triggered in the next loop iteration
* newly-created timers can be triggered the second loop after created
* multiple timers can be triggered in a single loop iteration
* timers are effectively added to the pending timer list

ref T8434

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10516
2019-10-29 16:09:00 +01:00
Mike Blumenkrantz 59ad959e85 tests/ecore: ensure that we attempt to re-set PATH in ecore-file tests
Summary:
if this test failed before for any reason, PATH would be permanently changed
for the current shell and process, which is obviously not what we want
Depends on D10414

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10415
2019-10-24 18:23:14 +02:00
Mike Blumenkrantz 30f6c12cbf tests/ecore: replace all bespoke strcats with snprintf
Summary:
CID 1400812
Depends on D10413

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10414
2019-10-24 18:23:11 +02:00
Mike Blumenkrantz e05311a99a tests/ecore: unset app args after app args unit test to prevent invalid reads
Summary:
various internal components in efl access the app args and read them which
will result in invalid memory access since these are stack-allocated strings
Depends on D10412

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10413
2019-10-24 18:23:03 +02:00
Mike Blumenkrantz 8cef6a9724 tests: fix minor string leaks
Summary: CIDs 1404754, 1401022, 1400965

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10405
2019-10-18 13:29:13 -04:00
Xavi Artigas 835e230f2f Revert "eolian: disallow missing docs for stable API where necessary"
I'm afraid but this breaks the mono bindings too close to a release.
This also fixes the missing docs errors by adding a lot of inconsistent
placeholder text ("No description supplied.", "TBD") which will make
finding them later on more complicated.

I was the one that asked for this feature but it is not critical at this
point, so I suggest we explore some refinements (like T8291) before landing
this patch in its current state.

This reverts commit 2946cb3c32.
2019-09-30 19:48:19 +02:00
Daniel Kolesa 2946cb3c32 eolian: disallow missing docs for stable API where necessary
The things that require docs include classes, variables, typedecls,
events and methods/properties. Implements, params, returns, parts
and struct/enum fields don't require them.

Empty/whitespace only string does not count as documentation.
2019-09-30 18:21:17 +02:00
Mike Blumenkrantz da5fcb8ea0 ecore/signal: increase maximum signal throughput
this adds 4 more signal handling fds and loops over them for reading/writing
signal info in order to handle more signals when the buffer of one (or more)
pipes is full

also update the unit test to verify that we are receiving all the events without
dropping any and bump the number of signals to 2000 since we should now be able to
handle that many

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10027
2019-09-19 14:37:16 -07:00
Mike Blumenkrantz af5abbe4bc tests/ecore: add stress test for main loop signal handling
this explodes after about 500 signals, so make it 1000 for a good test

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10026
2019-09-19 14:37:14 -07:00
Vincent Torri 5e9b301533 efl_app_test_promise: fix warning (no returned value)
Test Plan: compilation

Reviewers: cedric, zmike, raster

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9926
2019-09-12 14:46:06 -04:00
Lauro Moura d0e10dd273 ecore: Fix download test.
Summary:
After ecore_main_loop_quit() changes, calling it from outside the main
loop does not make the next iteration of the main loop quit, causing the
original version of the test to deadlock.

Also update the function documentation about it.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, felipealmeida, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9448
2019-07-30 15:22:03 -04:00
Mike Blumenkrantz a5420ac8f3 tests/ecore: verify that quit() -> begin() does not pre-cancel main loop
Summary: ref 17f433c57b

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9375
2019-07-25 13:35:41 -04:00
Cedric BAIL e0ee318fe1 eo: use efl_provider_{un,}register infrastructure instead of Efl_Loop one.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9296
2019-07-17 21:57:57 +02:00
Cedric BAIL 42b293ae1f ecore: do not rely on implicit rules for memory lifecycle during test.
Summary:
alloca force the memory to be accessible for the entire duration of the
scope of the function it is called from. This will garantee that the
memory pointer are not recycled under our feet before we check them.

T8020

Reviewers: zmike

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8020

Differential Revision: https://phab.enlightenment.org/D9127
2019-06-20 09:40:34 -04:00
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
Xavi Artigas 2b7d26790a Fix miscellaneous build warnings
Nothing serious, but they were driving me mad.
2019-06-19 10:19:49 +02:00
Mike Blumenkrantz 7c7998b3dc meson: enforce 61s timeout for tests, remove explicit timeouts from build files
unit tests automatically abort with info after 60s, and tests should be run with
an appropriate timeout to avoid conflict with the test runner's default 30s timeout

set explicit timeout in eio test for now because there's still frequent bugs here

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8894
2019-05-15 18:49:51 +02:00
Cedric BAIL 524139a16f ecore: make sure that ecore stay initialized during the full test.
efl_app_test_promise.c is slightly special and corrective action have to be
taken to make sure that ecore_init return the right value when the no fork
mode of libcheck is used.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8566
2019-05-09 10:15:49 -07:00
Christopher Michael 9ea2e60b29 ecore_test_ecore_file: Fix resource leak
Summary:
Coverity reports that we leak the store returned from
ecore_file_realpath so add a call to free the returned storage when we
are done with it

Fixes CID1400825

@fix
Depends on D8777

Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8778
2019-05-02 13:48:00 +02:00
Mike Blumenkrantz 59526ba58d build: use only BUILD_ECORE_IMF_XIM as a define
Summary:
meson and autotools were a bit out of sync with this, resulting in
unexpected behavior

Reviewers: billiob

Reviewed By: billiob

Subscribers: billiob, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8641
2019-04-17 15:45:35 -04:00
Mike Blumenkrantz f5d3030d7b tests: unset eina log callback at end of each efl_app promise test
Summary: ensure that this doesn't trigger cascading errors

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8514
2019-04-02 08:34:18 -04:00
Lauro Moura 683958ee68 eo: Correctly name Realized classes.
The previous preprocessor rule was generating strings like
"\"Efl.App\"_Realized.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8527
2019-04-02 11:02:27 +02:00
Daniel Kolesa d3c5384cd0 eolian: enable checking of beta/stable contexts in all classes
Summary:
This enables all the checks unconditionally, without ignoring
classes that don't have an Efl namespace. This required a lot
of beta marking to make it build. It most likely doesn't
mark types correctly, as that is not fully enabled yet.

Reviewers: zmike, cedric, segfaultxavi, bu5hm4n

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8266
2019-03-11 13:42:29 +01:00
Mike Blumenkrantz 632bd45825 efl.loop_timer: rename all methods/properties/events
Summary:
avoid potential future conflict by not using conflict-able names

ref T7731

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7731

Differential Revision: https://phab.enlightenment.org/D8256
2019-03-08 16:38:46 +01:00
Marcel Hollerbach d0709d6110 eolian: validate betaness
Summary:
if there is a none beta class, then this class should not depend on beta
classes in parameters / event types / return types, parent inherits.
This adds this validation, so we can start to slowly to unbeta more and
more classes.

Reviewers: q66, zmike, cedric, segfaultxavi

Reviewed By: q66

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7999
2019-02-25 14:00:28 +01:00
Marcel Hollerbach 078ccd1ca9 efl_loop / efl_app: make efl_app / efl_loop abstract
this is done inorder to ensure that noone ever thinks of creating theire
own app/loop object.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7982
2019-02-21 19:13:39 +01:00
Carsten Haitzler 8e98c7eef9 cmdline iface - fix to consume input array AND strings totally
strings often enough are generated e.g. via "%s/%s" or "%i" or similar
etc. ... i have poitned to examples, so move to make all strings
consistently stringshared, fix a bug added to the efl thread code
where it accessed and freed array even tho array was consumed (but not
strings) in the set, and the code used free to consume not
stringshare_del. fix other code and tests to match

EXCTLY the kind of bugs and mistakes with this kind of design that i
said would happen more often just happened...
2019-02-15 10:21:04 +00: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 3b262340ba Revert "Revert command line array object because it's broken by design"
This reverts commit a57c7f7510.

I pretty much hate to just revert your revert, but you failed to read my
replies, and failed to understand what i was talking about.

And YES we talked at fosdem about the platform issue, and do you
remember my answer, that back in time this might be the case, today is
different freebsd suppoerts setenv, and for windows we have a setenv
implementation in evil. And yes, vtorri also created a issue how bad and
evil this commit is, however, i still fail to see the issue since setenv
unsetenv and clearenv usages are taken as needed. (T7693)

The ownership question is answered in
https://phab.enlightenment.org/D7516#137367.

Can we please get into a state of technical discussions, and not *oh
shit, i am going to revert this* this has been in review for a long
time, a lots of people have tested it, we discussed things on it, and
there was 3 weeks of no reply from you.

The issues that exist will be dealed with. Feel free to create tasks if
you want :)
2019-02-12 21:42:33 +01:00
Marcel Hollerbach 06160466e8 Revert "Revert the env object because it's broken portability - please redo"
This reverts commit d6294fa22b.
2019-02-12 21:34:27 +01:00
Carsten Haitzler d6294fa22b Revert the env object because it's broken portability - please redo
setenv and unsetenv are not portable. i explained to you at fosdem
there are issues and it's why i used putenv in the original
implementation and even though it's a pain (the string tou pass to
putenv is a pointer used literallt from there on in and you get it
from getenv, thus making ownership a pain -this is a libc issue we
can't readily solve). use putenv like the original code. then put it
back in. vtorri now has windows porting issues with the setenv use. i
knew there was a reason that still existed...

in addition your in_sync stuff is broken.  psuedocode:

// assuming BLAGH env is not set to anything here
c = efl_core_env_get(global_env, "BLAH");
...
putenv("BLAH=10");
...
c = efl_core_env_Get(global_env, "BLAH");

i will get NULL in both cases for c ... but i should get "10" for the
2nd in reality. reality is lots of code across application code and
libraries will at times mess with the environment. it has to work with
this. the prior implementation did work with this.

Revert "ecore: here comes a env object"
  This reverts commit 2373d5db5b.

Revert "efl_task: remove env from this object"
  This reverts commit c3d69f66a6.
2019-02-12 20:22:28 +00:00
Carsten Haitzler a57c7f7510 Revert command line array object because it's broken by design
Revert "ecore: get rid of commands in efl_task."
  This reverts commit 616381e9cf.
Revert "ecore: here comes a command line object"
  This reverts commit 48e5684b3c.

1. this is broken:

EOLIAN static const char*
_efl_core_command_line_command_get(const Eo *obj EINA_UNUSED, Efl_Core_Command_Line_Data *pd)
{
   return eina_strdup(pd->string_command);
}

it returns a const char * BUT it duplicates it on return. no. a big
fat honking NO. return a char * or don't duplicate. pick.

2. _efl_core_command_line_command_array_set() is broken by design. it
accepts an array of strings, but the strings are owned by the caller
who creates the array (requiring they free them up themselves after
this call) but the array becomes owned by the callee. the code here frees the
incoming array but doesn't care about the string content of it. it's
leak heaven waiting to happen (or bugs when someone wants to access
the array they create to walk it to free the strings they put into it
after it is set).

i brought this up and it was dismissed. now exactly he issue i brought
up is there with mixed ownership and the added complexity as well as
transfer of some ownership but not others.

go back and think about this so it isn't broken by design.
2019-02-12 19:54:35 +00:00
Marcel Hollerbach 48e5684b3c ecore: here comes a command line object
the mixin for now can carry a command, which can be setted as an string.
The string is then parsed again, this is done in order to make sure that
everything that needs escaping really is escaped or parsed correctly.

Differential Revision: https://phab.enlightenment.org/D7516
2019-02-12 11:19:28 +01:00
Marcel Hollerbach 2373d5db5b ecore: here comes a env object
the env object can be used to alter and edit the content of environment
variables. Additionally, the class efl.core.env can be used to to setup
a not applied set of environment variables, which then can be applied
later (in the future) to set it directly to a spawned process for
example, or as a general key/data storage. A efl.core.env object can
also be forked off, which makes it easy to customize predefined objects.

ref T7514

Differential Revision: https://phab.enlightenment.org/D7510
2019-02-12 11:19:28 +01:00
Mike Blumenkrantz 93694ffd12 tests: improve efl loop test (concentric)
I forgot to spin the sub-loop, so this was previously just a test to verify
that the IDLE callback was working.

now this spins the sub-loop on the idle callback and tests the idle enter
callback to verify that the main loop is being iterated

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Differential Revision: https://phab.enlightenment.org/D7874
2019-02-04 14:11:48 -06:00
Mike Blumenkrantz 21bdcf4265 tests: add explicit test for concentric loop usage
having multiple loops which interact is a valid use case that should be
tested to ensure functionality

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Differential Revision: https://phab.enlightenment.org/D7868
2019-02-01 15:13:36 -06:00
Marcel Hollerbach 015fbac20d ecore: make ecore_audio_out abstract
ecore_audio does define format and source, those are then used in some
leave classes, ecore_audio is only used in the tests, and should not be
used externally. Therefore make it abstract.
The other missing implementations are in the leave classes,
They are resolved with providing empty implementations, since no format
switching is supported.

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7782
2019-01-26 11:42:12 +01:00