Commit Graph

348 Commits

Author SHA1 Message Date
Mike Blumenkrantz d4bcd7c8eb tests/eolian: remove eolian_decl test
Summary:
<q66> just remove decl.eo and remove the eolian_decl test; it's useless
<q66> the reason: it used to be testing some specific API, which got replaced with more generalized API that is now used everywhere in the tests, so that specific test no longer has a purpose

resolves some compile errors due to type conflicts

Reviewers: q66

Reviewed By: q66

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6773
2018-08-07 12:10:22 -04:00
Daniel Kolesa 1673b620b0 eolian: push missing event type changes in tests 2018-05-21 20:32:57 +02:00
Daniel Kolesa 42baaa046d eolian: add code to run static checks but don't enable yet
This adds code to run the Eolian static checker as part of tests,
but considering how many failures there are at this point, does
not enable it. Once they're all fixed, it can be enabled by
removing the #if 0.
2018-05-17 16:11:03 +02:00
Cedric BAIL ea7d33e7bd eo: remove tests for old Efl_Future, but leave infra in place for testing later new Eina_Future.x 2018-05-01 10:39:01 -07:00
Daniel Kolesa 543902f2ba eolian: make doc ref resolution global
Doc refs no longer introduce new dependencies into files. Instead,
they're parsed globally, and any doc ref lookup is also made
globally. This allows unit based dependencies to correspond more
to what files actually really need at compile time/runtime, with
docs being irrelevant to that; it also simplifies the API.

The doc resolution API now takes Eolian_State instead of
Eolian_Unit, too.
2018-04-18 16:38:14 +02:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +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
Daniel Kolesa bf1e3a702f eolian: event/function_get_by_name -> by_name_get 2018-03-16 14:26:15 +01:00
Daniel Kolesa 2d0a25c995 eolian: refactor doc ref resolution API 2018-03-14 16:51:11 +01:00
Daniel Kolesa 1f4d919cf9 eolian: update type/var name APIs 2018-03-12 16:28:28 +01:00
Daniel Kolesa edcd81ee49 eolian: update class name APIs 2018-03-12 16:03:37 +01:00
Daniel Kolesa c7fd43ad4e eolian: return Eolian_Object_Type from ref resolver
This needs only one enum and allows for better interop.
2018-03-09 15:25:36 +01:00
Daniel Kolesa 1e8de641d8 eolian: tests for new object apis 2018-03-08 23:16:40 +01:00
Daniel Kolesa c6e0b7f44e eolian: remove obsolete file_get APIs 2018-03-08 22:54:12 +01:00
Daniel Kolesa 482c5d1ba2 eolian: get rid of old APIs for typedecl retrieval 2018-03-07 13:53:08 +01:00
Daniel Kolesa f596a97da6 eolian: remove old variable retrieval APIs 2018-03-07 13:25:28 +01:00
Daniel Kolesa 434b0a399d eolian: remove old class retrieval APIs 2018-03-07 13:08:49 +01:00
Daniel Kolesa b7e0553b61 eolian: replace directory_scan and file_parse in tests 2018-03-02 13:21:20 +01:00
Daniel Kolesa 6a284e48c9 eolian: eolian_* -> eolian_state_*, Eolian -> Eolian_State 2018-02-27 16:12:35 +01:00
Daniel Kolesa d47610a732 eolian: do not require unit when stringifying types
As it is no longer necessary to pass unit when evaluating exprs,
it is not necessary to pass it here either. Convert all the APIs
to the new style and update all instances in our tree.
2018-01-16 16:39:05 +01:00
Daniel Kolesa dd2e579fec eolian: do not require unit for expr eval APIs
The necessary information is now stored directly in the expr
during database validation.

Also enable expr validation for params.
2018-01-16 16:37:52 +01:00
Daniel Kolesa c6436337a4 eolian: aliased_base_get funcs don't need unit 2018-01-12 18:05:13 +01:00
Daniel Kolesa 19c16b671e eolian: type_typedecl_get doesn't need a unit 2018-01-12 18:05:13 +01:00
Marcel Hollerbach 87a93b8521 eolian: unify test directories 2017-12-21 22:24:47 +01:00
Daniel Kolesa 18e18ca74c eolian: remove remaining global state (+ modify APIs accordingly) 2017-12-15 17:11:11 +01:00
Daniel Kolesa c8aa30e698 eolian: make declaration APIs use units 2017-12-15 17:11:11 +01:00
Daniel Kolesa 8a1f93f698 eolian: pass state where necessary
This modifies the API so that global state removal is made
possible. It's still used internally for now but externally
the state is contained.
2017-12-05 16:41:42 +01:00
Jean-Philippe Andre d49c544e81 eolian: Add API's for part enumeration
@feature
2017-11-23 15:14:41 +09:00
Daniel Kolesa 2f81b26367 eolian: scan system dir by default
The '-S' option lets you reverse that. But by default, most
people will want the prefix to be scanned for eo files.
2017-11-14 13:47:09 +01:00
Daniel Kolesa f19a905261 eolian: fix generation tests 2017-11-10 19:43:25 +01:00
Daniel Kolesa 9ec1b4fa53 eolian: fix tests following the container restrictions 2017-11-02 14:03:30 +01:00
Daniel Kolesa 4f8a9b50f4 eolian: make inherits_get return a list of classes, not strings
Most of the time you need to retrieve the class from the string
anyway, so remove this relic of old Eolian and gain some small
performance benefits and extra convenience.

