q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=42baaa046dee716d469a5f2ea05493c049dbda6d
commit 42baaa046dee716d469a5f2ea05493c049dbda6d Author: Daniel Kolesa <d.kol...@samsung.com> Date: Thu May 17 16:11:03 2018 +0200 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. --- src/Makefile_Eolian.am | 2 ++ src/tests/eolian/eolian_static.c | 26 ++++++++++++++++++++++++++ src/tests/eolian/eolian_suite.c | 1 + src/tests/eolian/eolian_suite.h | 1 + 4 files changed, 30 insertions(+) diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am index 3580893d49..2b84287140 100644 --- a/src/Makefile_Eolian.am +++ b/src/Makefile_Eolian.am @@ -114,6 +114,7 @@ tests/eolian/eolian_suite tests_eolian_eolian_suite_SOURCES = \ tests/eolian/eolian_parsing.c \ +tests/eolian/eolian_static.c \ tests/eolian/eolian_generation.c \ tests/eolian/eolian_generated_future.c \ tests/eolian/eolian_suite.c \ @@ -126,6 +127,7 @@ CLEANFILES += tests/eolian/generated_future.eo.h tests/eolian/generated_future.e tests_eolian_eolian_suite_CPPFLAGS = -I$(top_builddir)/src/lib/efl -I$(top_builddir)/src/tests/eolian \ -DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eolian\" \ -DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eolian\" \ +-DEO_SRC_DIR=\"$(top_srcdir)/src/lib\" \ -DEOLIAN_GEN="\"$(EOLIAN_GEN)\"" \ @CHECK_CFLAGS@ \ @EOLIAN_CFLAGS@ @EO_CFLAGS@ diff --git a/src/tests/eolian/eolian_static.c b/src/tests/eolian/eolian_static.c new file mode 100644 index 0000000000..fc156beb56 --- /dev/null +++ b/src/tests/eolian/eolian_static.c @@ -0,0 +1,26 @@ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <Eolian.h> + +#include "eolian_suite.h" + +EFL_START_TEST(eolian_static_check) +{ + Eolian_State *eos = eolian_state_new(); + fail_if(!eolian_state_directory_add(eos, EO_SRC_DIR)); + fail_if(!eolian_state_all_eot_files_parse(eos)); + fail_if(!eolian_state_all_eo_files_parse(eos)); +#if 0 + /* too many failures to enable this yet */ + fail_if(!eolian_state_check(eos)); +#endif + eolian_state_free(eos); +} +EFL_END_TEST + +void eolian_static_test(TCase *tc) +{ + tcase_add_test(tc, eolian_static_check); +} diff --git a/src/tests/eolian/eolian_suite.c b/src/tests/eolian/eolian_suite.c index 491013950e..3b6de0a68d 100644 --- a/src/tests/eolian/eolian_suite.c +++ b/src/tests/eolian/eolian_suite.c @@ -12,6 +12,7 @@ static const Efl_Test_Case etc[] = { { "Eolian Parsing", eolian_parsing_test}, + { "Eolian Static Analysis", eolian_static_test}, { "Eolian Generation", eolian_generation_test}, { NULL, NULL } }; diff --git a/src/tests/eolian/eolian_suite.h b/src/tests/eolian/eolian_suite.h index 9a7ac72e15..d40b1df924 100644 --- a/src/tests/eolian/eolian_suite.h +++ b/src/tests/eolian/eolian_suite.h @@ -4,6 +4,7 @@ #include <check.h> #include "../efl_check.h" void eolian_parsing_test(TCase *tc); +void eolian_static_test(TCase *tc); void eolian_generation_test(TCase *tc); #endif /* _EOLIAN_SUITE_H */ --