eolian: add an envvar to warn about unimplemented beta funcs

This changes the behavior of the existing env var to only check
unimplemented functions in stable APIs by default. Beta checks
can be enabled with an additional environment var, so use
EOLIAN_CLASS_UNIMPLEMENTED_WARN for stable and
EOLIAN_CLASS_UNIMPLEMENTED_BETA_WARN for extra beta checks.
This commit is contained in:
Daniel Kolesa 2019-08-09 16:09:25 +02:00
parent 7248812a51
commit 510d437246
1 changed files with 9 additions and 0 deletions

View File

@ -13,6 +13,7 @@ typedef struct _Validate_State
Eina_Bool warned;
Eina_Bool stable;
Eina_Bool unimplemented;
Eina_Bool unimplemented_beta;
} Validate_State;
static Eina_Bool
@ -870,14 +871,21 @@ _db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs,
Eina_Bool succ = EINA_TRUE;
/* unimplemented checks are not enabled for any objects */
if (!vals->unimplemented)
return EINA_TRUE;
/* class is beta and we didn't enable unimplemented checking for those */
if (!vals->unimplemented_beta && cl->base.is_beta)
return EINA_TRUE;
Eina_List *l;
Eolian_Implement *impl;
EINA_LIST_FOREACH(cl->callables, l, impl)
{
const Eolian_Function *fid = impl->foo_id;
if (!vals->unimplemented_beta && fid->base.is_beta)
continue;
Impl_Status st = (Impl_Status)eina_hash_find(fs, &fid);
/* found an interface this func was originally defined in in the
* composite list; in that case, ignore it and assume it will come
@ -1427,6 +1435,7 @@ database_validate(const Eolian_Unit *src)
EINA_FALSE,
EINA_TRUE,
!!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"),
!!getenv("EOLIAN_CLASS_UNIMPLEMENTED_BETA_WARN"),
};
/* do an initial pass to refill inherits */