Subtly breaks API but everything should be updated.
2017-10-25 16:25:41 +02:00
Daniel Kolesa b88132932a eolian: fix setter generation for @auto functions
Because of a typo in generator source (and overlooked error in
tests) we were previously generating incorrect code for setters
with the @auto qualifier. This was brought up in D5306 and is
now fixed.
2017-10-13 23:49:57 +02:00
Daniel Kolesa 5699466dba eolian gen: generate documentation for first object param if present
This prevents doxygen from emitting warnings.

Fixes T6186.
2017-10-13 15:18:18 +02:00
Marcel Hollerbach 79e21e90e0 eolian: add tests for the new owning functions 2017-09-29 11:28:15 +02:00
Daniel Kolesa 68e9f2ced5 eolian: fix tests after extra checks 2017-09-28 23:25:12 +02:00
Daniel Kolesa 6587b19e77 eolian: add tests for builtin queries 2017-09-22 21:03:28 +02:00
Daniel Kolesa 1577c576e6 eolian: remove static_array and terminated_array
These types are of questionable value and the API was not entirely
thought out - remove for now, and if a legitimate use is found
later, they may be readded (with a better API), but typically it
seems best to redesign the bad APIs around safe containers...
2017-09-22 18:01:15 +02:00
Daniel Kolesa f36e5bd543 eolian: add mstring
This is a new type representing a mutable string (no const).
Regular strings cannot be made mutable with @owned because
they might be hidden behind typedefs.
2017-09-22 17:10:42 +02:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Daniel Kolesa 1afd3c215f eolian: correctness fixes in tests and eo files 2017-09-15 17:48:28 +02:00
Daniel Kolesa d05127eb1a eolian: make test data validate 2017-09-13 23:58:47 +02:00
Daniel Kolesa 10fd3c32e8 eolian: remove c_only
Unused and of questionable value.
2017-08-30 19:46:41 +02:00
Daniel Kolesa 2071bbe8fb eolian: clean up and fix function pointer generation
Out/inout params are now correctly handled.
2017-08-30 15:45:20 +02:00
Daniel Kolesa 4733b206dd eolian: fix tests 2017-08-10 12:47:56 +02:00
Lauro Moura 1634c14169 eolian: function pointers
First steps toward explicit function pointer support in eolian.

To declare a function pointer type, use the following syntax, similar to
a regular eolian method declaration.

