summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-07 13:13:27 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-07 13:13:27 +0200
commit82291e9cf557bac6c6b1e63edca2b37a7ade380b (patch)
tree6c4913c62ca3c18ca61fb761df0ae044f421241f
parentb15d0583e75a79f434296327e0d5bdd484eddfe2 (diff)
eolian gen2: fix tests to match the new generator
-rw-r--r--src/tests/eolian/data/class_simple_ref.c37
-rw-r--r--src/tests/eolian/data/class_simple_ref_eo.h5
-rw-r--r--src/tests/eolian/data/class_simple_ref_legacy.h10
-rw-r--r--src/tests/eolian/data/docs_ref.h4
-rw-r--r--src/tests/eolian/data/docs_ref_legacy.h15
-rw-r--r--src/tests/eolian/data/override_ref.c51
-rw-r--r--src/tests/eolian/data/struct_ref.c5
-rw-r--r--src/tests/eolian/data/struct_ref_stub.c4
-rw-r--r--src/tests/eolian/data/typedef.eo2
-rw-r--r--src/tests/eolian/data/typedef_ref.c5
-rw-r--r--src/tests/eolian/data/typedef_ref_stub.c4
-rw-r--r--src/tests/eolian/eolian_generation.c113
12 files changed, 131 insertions, 124 deletions
diff --git a/src/tests/eolian/data/class_simple_ref.c b/src/tests/eolian/data/class_simple_ref.c
index 290aaa01d5..13ec8205b5 100644
--- a/src/tests/eolian/data/class_simple_ref.c
+++ b/src/tests/eolian/data/class_simple_ref.c
@@ -11,9 +11,9 @@ void _class_simple_b_set(Eo *obj, Evas_Simple_Data *pd);
11 11
12EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_simple_b_set); 12EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_simple_b_set);
13 13
14char * _class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d); 14char *_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d);
15 15
16static char * __eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d) 16static char *__eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d)
17{ 17{
18 if (c) *c = 1337.600000; 18 if (c) *c = 1337.600000;
19 return _class_simple_foo(obj, pd, a, b, c, d); 19 return _class_simple_foo(obj, pd, a, b, c, d);
@@ -21,7 +21,7 @@ static char * __eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, ch
21 21
22EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_foo, char *, NULL, EFL_FUNC_CALL(a, b, c, d), int a, char *b, double *c, int *d); 22EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_foo, char *, NULL, EFL_FUNC_CALL(a, b, c, d), int a, char *b, double *c, int *d);
23 23
24int * _class_simple_bar(Eo *obj, Evas_Simple_Data *pd, int x); 24int *_class_simple_bar(Eo *obj, Evas_Simple_Data *pd, int x);
25 25
26EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_bar, int *, 0, EFL_FUNC_CALL(x), int x); 26EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_bar, int *, 0, EFL_FUNC_CALL(x), int x);
27 27
@@ -31,20 +31,33 @@ _class_simple_class_initializer(Efl_Class *klass)
31 EFL_OPS_DEFINE(ops, 31 EFL_OPS_DEFINE(ops,
32 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_set, _class_simple_a_set), 32 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_set, _class_simple_a_set),
33 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_get, _class_simple_a_get), 33 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_get, _class_simple_a_get),
34 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo) 34 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_b_set, _class_simple_b_set),
35 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo),
36 EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_bar, _class_simple_bar)
35 ); 37 );
36
37 return efl_class_functions_set(klass, &ops, NULL); 38 return efl_class_functions_set(klass, &ops, NULL);
38} 39}
39 40
40static const Efl_Class_Description _class_simple_class_desc = { 41static const Efl_Class_Description _class_simple_class_desc = {
41 EO_VERSION, 42 EO_VERSION,
42 "Class_Simple", 43 "Class_Simple",
43 EFL_CLASS_TYPE_REGULAR, 44 EFL_CLASS_TYPE_REGULAR,
44 sizeof(Evas_Simple_Data), 45 sizeof(Evas_Simple_Data),
45 _class_simple_class_initializer, 46 _class_simple_class_initializer,
46 NULL, 47 NULL,
47 NULL 48 NULL
48}; 49};
49 50
50EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL); 51EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL);
52
53EAPI void
54evas_object_simple_b_set(Class_Simple *obj)
55{
56 efl_canvas_object_simple_b_set(obj);
57}
58
59EAPI int *
60evas_object_simple_bar(Class_Simple *obj, int x)
61{
62 return efl_canvas_object_simple_bar(obj, x);
63}
diff --git a/src/tests/eolian/data/class_simple_ref_eo.h b/src/tests/eolian/data/class_simple_ref_eo.h
index c3b5d3ea8a..4e4102b24a 100644
--- a/src/tests/eolian/data/class_simple_ref_eo.h
+++ b/src/tests/eolian/data/class_simple_ref_eo.h
@@ -1,5 +1,5 @@
1#ifndef _EOLIAN_OUTPUT_H_ 1#ifndef _EOLIAN_CLASS_SIMPLE_H_
2#define _EOLIAN_OUTPUT_H_ 2#define _EOLIAN_CLASS_SIMPLE_H_
3 3
4#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE 4#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE
5#define _CLASS_SIMPLE_EO_CLASS_TYPE 5#define _CLASS_SIMPLE_EO_CLASS_TYPE
@@ -67,5 +67,4 @@ EOAPI char *efl_canvas_object_simple_foo(Eo *obj, int a, char *b, double *c, int
67 67
68EOAPI int *efl_canvas_object_simple_bar(Eo *obj, int x); 68EOAPI int *efl_canvas_object_simple_bar(Eo *obj, int x);
69 69
70
71#endif 70#endif
diff --git a/src/tests/eolian/data/class_simple_ref_legacy.h b/src/tests/eolian/data/class_simple_ref_legacy.h
index d666d12177..12ef57a97c 100644
--- a/src/tests/eolian/data/class_simple_ref_legacy.h
+++ b/src/tests/eolian/data/class_simple_ref_legacy.h
@@ -1,5 +1,5 @@
1#ifndef _EOLIAN_OUTPUT_H_ 1#ifndef _EOLIAN_CLASS_SIMPLE_LEGACY_H_
2#define _EOLIAN_OUTPUT_H_ 2#define _EOLIAN_CLASS_SIMPLE_LEGACY_H_
3 3
4#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE 4#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE
5#define _CLASS_SIMPLE_EO_CLASS_TYPE 5#define _CLASS_SIMPLE_EO_CLASS_TYPE
@@ -13,11 +13,9 @@ typedef Eo Class_Simple;
13 13
14 14
15#endif 15#endif
16/** Class Desc Simple 16
17 *
18 * @ingroup Class_Simple
19 */
20EAPI void evas_object_simple_b_set(Class_Simple *obj); 17EAPI void evas_object_simple_b_set(Class_Simple *obj);
18
21EAPI int *evas_object_simple_bar(Class_Simple *obj, int x); 19EAPI int *evas_object_simple_bar(Class_Simple *obj, int x);
22 20
23#endif 21#endif
diff --git a/src/tests/eolian/data/docs_ref.h b/src/tests/eolian/data/docs_ref.h
index 66c143415f..fba24d0702 100644
--- a/src/tests/eolian/data/docs_ref.h
+++ b/src/tests/eolian/data/docs_ref.h
@@ -1,5 +1,5 @@
1#ifndef _EOLIAN_OUTPUT_H_ 1#ifndef _EOLIAN_DOCS_H_
2#define _EOLIAN_OUTPUT_H_ 2#define _EOLIAN_DOCS_H_
3 3
4#ifndef _DOCS_EO_CLASS_TYPE 4#ifndef _DOCS_EO_CLASS_TYPE
5#define _DOCS_EO_CLASS_TYPE 5#define _DOCS_EO_CLASS_TYPE
diff --git a/src/tests/eolian/data/docs_ref_legacy.h b/src/tests/eolian/data/docs_ref_legacy.h
index bff531352e..677d15a8ee 100644
--- a/src/tests/eolian/data/docs_ref_legacy.h
+++ b/src/tests/eolian/data/docs_ref_legacy.h
@@ -1,5 +1,5 @@
1#ifndef _EOLIAN_OUTPUT_H_ 1#ifndef _EOLIAN_DOCS_LEGACY_H_
2#define _EOLIAN_OUTPUT_H_ 2#define _EOLIAN_DOCS_LEGACY_H_
3 3
4#ifndef _DOCS_EO_CLASS_TYPE 4#ifndef _DOCS_EO_CLASS_TYPE
5#define _DOCS_EO_CLASS_TYPE 5#define _DOCS_EO_CLASS_TYPE
@@ -64,17 +64,6 @@ typedef struct _Opaque Opaque;
64 64
65 65
66#endif 66#endif
67/**
68 * @brief Docs for class.
69 *
70 * More docs for class. Testing references now. @ref Foo @ref Bar @ref Alias
71 * @ref pants @ref docs_meth @ref docs_prop_get @ref docs_prop_get
72 * @ref docs_prop_set @ref Foo.field1 @ref Bar.BAR_FOO @ref Docs
73 *
74 * @since 1.18
75 *
76 * @ingroup Docs
77 */
78 67
79/** 68/**
80 * @brief Property common documentation. 69 * @brief Property common documentation.
diff --git a/src/tests/eolian/data/override_ref.c b/src/tests/eolian/data/override_ref.c
index 31994cd9f0..e8dacf5cf0 100644
--- a/src/tests/eolian/data/override_ref.c
+++ b/src/tests/eolian/data/override_ref.c
@@ -1,4 +1,7 @@
1 1
2void _override_base_constructor(Eo *obj, Override_Data *pd);
3
4
2static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int idx EINA_UNUSED, float a, char b, int c) 5static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int idx EINA_UNUSED, float a, char b, int c)
3{ 6{
4 a = pd->a; 7 a = pd->a;
@@ -22,6 +25,19 @@ static int __eolian_override_c_get(Eo *obj EINA_UNUSED, Override_Data *pd EINA_U
22} 25}
23 26
24EOAPI EFL_FUNC_BODYV_CONST(override_c_get, int, 50, EFL_FUNC_CALL(idx), int idx); 27EOAPI EFL_FUNC_BODYV_CONST(override_c_get, int, 50, EFL_FUNC_CALL(idx), int idx);
28
29static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
30{
31 if (a) *a = pd->a;
32 if (b) *b = pd->b;
33 if (c) *c = pd->c;
34}
35
36
37static void __eolian_override_base_z_set(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int a EINA_UNUSED, char b EINA_UNUSED, float c EINA_UNUSED)
38{
39}
40
25EOAPI EFL_VOID_FUNC_BODY(override_a_set); 41EOAPI EFL_VOID_FUNC_BODY(override_a_set);
26 42
27void _override_a_get(Eo *obj, Override_Data *pd); 43void _override_a_get(Eo *obj, Override_Data *pd);
@@ -37,50 +53,33 @@ void _override_c_set(Eo *obj, Override_Data *pd, int idx, int c);
37EOAPI EFL_VOID_FUNC_BODYV(override_c_set, EFL_FUNC_CALL(idx, c), int idx, int c); 53EOAPI EFL_VOID_FUNC_BODYV(override_c_set, EFL_FUNC_CALL(idx, c), int idx, int c);
38EOAPI EFL_VOID_FUNC_BODY(override_foo); 54EOAPI EFL_VOID_FUNC_BODY(override_foo);
39 55
40void _override_base_constructor(Eo *obj, Override_Data *pd);
41
42
43static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
44{
45 if (a) *a = pd->a;
46 if (b) *b = pd->b;
47 if (c) *c = pd->c;
48}
49
50
51static void __eolian_override_base_z_set(Eo *obj EINA_UNUSED, Override_Data *pd EINA_UNUSED, int a EINA_UNUSED, char b EINA_UNUSED, float c EINA_UNUSED)
52{
53}
54
55
56static Eina_Bool 56static Eina_Bool
57_override_class_initializer(Efl_Class *klass) 57_override_class_initializer(Efl_Class *klass)
58{ 58{
59 EFL_OPS_DEFINE(ops, 59 EFL_OPS_DEFINE(ops,
60 EFL_OBJECT_OP_FUNC(base_constructor, _override_base_constructor), 60 EFL_OBJECT_OP_FUNC(base_constructor, _override_base_constructor),
61 EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
62 EFL_OBJECT_OP_FUNC(base_z_set, __eolian_override_base_z_set),
63 EFL_OBJECT_OP_FUNC(override_b_set, __eolian_override_b_set), 61 EFL_OBJECT_OP_FUNC(override_b_set, __eolian_override_b_set),
64 EFL_OBJECT_OP_FUNC(override_bar, __eolian_override_bar), 62 EFL_OBJECT_OP_FUNC(override_bar, __eolian_override_bar),
65 EFL_OBJECT_OP_FUNC(override_c_get, __eolian_override_c_get), 63 EFL_OBJECT_OP_FUNC(override_c_get, __eolian_override_c_get),
64 EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
65 EFL_OBJECT_OP_FUNC(base_z_set, __eolian_override_base_z_set),
66 EFL_OBJECT_OP_FUNC(override_a_set, NULL), 66 EFL_OBJECT_OP_FUNC(override_a_set, NULL),
67 EFL_OBJECT_OP_FUNC(override_a_get, _override_a_get), 67 EFL_OBJECT_OP_FUNC(override_a_get, _override_a_get),
68 EFL_OBJECT_OP_FUNC(override_b_get, _override_b_get), 68 EFL_OBJECT_OP_FUNC(override_b_get, _override_b_get),
69 EFL_OBJECT_OP_FUNC(override_c_set, _override_c_set), 69 EFL_OBJECT_OP_FUNC(override_c_set, _override_c_set),
70 EFL_OBJECT_OP_FUNC(override_foo, NULL) 70 EFL_OBJECT_OP_FUNC(override_foo, NULL)
71 ); 71 );
72
73 return efl_class_functions_set(klass, &ops, NULL); 72 return efl_class_functions_set(klass, &ops, NULL);
74} 73}
75 74
76static const Efl_Class_Description _override_class_desc = { 75static const Efl_Class_Description _override_class_desc = {
77 EO_VERSION, 76 EO_VERSION,
78 "Override", 77 "Override",
79 EFL_CLASS_TYPE_REGULAR, 78 EFL_CLASS_TYPE_REGULAR,
80 sizeof(Override_Data), 79 sizeof(Override_Data),
81 _override_class_initializer, 80 _override_class_initializer,
82 NULL, 81 NULL,
83 NULL 82 NULL
84}; 83};
85 84
86EFL_DEFINE_CLASS(override_class_get, &_override_class_desc, BASE_CLASS, NULL); 85EFL_DEFINE_CLASS(override_class_get, &_override_class_desc, BASE_CLASS, NULL);
diff --git a/src/tests/eolian/data/struct_ref.c b/src/tests/eolian/data/struct_ref.c
index 6322bb9435..cb64af6cb3 100644
--- a/src/tests/eolian/data/struct_ref.c
+++ b/src/tests/eolian/data/struct_ref.c
@@ -1,5 +1,5 @@
1#ifndef _TYPES_OUTPUT_C_ 1#ifndef _EOLIAN_TYPEDEF_H_
2#define _TYPES_OUTPUT_C_ 2#define _EOLIAN_TYPEDEF_H_
3 3
4#ifndef _STRUCT_EO_CLASS_TYPE 4#ifndef _STRUCT_EO_CLASS_TYPE
5#define _STRUCT_EO_CLASS_TYPE 5#define _STRUCT_EO_CLASS_TYPE
@@ -43,5 +43,4 @@ EOAPI char *struct_foo(Eo *obj, int idx);
43 43
44EOAPI Named *struct_bar(Eo *obj); 44EOAPI Named *struct_bar(Eo *obj);
45 45
46
47#endif 46#endif
diff --git a/src/tests/eolian/data/struct_ref_stub.c b/src/tests/eolian/data/struct_ref_stub.c
index 3ad9709bd9..19ed7140c0 100644
--- a/src/tests/eolian/data/struct_ref_stub.c
+++ b/src/tests/eolian/data/struct_ref_stub.c
@@ -1,5 +1,5 @@
1#ifndef _TYPES_OUTPUT_C_STUBS 1#ifndef _EOLIAN_TYPEDEF_STUB_H_STUBS
2#define _TYPES_OUTPUT_C_STUBS 2#define _EOLIAN_TYPEDEF_STUB_H_STUBS
3 3
4typedef Eo Struct; 4typedef Eo Struct;
5 5
diff --git a/src/tests/eolian/data/typedef.eo b/src/tests/eolian/data/typedef.eo
index 6c87ccdf31..15ebbf7cc4 100644
--- a/src/tests/eolian/data/typedef.eo
+++ b/src/tests/eolian/data/typedef.eo
@@ -20,7 +20,7 @@ enum Enum.Bar
20 last_item 20 last_item
21} 21}
22 22
23enum Elm.Object.Select_mode 23enum Elm.Object.Select_Mode
24{ 24{
25 default = 0, 25 default = 0,
26 always, 26 always,
diff --git a/src/tests/eolian/data/typedef_ref.c b/src/tests/eolian/data/typedef_ref.c
index c5c3339072..61d451ebfa 100644
--- a/src/tests/eolian/data/typedef_ref.c
+++ b/src/tests/eolian/data/typedef_ref.c
@@ -1,5 +1,5 @@
1#ifndef _TYPES_OUTPUT_C_ 1#ifndef _EOLIAN_TYPEDEF_H_
2#define _TYPES_OUTPUT_C_ 2#define _EOLIAN_TYPEDEF_H_
3 3
4#ifndef _TYPEDEF_EO_CLASS_TYPE 4#ifndef _TYPEDEF_EO_CLASS_TYPE
5#define _TYPEDEF_EO_CLASS_TYPE 5#define _TYPEDEF_EO_CLASS_TYPE
@@ -47,5 +47,4 @@ EWAPI const Efl_Class *typedef_class_get(void);
47 47
48EOAPI char *typedef_foo(Eo *obj, int idx); 48EOAPI char *typedef_foo(Eo *obj, int idx);
49 49
50
51#endif 50#endif
diff --git a/src/tests/eolian/data/typedef_ref_stub.c b/src/tests/eolian/data/typedef_ref_stub.c
index cb5d53f143..3e1361557f 100644
--- a/src/tests/eolian/data/typedef_ref_stub.c
+++ b/src/tests/eolian/data/typedef_ref_stub.c
@@ -1,5 +1,5 @@
1#ifndef _TYPES_OUTPUT_C_STUBS 1#ifndef _EOLIAN_TYPEDEF_STUB_H_STUBS
2#define _TYPES_OUTPUT_C_STUBS 2#define _EOLIAN_TYPEDEF_STUB_H_STUBS
3 3
4typedef Eo Typedef; 4typedef Eo Typedef;
5 5
diff --git a/src/tests/eolian/eolian_generation.c b/src/tests/eolian/eolian_generation.c
index c63c641775..a31bd40ee1 100644
--- a/src/tests/eolian/eolian_generation.c
+++ b/src/tests/eolian/eolian_generation.c
@@ -15,17 +15,20 @@
15#include "eolian_suite.h" 15#include "eolian_suite.h"
16 16
17static Eina_Bool 17static Eina_Bool
18_files_compare (const char *ref_filename, const char *tmp_filename) 18_files_compare (const char *ref_filename, const char *tmp_filename, const char *ext)
19{ 19{
20 Eina_Bool result = EINA_FALSE; 20 Eina_Bool result = EINA_FALSE;
21 21
22 FILE *tmp_file = NULL, *ref_file = NULL; 22 FILE *tmp_file = NULL, *ref_file = NULL;
23 char *tmp_content = NULL, *ref_content = NULL; 23 char *tmp_content = NULL, *ref_content = NULL;
24 24
25 tmp_file = fopen(tmp_filename, "rb"); 25 char ifnbuf[PATH_MAX];
26 snprintf(ifnbuf, sizeof(ifnbuf), "%s.%s", tmp_filename, ext);
27
28 tmp_file = fopen(ifnbuf, "rb");
26 if (!tmp_file) 29 if (!tmp_file)
27 { 30 {
28 printf("Unable to open %s\n", tmp_filename); 31 printf("Unable to open %s\n", ifnbuf);
29 goto end; 32 goto end;
30 } 33 }
31 ref_file = fopen(ref_filename, "rb"); 34 ref_file = fopen(ref_filename, "rb");
@@ -69,6 +72,14 @@ end:
69 return result; 72 return result;
70} 73}
71 74
75static void
76_remove_ref(const char *base, const char *ext)
77{
78 char ifnbuf[PATH_MAX];
79 snprintf(ifnbuf, sizeof(ifnbuf), "%s.%s", base, ext);
80 remove(ifnbuf);
81}
82
72static int 83static int
73_eolian_gen_execute(const char *eo_filename, const char *options, const char *output_filename) 84_eolian_gen_execute(const char *eo_filename, const char *options, const char *output_filename)
74{ 85{
@@ -78,14 +89,14 @@ _eolian_gen_execute(const char *eo_filename, const char *options, const char *ou
78 if (getenv("EFL_RUN_IN_TREE")) 89 if (getenv("EFL_RUN_IN_TREE"))
79 { 90 {
80 snprintf(eolian_gen_path, sizeof(eolian_gen_path), 91 snprintf(eolian_gen_path, sizeof(eolian_gen_path),
81 "%s/src/bin/eolian/eolian_gen%s", 92 "%s/src/bin/eolian2/eolian_gen2%s",
82 PACKAGE_BUILD_DIR, EXEEXT); 93 PACKAGE_BUILD_DIR, EXEEXT);
83 } 94 }
84 if (eolian_gen_path[0] == '\0') 95 if (eolian_gen_path[0] == '\0')
85 return -1; 96 return -1;
86 97
87 snprintf(command, PATH_MAX, 98 snprintf(command, PATH_MAX,
88 "%s %s -I "PACKAGE_DATA_DIR"/data -o %s %s", 99 "%s %s -I \""PACKAGE_DATA_DIR"/data\" -o %s %s",
89 eolian_gen_path, options, output_filename, eo_filename); 100 eolian_gen_path, options, output_filename, eo_filename);
90 return system(command); 101 return system(command);
91} 102}
@@ -93,96 +104,96 @@ _eolian_gen_execute(const char *eo_filename, const char *options, const char *ou
93START_TEST(eolian_dev_impl_code) 104START_TEST(eolian_dev_impl_code)
94{ 105{
95 char output_filepath[PATH_MAX] = ""; 106 char output_filepath[PATH_MAX] = "";
96 snprintf(output_filepath, PATH_MAX, "%s/object_impl.c", 107 snprintf(output_filepath, PATH_MAX, "%s/eolian_object_impl",
97 eina_environment_tmp_get()); 108 eina_environment_tmp_get());
98 remove(output_filepath); 109 _remove_ref(output_filepath, "c");
99 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "--gi", output_filepath)); 110 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "-gi", output_filepath));
100 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath)); 111 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath, "c"));
101 /* Check that nothing is added */ 112 /* Check that nothing is added */
102 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "--gi", output_filepath)); 113 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "-gi", output_filepath));
103 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath)); 114 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath, "c"));
104 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl_add.eo", "--gi", output_filepath)); 115 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl_add.eo", "-gi", output_filepath));
105 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_add_ref.c", output_filepath)); 116 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_add_ref.c", output_filepath, "c"));
106} 117}
107END_TEST 118END_TEST
108 119
109START_TEST(eolian_types_generation) 120START_TEST(eolian_types_generation)
110{ 121{
111 char output_filepath[PATH_MAX] = ""; 122 char output_filepath[PATH_MAX] = "";
112 snprintf(output_filepath, PATH_MAX, "%s/types_output.c", 123 snprintf(output_filepath, PATH_MAX, "%s/eolian_typedef",
113 eina_environment_tmp_get()); 124 eina_environment_tmp_get());
114 remove(output_filepath); 125 _remove_ref(output_filepath, "h");
115 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "--gh", output_filepath)); 126 _remove_ref(output_filepath, "stub.h");
116 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.c", output_filepath)); 127 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "-gh", output_filepath));
117 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gh", output_filepath)); 128 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.c", output_filepath, "h"));
118 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref.c", output_filepath)); 129 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "-gh", output_filepath));
119 130 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref.c", output_filepath, "h"));
120 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "--gs", output_filepath)); 131
121 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref_stub.c", output_filepath)); 132 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "-gs", output_filepath));
122 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "--gs", output_filepath)); 133 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref_stub.c", output_filepath, "stub.h"));
123 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref_stub.c", output_filepath)); 134 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/struct.eo", "-gs", output_filepath));
135 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref_stub.c", output_filepath, "stub.h"));
124} 136}
125END_TEST 137END_TEST
126 138
127START_TEST(eolian_default_values_generation) 139START_TEST(eolian_default_values_generation)
128{ 140{
129 char output_filepath[PATH_MAX] = ""; 141 char output_filepath[PATH_MAX] = "";
130 snprintf(output_filepath, PATH_MAX, "%s/eolian_output.c", 142 snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
131 eina_environment_tmp_get()); 143 eina_environment_tmp_get());
132 remove(output_filepath); 144 _remove_ref(output_filepath, "c");
133 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "--gc", output_filepath)); 145 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "-gc", output_filepath));
134 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref.c", output_filepath)); 146 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref.c", output_filepath, "c"));
135} 147}
136END_TEST 148END_TEST
137 149
138START_TEST(eolian_override_generation) 150START_TEST(eolian_override_generation)
139{ 151{
140 char output_filepath[PATH_MAX] = ""; 152 char output_filepath[PATH_MAX] = "";
141 snprintf(output_filepath, PATH_MAX, "%s/eolian_output.c", 153 snprintf(output_filepath, PATH_MAX, "%s/eolian_override",
142 eina_environment_tmp_get()); 154 eina_environment_tmp_get());
143 remove(output_filepath); 155 _remove_ref(output_filepath, "c");
144 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/override.eo", "--gc", output_filepath)); 156 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/override.eo", "-gc", output_filepath));
145 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/override_ref.c", output_filepath)); 157 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/override_ref.c", output_filepath, "c"));
146} 158}
147END_TEST 159END_TEST
148 160
149START_TEST(eolian_functions_descriptions) 161START_TEST(eolian_functions_descriptions)
150{ 162{
151 char output_filepath[PATH_MAX] = ""; 163 char output_filepath[PATH_MAX] = "";
152 snprintf(output_filepath, PATH_MAX, "%s/eolian_output.h", 164 snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
153 eina_environment_tmp_get()); 165 eina_environment_tmp_get());
154 remove(output_filepath); 166 _remove_ref(output_filepath, "h");
155 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "--gh", output_filepath)); 167 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "-gh", output_filepath));
156 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_eo.h", output_filepath)); 168 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_eo.h", output_filepath, "h"));
157 remove(output_filepath); 169 _remove_ref(output_filepath, "legacy.h");
158 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "--legacy --gh", output_filepath)); 170 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "-gl", output_filepath));
159 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_legacy.h", output_filepath)); 171 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_legacy.h", output_filepath, "legacy.h"));
160} 172}
161END_TEST 173END_TEST
162 174
163START_TEST(eolian_import) 175START_TEST(eolian_import)
164{ 176{
165 char output_filepath[PATH_MAX] = ""; 177 char output_filepath[PATH_MAX] = "";
166 snprintf(output_filepath, PATH_MAX, "%s/eolian_import_types.h", 178 snprintf(output_filepath, PATH_MAX, "%s/eolian_import_types",
167 eina_environment_tmp_get()); 179 eina_environment_tmp_get());
168 remove(output_filepath); 180 _remove_ref(output_filepath, "h");
169 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/import_types.eot", "--gh", output_filepath)); 181 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/import_types.eot", "-gh", output_filepath));
170 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/import_types_ref.h", output_filepath)); 182 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/import_types_ref.h", output_filepath, "h"));
171 remove(output_filepath);
172} 183}
173END_TEST 184END_TEST
174 185
175START_TEST(eolian_docs) 186START_TEST(eolian_docs)
176{ 187{
177 char output_filepath[PATH_MAX] = ""; 188 char output_filepath[PATH_MAX] = "";
178 snprintf(output_filepath, PATH_MAX, "%s/eolian_output.h", 189 snprintf(output_filepath, PATH_MAX, "%s/eolian_docs",
179 eina_environment_tmp_get()); 190 eina_environment_tmp_get());
180 remove(output_filepath); 191 _remove_ref(output_filepath, "h");
181 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "--gh", output_filepath)); 192 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "-gh", output_filepath));
182 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref.h", output_filepath)); 193 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref.h", output_filepath, "h"));
183 remove(output_filepath); 194 _remove_ref(output_filepath, "legacy.h");
184 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "--legacy --gh", output_filepath)); 195 fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "-gl", output_filepath));
185 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref_legacy.h", output_filepath)); 196 fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref_legacy.h", output_filepath, "legacy.h"));
186} 197}
187END_TEST 198END_TEST
188 199