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.
This commit is contained in:
Daniel Kolesa 2018-05-17 16:11:03 +02:00
parent d9e723ae53
commit 42baaa046d
4 changed files with 30 additions and 0 deletions

View File

@ -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@

View File

@ -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);
}

View File

@ -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 }
};

View File

@ -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 */