function FunctionName {
  params {
    ...
  }
  return: Return type
}
2017-06-18 12:09:22 -03:00
Daniel Kolesa d2280f91a1 eolian: use unit in typedecl c_type_get 2017-05-30 17:15:54 +02:00
Daniel Kolesa a5e66b3421 eolian: doc token ref resolver now takes unit 2017-05-30 17:15:54 +02:00
Daniel Kolesa c234b5ee69 eolian: expr eval APIs now take units 2017-05-30 17:15:54 +02:00
Daniel Kolesa 4f88aa424d eolian: use units in by_file getters for typedecls 2017-05-30 17:15:54 +02:00
Daniel Kolesa 67bc32d9ac eolian: pass unit to enum get by name 2017-05-30 17:15:54 +02:00
Daniel Kolesa 9c2dae3531 eolian: pass unit to struct get by name 2017-05-30 17:15:54 +02:00
Daniel Kolesa 52a0255e38 eolian: pass unit to alias get by name 2017-05-30 17:15:54 +02:00
Daniel Kolesa 2f9c4cfef2 eolian: update tests according to unit API 2017-05-30 17:15:53 +02:00
Daniel Kolesa 653cf6bac3 eolian: make by-name variable lookups take unit 2017-05-30 17:15:53 +02:00
Daniel Kolesa da43c63ce1 eo: move event related structures and callback to C
We don't need to keep this in eo files anymore because the APIs
using them are now fully in C. This also allows removal of the
event callback builtin from Eolian.
2017-04-21 15:48:31 +02:00
Daniel Kolesa 84a584b313 eolian: fix buggy generation of auto/empty on properties
We only want to generate auto/empty function bodies on what is
specified inside the braces for properties, not for the whole
property.
2017-04-19 13:24:38 +02:00
Daniel Kolesa 53fef30db0 eolian: allow extending eolian-generated classes from within C
If you define either the macro MY_CLASS_EXTRA_OPS for normal
methods/properties or MY_CLASS_EXTRA_CLASS_OPS for class methods
or properties, which contains a comma-delimited list of ops defs
(i.e. EFL_OBJECT_OP_FUNC(...), ...) right before including the
generated my_class.eo.c file, the definitions from these will
be included in the actual class. This can be used to override
certain things in a class internally without exposing it to
Eolian, or for testing/debugging.
2017-04-13 15:56:15 +02:00
Gustavo Sverzut Barbieri 8dc853f230 ifdef RUN_IN_TREE logic.
This logic is only needed for autotools, cmake will replicate the
installation file structure and thus eina_prefix works out of box.
2017-02-03 12:36:38 -02:00
Marcel Hollerbach ea83a197be build: add eolian 2017-01-23 18:52:34 +01:00
Daniel Kolesa c1c30cc6ce eolian tests: pass in generator path externally 2017-01-23 16:14:00 +01:00
Daniel Kolesa d8f7ade9c8 eolian: fix decl.eo in tests 2017-01-23 15:32:15 +01:00
Daniel Kolesa 95181f2d36 eolian: move base function doc API into implements
This allows us to unify retrieval of docs for both regular and
overridden funcs without having two separate APIs. It's currently
missing validation and docgen is still not adjusted properly for
it either, but at least there's this. Enables retrieval of docs
for overridden funcs by default as well.
2017-01-19 15:09:07 +01:00
Daniel Kolesa 5f8172a589 eolian: add syntax for overridding docs in implements 2017-01-18 15:33:44 +01:00
Daniel Kolesa 35c5e89269 eolian: remove/add APIs and clean up implements system
As there is no need to have separate is_auto, is_empty and
is_pure_virtual for functions and implements (each function has
its own base implement by default) I removed the function ones.
Instead, I added a way to retrieve a function's base implement
so that you can instead do the checks on the implement even when
you only have the function.

I also moved base implement build directly into the parser instead
of the database filler. That allows for significant cleanup. I
also removed distinction of implement pointers in Eolian_Function
for get and set as implements now always contain an entire thing
so the pointer was always the same anyway.

Things should still behave more or less the same, but ordering
of generated functions has changed because ordering of implements
has changed.
2017-01-16 15:55:06 +01:00
Daniel Kolesa cb3f8304e0 eolian: change eo file syntax @virtual_pure -> @pure_virtual 2017-01-13 15:44:09 +01:00
Daniel Kolesa 692ae7adb6 eolian: use consistent pure_virtual naming in API
Previously one API used just virtual (incorrect) and one used
virtual_pure (which just sounds weird). So unify with a single
name, pure_virtual, similar as in other lanugages.

This does not change eo file syntax yet.
2017-01-13 15:40:29 +01:00
Daniel Kolesa 078a4eef71 eolian: strict function type input checks in APIs
Strictness of various Eolian APIs has been enhanced, for example
eolian_class_function_get_by_name now won't return anything if
you request an EOLIAN_PROPERTY and the found func is just an
EOLIAN_PROP_GET, and various APIs won't accept arbitrary inputs
like EOLIAN_UNRESOLVED or EOLIAN_PROPERTY now, instead you will
need to provide EOLIAN_PROP_GET, EOLIAN_PROP_SET or EOLIAN_METHOD
explicitly.

The purpose of this is to reduce potential bugs and fix ambiguous
behavior. Thanks to use of EINA_SAFETY, appropriate errors should
be printed into terminal when an API is used incorrectly.
2017-01-12 16:56:49 +01:00
Daniel Kolesa baaa482ebf eolian: fine-grained is_auto/is_empty for implements 2017-01-11 19:26:21 +01:00
Daniel Kolesa 289287f497 eolian: remove function_is_implemented
Its design does not match current Eolian and will be replaced later.
There isn't any generator using it right now, so it's safe to remove.
2017-01-11 19:26:21 +01:00
Daniel Kolesa 3797a269b6 eolian: allow new property impl syntax with auto/empty 2016-12-27 19:33:12 +01:00
Daniel Kolesa 12fad8444b eolian: fix doc tests to match generation output 2016-12-21 19:01:32 +01:00
Daniel Kolesa e444d43bbb eolian: handle pointer types in typechecking expr eval
Also improve expr error messages and fix Eolian tests.
2016-12-14 18:23:16 +01:00
Daniel Kolesa 2ffc93ddf9 eolian: add a reference resolver
New API function eolian_doc_token_ref_get will resolve the kind of
reference in the given token and extract the necessary data you
might need for further use, for example class and function for
methods, or struct and field for struct field. It also supports
event references that will be added into Eolian later.

