tests eolian: add test cases for type stub generations

While we had the functionality to generate type stubs header we never had
these tested in our unit test setup. Adding to simple cases for struct
and typedef which we already use for normal header generation tests.
This commit is contained in:
Stefan Schmidt 2016-03-07 23:40:37 +01:00
parent 29028a50ce
commit 35c577578a
4 changed files with 35 additions and 0 deletions

View File

@ -132,7 +132,9 @@ EXTRA_DIST += \
tests/eolian/data/object_impl_ref.c \
tests/eolian/data/object_impl_add_ref.c \
tests/eolian/data/typedef_ref.c \
tests/eolian/data/typedef_ref_stub.c \
tests/eolian/data/struct_ref.c \
tests/eolian/data/struct_ref_stub.c \
tests/eolian/data/class_simple_ref.c \
tests/eolian/data/override_ref.c \
tests/eolian/data/class_simple_ref_eo.h \

View File

@ -0,0 +1,13 @@
#ifndef _TYPES_OUTPUT_C_STUBS
#define _TYPES_OUTPUT_C_STUBS
typedef Eo Struct;
typedef struct _Named Named;
typedef struct _Another Another;
typedef struct _Opaque Opaque;
#endif

View File

@ -0,0 +1,15 @@
#ifndef _TYPES_OUTPUT_C_STUBS
#define _TYPES_OUTPUT_C_STUBS
typedef Eo Typedef;
typedef int Evas_Coord;
typedef Eina_List *List_Objects;
typedef Evas_Coord Evas_Coord2;
typedef Evas_Coord2 Evas_Coord3;
#endif

View File

@ -116,6 +116,11 @@ START_TEST(eolian_types_generation)
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.c", output_filepath));
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gh", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref.c", output_filepath));
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "--gs", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref_stub.c", output_filepath));
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gs", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref_stub.c", output_filepath));
}
END_TEST