summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile_Eolian.am4
-rw-r--r--src/tests/eolian/data/import.eo8
-rw-r--r--src/tests/eolian/data/import_types.eot5
-rw-r--r--src/tests/eolian/eolian_parsing.c23
4 files changed, 39 insertions, 1 deletions
diff --git a/src/Makefile_Eolian.am b/src/Makefile_Eolian.am
index 0f3f4a3..1394b2e 100644
--- a/src/Makefile_Eolian.am
+++ b/src/Makefile_Eolian.am
@@ -93,7 +93,9 @@ tests/eolian/data/nmsp1_class1.eo \
93tests/eolian/data/nmsp1_nmsp11_class2.eo \ 93tests/eolian/data/nmsp1_nmsp11_class2.eo \
94tests/eolian/data/nmsp2_class1.eo \ 94tests/eolian/data/nmsp2_class1.eo \
95tests/eolian/data/null.eo \ 95tests/eolian/data/null.eo \
96tests/eolian/data/no_nmsp.eo 96tests/eolian/data/no_nmsp.eo \
97tests/eolian/data/import.eo \
98tests/eolian/data/import_types.eot
97 99
98EOLIAN_TESTS_EOS_GENERATED = \ 100EOLIAN_TESTS_EOS_GENERATED = \
99$(EOLIAN_TESTS_EOS:%.eo=%.eo.c)\ 101$(EOLIAN_TESTS_EOS:%.eo=%.eo.c)\
diff --git a/src/tests/eolian/data/import.eo b/src/tests/eolian/data/import.eo
new file mode 100644
index 0000000..8948424
--- /dev/null
+++ b/src/tests/eolian/data/import.eo
@@ -0,0 +1,8 @@
1import import_types;
2
3class Import {
4 methods {
5 foo {
6 }
7 }
8} \ No newline at end of file
diff --git a/src/tests/eolian/data/import_types.eot b/src/tests/eolian/data/import_types.eot
new file mode 100644
index 0000000..bb81745
--- /dev/null
+++ b/src/tests/eolian/data/import_types.eot
@@ -0,0 +1,5 @@
1type Imported: int;
2
3struct Imported_Struct {
4 foo: float;
5} \ No newline at end of file
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index 41c4152..c4745cc 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1046,6 +1046,28 @@ START_TEST(eolian_null)
1046} 1046}
1047END_TEST 1047END_TEST
1048 1048
1049START_TEST(eolian_import)
1050{
1051 const Eolian_Class *class;
1052 const Eolian_Type *type;
1053
1054 eolian_init();
1055
1056 fail_if(!eolian_directory_scan(PACKAGE_DATA_DIR"/data"));
1057
1058 fail_if(!eolian_eo_file_parse(PACKAGE_DATA_DIR"/data/import.eo"));
1059 fail_if(!(class = eolian_class_get_by_name("Import")));
1060
1061 fail_if(!(type = eolian_type_alias_get_by_name("Imported")));
1062 fail_if(strcmp(eolian_type_file_get(type), "import_types.eot"));
1063
1064 fail_if(!(type = eolian_type_struct_get_by_name("Imported_Struct")));
1065 fail_if(strcmp(eolian_type_file_get(type), "import_types.eot"));
1066
1067 eolian_shutdown();
1068}
1069END_TEST
1070
1049void eolian_parsing_test(TCase *tc) 1071void eolian_parsing_test(TCase *tc)
1050{ 1072{
1051 tcase_add_test(tc, eolian_simple_parsing); 1073 tcase_add_test(tc, eolian_simple_parsing);
@@ -1064,5 +1086,6 @@ void eolian_parsing_test(TCase *tc)
1064 tcase_add_test(tc, eolian_class_funcs); 1086 tcase_add_test(tc, eolian_class_funcs);
1065 tcase_add_test(tc, eolian_free_func); 1087 tcase_add_test(tc, eolian_free_func);
1066 tcase_add_test(tc, eolian_null); 1088 tcase_add_test(tc, eolian_null);
1089 tcase_add_test(tc, eolian_import);
1067} 1090}
1068 1091