EFL will be switched to the new resolver (by changing the validator
code) during the next step.
2016-12-06 19:11:17 +01:00
Daniel Kolesa 66b48f8f5d eolian: remove handling of short refs in tokenizer
Already expanded in the main lexer.
2016-12-01 17:22:19 +01:00
Daniel Kolesa d2105f99d4 eolian: add documentation tokenizer
This provides an API to tokenize Eolian docstrings. It does not
yet switch the rest of the infra to it, but it does have tests.
It doesn't verify correctness of references, as that's Eolian's
job. Therefore it's also your job to provide it with strings that
do not contain invalid references. Lua bindings are to come and
a complete switch will be done later.

@feature
2016-12-01 16:37:28 +01:00
Daniel Kolesa 8002b3b24e eolian: remove parsing of pointers and the corresponding APIs
Everything should be done via the new ptr() system now.
2016-11-10 16:20:19 +01:00
Cedric BAIL 8a3e745e1a eolian: remove test for generated Eina_Promise. 2016-11-07 13:43:11 -08:00
Daniel Kolesa f399e77a92 eolian: rename is_ref API to is_ptr to match syntax 2016-11-03 14:22:21 +01:00
Daniel Kolesa c4f64a3390 eolian: rename ref to ptr to avoid confusion with eo refs 2016-11-02 13:06:38 +01:00
Daniel Kolesa db7b6dd7e0 eolian gen: use EWAPI for events instead of EOAPI
Apparently only methods/properties can be EOAPI.
2016-10-20 16:48:41 +02:00
Daniel Kolesa 5db3f14f85 eolian gen: use EWAPI for all generated variables 2016-10-20 16:44:20 +02:00
Daniel Kolesa 930af741b9 eolian gen: automatically uppercase names for vars/constants 2016-10-20 16:01:11 +02:00
Daniel Kolesa 02aed9a043 eolian gen: update tests to cover var generation 2016-10-20 15:22:14 +02:00
Daniel Kolesa b6113a6bd9 eolian: add API to get the C class datatype 2016-10-13 15:04:20 +02:00
Daniel Kolesa e5d016bb63 eolian: add an API to get the C name used to access the class 2016-10-12 14:56:22 +02:00
Daniel Kolesa 9553fd9640 eolian gen2: move to eolian gen (as the old one is gone) 2016-10-07 13:34:47 +02:00
Daniel Kolesa 82291e9cf5 eolian gen2: fix tests to match the new generator 2016-10-07 13:13:27 +02:00
Jean Guyomarc'h eb7a11b515 tests: add missing symbols
make check failed on OSX (clang) because of missing symbols.
2016-10-01 21:19:24 +02:00
Daniel Kolesa dd9155cf24 eolian: properly add < in struct/enum field docs
Fixes T4443.
2016-09-09 13:04:04 +02:00
Tom Hacohen 7ebf9d879d Eo: Change the way functions are registered to classes
This change lets us remove a field from the structure that leads to
around 20KiB more of saving in private dirty pages in elementary.

This also looks a bit better and feels a bit cleaner.

Breaks API and ABI.
2016-09-09 11:14:35 +01:00
Cedric BAIL 36bc9aa187 eolian: add a builtin to handle a free callback. 2016-09-08 14:58:05 -07:00
Cedric BAIL ed9dff8fbd eolian: add support for future.
Future is the read only side of a Promise. For now, I am not removing
Eina_Promise until everything is in place, but eventually the promise
type of eolian will be gone.
2016-09-08 14:58:05 -07:00
Tom Hacohen bd3801247e Eo: Make function overrides implicit.
Before this commit, function overrides were explicit. That is, you'd
have to explicitly state you were overriding a function instead of
creating a new one. This made the code a tad more complex, and was also
a bit more annoying to use. This commit removes this extra piece of
information.

This means we now store much less information per function, that will
let us further optimise out structures in the future.
2016-09-08 13:59:04 +01:00
Tom Hacohen 48f7eb02a8 Eolian: Fix tests according to recent generator changes. 2016-09-05 16:03:16 +01:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Tom Hacohen 199737add5 Eolian: Fix tests according to recent eolian changes. 2016-08-23 14:47:28 +01:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Daniel Kolesa aa5068d1e2 eolian tests: fix reference file after beta in legacy change 2016-08-15 12:50:52 +01:00