forked from enlightenment/efl
eolian: tests for import
This commit is contained in:
parent
72dcd2da03
commit
b647448f84
|
@ -93,7 +93,9 @@ tests/eolian/data/nmsp1_class1.eo \
|
||||||
tests/eolian/data/nmsp1_nmsp11_class2.eo \
|
tests/eolian/data/nmsp1_nmsp11_class2.eo \
|
||||||
tests/eolian/data/nmsp2_class1.eo \
|
tests/eolian/data/nmsp2_class1.eo \
|
||||||
tests/eolian/data/null.eo \
|
tests/eolian/data/null.eo \
|
||||||
tests/eolian/data/no_nmsp.eo
|
tests/eolian/data/no_nmsp.eo \
|
||||||
|
tests/eolian/data/import.eo \
|
||||||
|
tests/eolian/data/import_types.eot
|
||||||
|
|
||||||
EOLIAN_TESTS_EOS_GENERATED = \
|
EOLIAN_TESTS_EOS_GENERATED = \
|
||||||
$(EOLIAN_TESTS_EOS:%.eo=%.eo.c)\
|
$(EOLIAN_TESTS_EOS:%.eo=%.eo.c)\
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import import_types;
|
||||||
|
|
||||||
|
class Import {
|
||||||
|
methods {
|
||||||
|
foo {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
type Imported: int;
|
||||||
|
|
||||||
|
struct Imported_Struct {
|
||||||
|
foo: float;
|
||||||
|
}
|
|
@ -1046,6 +1046,28 @@ START_TEST(eolian_null)
|
||||||
}
|
}
|
||||||
END_TEST
|
END_TEST
|
||||||
|
|
||||||
|
START_TEST(eolian_import)
|
||||||
|
{
|
||||||
|
const Eolian_Class *class;
|
||||||
|
const Eolian_Type *type;
|
||||||
|
|
||||||
|
eolian_init();
|
||||||
|
|
||||||
|
fail_if(!eolian_directory_scan(PACKAGE_DATA_DIR"/data"));
|
||||||
|
|
||||||
|
fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/import.eo"));
|
||||||
|
fail_if(!(class = eolian_class_get_by_name("Import")));
|
||||||
|
|
||||||
|
fail_if(!(type = eolian_type_alias_get_by_name("Imported")));
|
||||||
|
fail_if(strcmp(eolian_type_file_get(type), "import_types.eot"));
|
||||||
|
|
||||||
|
fail_if(!(type = eolian_type_struct_get_by_name("Imported_Struct")));
|
||||||
|
fail_if(strcmp(eolian_type_file_get(type), "import_types.eot"));
|
||||||
|
|
||||||
|
eolian_shutdown();
|
||||||
|
}
|
||||||
|
END_TEST
|
||||||
|
|
||||||
void eolian_parsing_test(TCase *tc)
|
void eolian_parsing_test(TCase *tc)
|
||||||
{
|
{
|
||||||
tcase_add_test(tc, eolian_simple_parsing);
|
tcase_add_test(tc, eolian_simple_parsing);
|
||||||
|
@ -1064,5 +1086,6 @@ void eolian_parsing_test(TCase *tc)
|
||||||
tcase_add_test(tc, eolian_class_funcs);
|
tcase_add_test(tc, eolian_class_funcs);
|
||||||
tcase_add_test(tc, eolian_free_func);
|
tcase_add_test(tc, eolian_free_func);
|
||||||
tcase_add_test(tc, eolian_null);
|
tcase_add_test(tc, eolian_null);
|
||||||
|
tcase_add_test(tc, eolian_import);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue