EOAPI EFL_VOID_FUNC_BODY(efl_canvas_object_simple_b_set);
-char * _class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d);
+char *_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d);
-static char * __eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d)
+static char *__eolian_class_simple_foo(Eo *obj, Evas_Simple_Data *pd, int a, char *b, double *c, int *d)
{
if (c) *c = 1337.600000;
return _class_simple_foo(obj, pd, a, b, c, d);
EOAPI 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);
-int * _class_simple_bar(Eo *obj, Evas_Simple_Data *pd, int x);
+int *_class_simple_bar(Eo *obj, Evas_Simple_Data *pd, int x);
EOAPI EFL_FUNC_BODYV(efl_canvas_object_simple_bar, int *, 0, EFL_FUNC_CALL(x), int x);
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_set, _class_simple_a_set),
EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_a_get, _class_simple_a_get),
- EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo)
+ EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_b_set, _class_simple_b_set),
+ EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_foo, __eolian_class_simple_foo),
+ EFL_OBJECT_OP_FUNC(efl_canvas_object_simple_bar, _class_simple_bar)
);
-
return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description _class_simple_class_desc = {
- EO_VERSION,
- "Class_Simple",
- EFL_CLASS_TYPE_REGULAR,
- sizeof(Evas_Simple_Data),
- _class_simple_class_initializer,
- NULL,
- NULL
+ EO_VERSION,
+ "Class_Simple",
+ EFL_CLASS_TYPE_REGULAR,
+ sizeof(Evas_Simple_Data),
+ _class_simple_class_initializer,
+ NULL,
+ NULL
};
EFL_DEFINE_CLASS(class_simple_class_get, &_class_simple_class_desc, NULL, NULL);
+
+EAPI void
+evas_object_simple_b_set(Class_Simple *obj)
+{
+ efl_canvas_object_simple_b_set(obj);
+}
+
+EAPI int *
+evas_object_simple_bar(Class_Simple *obj, int x)
+{
+ return efl_canvas_object_simple_bar(obj, x);
+}
+void _override_base_constructor(Eo *obj, Override_Data *pd);
+
+
static void __eolian_override_b_set(Eo *obj EINA_UNUSED, Override_Data *pd, int idx EINA_UNUSED, float a, char b, int c)
{
a = pd->a;
}
EOAPI EFL_FUNC_BODYV_CONST(override_c_get, int, 50, EFL_FUNC_CALL(idx), int idx);
+
+static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
+{
+ if (a) *a = pd->a;
+ if (b) *b = pd->b;
+ if (c) *c = pd->c;
+}
+
+
+static 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)
+{
+}
+
EOAPI EFL_VOID_FUNC_BODY(override_a_set);
void _override_a_get(Eo *obj, Override_Data *pd);
EOAPI EFL_VOID_FUNC_BODYV(override_c_set, EFL_FUNC_CALL(idx, c), int idx, int c);
EOAPI EFL_VOID_FUNC_BODY(override_foo);
-void _override_base_constructor(Eo *obj, Override_Data *pd);
-
-
-static void __eolian_override_base_z_get(Eo *obj EINA_UNUSED, Override_Data *pd, int *a, char *b, float *c)
-{
- if (a) *a = pd->a;
- if (b) *b = pd->b;
- if (c) *c = pd->c;
-}
-
-
-static 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)
-{
-}
-
-
static Eina_Bool
_override_class_initializer(Efl_Class *klass)
{
EFL_OPS_DEFINE(ops,
EFL_OBJECT_OP_FUNC(base_constructor, _override_base_constructor),
- EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
- EFL_OBJECT_OP_FUNC(base_z_set, __eolian_override_base_z_set),
EFL_OBJECT_OP_FUNC(override_b_set, __eolian_override_b_set),
EFL_OBJECT_OP_FUNC(override_bar, __eolian_override_bar),
EFL_OBJECT_OP_FUNC(override_c_get, __eolian_override_c_get),
+ EFL_OBJECT_OP_FUNC(base_z_get, __eolian_override_base_z_get),
+ EFL_OBJECT_OP_FUNC(base_z_set, __eolian_override_base_z_set),
EFL_OBJECT_OP_FUNC(override_a_set, NULL),
EFL_OBJECT_OP_FUNC(override_a_get, _override_a_get),
EFL_OBJECT_OP_FUNC(override_b_get, _override_b_get),
EFL_OBJECT_OP_FUNC(override_c_set, _override_c_set),
EFL_OBJECT_OP_FUNC(override_foo, NULL)
);
-
return efl_class_functions_set(klass, &ops, NULL);
}
static const Efl_Class_Description _override_class_desc = {
- EO_VERSION,
- "Override",
- EFL_CLASS_TYPE_REGULAR,
- sizeof(Override_Data),
- _override_class_initializer,
- NULL,
- NULL
+ EO_VERSION,
+ "Override",
+ EFL_CLASS_TYPE_REGULAR,
+ sizeof(Override_Data),
+ _override_class_initializer,
+ NULL,
+ NULL
};
EFL_DEFINE_CLASS(override_class_get, &_override_class_desc, BASE_CLASS, NULL);
#include "eolian_suite.h"
static Eina_Bool
-_files_compare (const char *ref_filename, const char *tmp_filename)
+_files_compare (const char *ref_filename, const char *tmp_filename, const char *ext)
{
Eina_Bool result = EINA_FALSE;
FILE *tmp_file = NULL, *ref_file = NULL;
char *tmp_content = NULL, *ref_content = NULL;
- tmp_file = fopen(tmp_filename, "rb");
+ char ifnbuf[PATH_MAX];
+ snprintf(ifnbuf, sizeof(ifnbuf), "%s.%s", tmp_filename, ext);
+
+ tmp_file = fopen(ifnbuf, "rb");
if (!tmp_file)
{
- printf("Unable to open %s\n", tmp_filename);
+ printf("Unable to open %s\n", ifnbuf);
goto end;
}
ref_file = fopen(ref_filename, "rb");
return result;
}
+static void
+_remove_ref(const char *base, const char *ext)
+{
+ char ifnbuf[PATH_MAX];
+ snprintf(ifnbuf, sizeof(ifnbuf), "%s.%s", base, ext);
+ remove(ifnbuf);
+}
+
static int
_eolian_gen_execute(const char *eo_filename, const char *options, const char *output_filename)
{
if (getenv("EFL_RUN_IN_TREE"))
{
snprintf(eolian_gen_path, sizeof(eolian_gen_path),
- "%s/src/bin/eolian/eolian_gen%s",
+ "%s/src/bin/eolian2/eolian_gen2%s",
PACKAGE_BUILD_DIR, EXEEXT);
}
if (eolian_gen_path[0] == '\0')
return -1;
snprintf(command, PATH_MAX,
- "%s %s -I "PACKAGE_DATA_DIR"/data -o %s %s",
+ "%s %s -I \""PACKAGE_DATA_DIR"/data\" -o %s %s",
eolian_gen_path, options, output_filename, eo_filename);
return system(command);
}
START_TEST(eolian_dev_impl_code)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/object_impl.c",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_object_impl",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "--gi", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath));
+ _remove_ref(output_filepath, "c");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "-gi", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath, "c"));
/* Check that nothing is added */
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "--gi", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath));
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl_add.eo", "--gi", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_add_ref.c", output_filepath));
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl.eo", "-gi", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_ref.c", output_filepath, "c"));
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/object_impl_add.eo", "-gi", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/object_impl_add_ref.c", output_filepath, "c"));
}
END_TEST
START_TEST(eolian_types_generation)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/types_output.c",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_typedef",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "--gh", output_filepath));
- 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));
+ _remove_ref(output_filepath, "h");
+ _remove_ref(output_filepath, "stub.h");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/typedef.eo", "-gh", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.c", output_filepath, "h"));
+ 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, "h"));
+
+ 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, "stub.h"));
+ 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, "stub.h"));
}
END_TEST
START_TEST(eolian_default_values_generation)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/eolian_output.c",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "--gc", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref.c", output_filepath));
+ _remove_ref(output_filepath, "c");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "-gc", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref.c", output_filepath, "c"));
}
END_TEST
START_TEST(eolian_override_generation)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/eolian_output.c",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_override",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/override.eo", "--gc", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/override_ref.c", output_filepath));
+ _remove_ref(output_filepath, "c");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/override.eo", "-gc", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/override_ref.c", output_filepath, "c"));
}
END_TEST
START_TEST(eolian_functions_descriptions)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/eolian_output.h",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "--gh", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_eo.h", output_filepath));
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "--legacy --gh", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_legacy.h", output_filepath));
+ _remove_ref(output_filepath, "h");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "-gh", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_eo.h", output_filepath, "h"));
+ _remove_ref(output_filepath, "legacy.h");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/class_simple.eo", "-gl", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_legacy.h", output_filepath, "legacy.h"));
}
END_TEST
START_TEST(eolian_import)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/eolian_import_types.h",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_import_types",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/import_types.eot", "--gh", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/import_types_ref.h", output_filepath));
- remove(output_filepath);
+ _remove_ref(output_filepath, "h");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/import_types.eot", "-gh", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/import_types_ref.h", output_filepath, "h"));
}
END_TEST
START_TEST(eolian_docs)
{
char output_filepath[PATH_MAX] = "";
- snprintf(output_filepath, PATH_MAX, "%s/eolian_output.h",
+ snprintf(output_filepath, PATH_MAX, "%s/eolian_docs",
eina_environment_tmp_get());
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "--gh", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref.h", output_filepath));
- remove(output_filepath);
- fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "--legacy --gh", output_filepath));
- fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref_legacy.h", output_filepath));
+ _remove_ref(output_filepath, "h");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "-gh", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref.h", output_filepath, "h"));
+ _remove_ref(output_filepath, "legacy.h");
+ fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/docs.eo", "-gl", output_filepath));
+ fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref_legacy.h", output_filepath, "legacy.h"));
}
END_TEST