eolian: fix generation tests

This commit is contained in:
Daniel Kolesa 2017-11-10 19:42:43 +01:00
parent ef3d2120bf
commit f19a905261
12 changed files with 50 additions and 50 deletions

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_CLASS_SIMPLE_H_
#define _EOLIAN_CLASS_SIMPLE_H_
#ifndef _EOLIAN_CLASS_SIMPLE_EO_H_
#define _EOLIAN_CLASS_SIMPLE_EO_H_
#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE
#define _CLASS_SIMPLE_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_CLASS_SIMPLE_LEGACY_H_
#define _EOLIAN_CLASS_SIMPLE_LEGACY_H_
#ifndef _EOLIAN_CLASS_SIMPLE_EO_LEGACY_H_
#define _EOLIAN_CLASS_SIMPLE_EO_LEGACY_H_
#ifndef _CLASS_SIMPLE_EO_CLASS_TYPE
#define _CLASS_SIMPLE_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_DOCS_H_
#define _EOLIAN_DOCS_H_
#ifndef _EOLIAN_DOCS_EO_H_
#define _EOLIAN_DOCS_EO_H_
#ifndef _DOCS_EO_CLASS_TYPE
#define _DOCS_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_DOCS_LEGACY_H_
#define _EOLIAN_DOCS_LEGACY_H_
#ifndef _EOLIAN_DOCS_EO_LEGACY_H_
#define _EOLIAN_DOCS_EO_LEGACY_H_
#ifndef _DOCS_EO_CLASS_TYPE
#define _DOCS_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_FUNCTION_POINTERS_H_
#define _EOLIAN_FUNCTION_POINTERS_H_
#ifndef _EOLIAN_FUNCTION_POINTERS_EO_H_
#define _EOLIAN_FUNCTION_POINTERS_EO_H_
#ifndef _FUNCTION_AS_ARGUMENT_EO_CLASS_TYPE
#define _FUNCTION_AS_ARGUMENT_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_FUNCTION_POINTERS_H_
#define _EOLIAN_FUNCTION_POINTERS_H_
#ifndef _EOLIAN_FUNCTION_POINTERS_EOT_H_
#define _EOLIAN_FUNCTION_POINTERS_EOT_H_
#ifndef _FUNCTION_TYPES_EOT_TYPES
#define _FUNCTION_TYPES_EOT_TYPES

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_IMPORT_TYPES_H_
#define _EOLIAN_IMPORT_TYPES_H_
#ifndef _EOLIAN_IMPORT_TYPES_EOT_H_
#define _EOLIAN_IMPORT_TYPES_EOT_H_
#ifndef _IMPORT_TYPES_EOT_TYPES
#define _IMPORT_TYPES_EOT_TYPES

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_TYPEDEF_H_
#define _EOLIAN_TYPEDEF_H_
#ifndef _EOLIAN_TYPEDEF_EO_H_
#define _EOLIAN_TYPEDEF_EO_H_
#ifndef _STRUCT_EO_CLASS_TYPE
#define _STRUCT_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_TYPEDEF_STUB_H_STUBS
#define _EOLIAN_TYPEDEF_STUB_H_STUBS
#ifndef _EOLIAN_TYPEDEF_EO_STUB_H_STUBS
#define _EOLIAN_TYPEDEF_EO_STUB_H_STUBS
typedef Eo Struct;

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_TYPEDEF_H_
#define _EOLIAN_TYPEDEF_H_
#ifndef _EOLIAN_TYPEDEF_EO_H_
#define _EOLIAN_TYPEDEF_EO_H_
#ifndef _TYPEDEF_EO_CLASS_TYPE
#define _TYPEDEF_EO_CLASS_TYPE

View File

@ -1,5 +1,5 @@
#ifndef _EOLIAN_TYPEDEF_STUB_H_STUBS
#define _EOLIAN_TYPEDEF_STUB_H_STUBS
#ifndef _EOLIAN_TYPEDEF_EO_STUB_H_STUBS
#define _EOLIAN_TYPEDEF_EO_STUB_H_STUBS
typedef Eo Typedef;

