summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2016-03-07 23:40:37 +0100
committerStefan Schmidt <stefan@osg.samsung.com>2016-03-08 11:14:56 +0100
commit35c577578a22362f0628fe52332f14ad4b9ea3ff (patch)
treea8b34c3e5be753bbc6653b10b2b01e8ec51a0554
parent29028a50ce845cbfeae351cbe288ca5a6de47207 (diff)
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.
-rw-r--r--src/Makefile_Eolian.am2
-rw-r--r--src/tests/eolian/data/struct_ref_stub.c13
-rw-r--r--src/tests/eolian/data/typedef_ref_stub.c15
-rw-r--r--src/tests/eolian/eolian_generation.c5
4 files changed, 35 insertions, 0 deletions
diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am
index 50fcc4f..2f4554c 100644
--- a/src/Makefile_Eolian.am
+++ b/src/Makefile_Eolian.am
@@ -132,7 +132,9 @@ EXTRA_DIST += \
132tests/eolian/data/object_impl_ref.c \ 132tests/eolian/data/object_impl_ref.c \
133tests/eolian/data/object_impl_add_ref.c \ 133tests/eolian/data/object_impl_add_ref.c \
134tests/eolian/data/typedef_ref.c \ 134tests/eolian/data/typedef_ref.c \
135tests/eolian/data/typedef_ref_stub.c \
135tests/eolian/data/struct_ref.c \ 136tests/eolian/data/struct_ref.c \
137tests/eolian/data/struct_ref_stub.c \
136tests/eolian/data/class_simple_ref.c \ 138tests/eolian/data/class_simple_ref.c \
137tests/eolian/data/override_ref.c \ 139tests/eolian/data/override_ref.c \
138tests/eolian/data/class_simple_ref_eo.h \ 140tests/eolian/data/class_simple_ref_eo.h \
diff --git a/src/tests/eolian/data/struct_ref_stub.c b/src/tests/eolian/data/struct_ref_stub.c
new file mode 100644
index 0000000..3ad9709
--- /dev/null
+++ b/src/tests/eolian/data/struct_ref_stub.c
@@ -0,0 +1,13 @@
1#ifndef _TYPES_OUTPUT_C_STUBS
2#define _TYPES_OUTPUT_C_STUBS
3
4typedef Eo Struct;
5
6typedef struct _Named Named;
7
8typedef struct _Another Another;
9
10typedef struct _Opaque Opaque;
11
12
13#endif
diff --git a/src/tests/eolian/data/typedef_ref_stub.c b/src/tests/eolian/data/typedef_ref_stub.c
new file mode 100644
index 0000000..fe9200a
--- /dev/null
+++ b/src/tests/eolian/data/typedef_ref_stub.c
@@ -0,0 +1,15 @@
1#ifndef _TYPES_OUTPUT_C_STUBS
2#define _TYPES_OUTPUT_C_STUBS
3
4typedef Eo Typedef;
5
6typedef int Evas_Coord;
7
8typedef Eina_List *List_Objects;
9
10typedef Evas_Coord Evas_Coord2;
11
12typedef Evas_Coord2 Evas_Coord3;
13
14
15#endif
diff --git a/src/tests/eolian/eolian_generation.c b/src/tests/eolian/eolian_generation.c
index 9512e33..c63c641 100644
--- a/src/tests/eolian/eolian_generation.c
+++ b/src/tests/eolian/eolian_generation.c
@@ -116,6 +116,11 @@ START_TEST(eolian_types_generation)
116 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.c", output_filepath)); 116 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.c", output_filepath));
117 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gh", output_filepath)); 117 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gh", output_filepath));
118 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref.c", output_filepath)); 118 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref.c", output_filepath));
119
120 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "--gs", output_filepath));
121 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref_stub.c", output_filepath));
122 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gs", output_filepath));
123 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref_stub.c", output_filepath));
119} 124}
120END_TEST 125END_TEST
121 126