View File

@ -111,17 +111,17 @@ START_TEST(eolian_types_generation)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_typedef",
eina_environment_tmp_get());
_remove_ref(output_filepath, "h");
_remove_ref(output_filepath, "stub.h");
_remove_ref(output_filepath, "eo.h");
_remove_ref(output_filepath, "eo.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(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref.h", output_filepath, "eo.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(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref.h", output_filepath, "eo.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(!_files_compare(PACKAGE_DATA_DIR"/data/typedef_ref_stub.h", output_filepath, "eo.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"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/struct_ref_stub.h", output_filepath, "eo.stub.h"));
}
END_TEST
@ -130,9 +130,9 @@ START_TEST(eolian_default_values_generation)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
eina_environment_tmp_get());
_remove_ref(output_filepath, "c");
_remove_ref(output_filepath, "eo.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"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref.c", output_filepath, "eo.c"));
}
END_TEST
@ -141,9 +141,9 @@ START_TEST(eolian_override_generation)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_override",
eina_environment_tmp_get());
_remove_ref(output_filepath, "c");
_remove_ref(output_filepath, "eo.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"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/override_ref.c", output_filepath, "eo.c"));
}
END_TEST
@ -152,12 +152,12 @@ START_TEST(eolian_functions_descriptions)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_class_simple",
eina_environment_tmp_get());
_remove_ref(output_filepath, "h");
_remove_ref(output_filepath, "eo.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(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_eo.h", output_filepath, "eo.h"));
_remove_ref(output_filepath, "eo.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"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/class_simple_ref_legacy.h", output_filepath, "eo.legacy.h"));
}
END_TEST
@ -166,9 +166,9 @@ START_TEST(eolian_import)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_import_types",
eina_environment_tmp_get());
_remove_ref(output_filepath, "h");
_remove_ref(output_filepath, "eot.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"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/import_types_ref.h", output_filepath, "eot.h"));
}
END_TEST
@ -177,12 +177,12 @@ START_TEST(eolian_docs)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_docs",
eina_environment_tmp_get());
_remove_ref(output_filepath, "h");
_remove_ref(output_filepath, "eo.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(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref.h", output_filepath, "eo.h"));
_remove_ref(output_filepath, "eo.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"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/docs_ref_legacy.h", output_filepath, "eo.legacy.h"));
}
END_TEST
@ -193,19 +193,19 @@ START_TEST(eolian_function_pointers)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_function_pointers",
eina_environment_tmp_get());
_remove_ref(output_filepath, "h");
_remove_ref(output_filepath, "eot.h");
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/function_types.eot", "-gh", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/function_types_ref.h", output_filepath, "h"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/function_types_ref.h", output_filepath, "eot.h"));
// .eo.h
_remove_ref(output_filepath, "h");
_remove_ref(output_filepath, "eo.h");
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/function_as_argument.eo", "-gh", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/function_as_argument_ref.h", output_filepath, "h"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/function_as_argument_ref.h", output_filepath, "eo.h"));
// .eo.c
_remove_ref(output_filepath, "c");
_remove_ref(output_filepath, "eo.c");
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/function_as_argument.eo", "-gc", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/function_as_argument_ref.c", output_filepath, "c"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/function_as_argument_ref.c", output_filepath, "eo.c"));
// .eo.imp.c
_remove_ref(output_filepath, "c");
@ -222,9 +222,9 @@ START_TEST(owning)
char output_filepath[PATH_MAX] = "";
snprintf(output_filepath, PATH_MAX, "%s/eolian_owning",
eina_environment_tmp_get());
_remove_ref(output_filepath, "c");
_remove_ref(output_filepath, "eo.c");
fail_if(0 != _eolian_gen_execute(PACKAGE_DATA_DIR"/data/owning.eo", "-gc", output_filepath));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/owning.eo.c", output_filepath, "c"));
fail_if(!_files_compare(PACKAGE_DATA_DIR"/data/owning.eo.c", output_filepath, "eo.c"));
}
END_TEST