summaryrefslogtreecommitdiff
path: root/src/tests/eolian/eolian_parsing.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-12-21 20:31:39 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-12-21 22:24:47 +0100
commit87a93b852134d8b348d5c3615471e8713748966a (patch)
treeb5c71b682e8b16721d0c755614952a0a813d4661 /src/tests/eolian/eolian_parsing.c
parent6b70cd5f971579f09a153e513bde7f4b823785d8 (diff)
eolian: unify test directories
Diffstat (limited to '')
-rw-r--r--src/tests/eolian/eolian_parsing.c88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index f1b443049d..8227a568f9 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -25,8 +25,8 @@ START_TEST(eolian_namespaces)
25 eolian_init(); 25 eolian_init();
26 Eolian *eos = eolian_new(); 26 Eolian *eos = eolian_new();
27 /* Parsing */ 27 /* Parsing */
28 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 28 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
29 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/nmsp1_class1.eo"))); 29 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/nmsp1_class1.eo")));
30 30
31 /* Classes existence */ 31 /* Classes existence */
32 fail_if(!(class11 = eolian_class_get_by_name(unit, "nmsp1.class1"))); 32 fail_if(!(class11 = eolian_class_get_by_name(unit, "nmsp1.class1")));
@@ -108,8 +108,8 @@ START_TEST(eolian_events)
108 eolian_init(); 108 eolian_init();
109 Eolian *eos = eolian_new(); 109 Eolian *eos = eolian_new();
110 /* Parsing */ 110 /* Parsing */
111 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 111 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
112 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/events.eo"))); 112 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/events.eo")));
113 113
114 /* Class */ 114 /* Class */
115 fail_if(!(class = eolian_class_get_by_name(unit, "Events"))); 115 fail_if(!(class = eolian_class_get_by_name(unit, "Events")));
@@ -183,8 +183,8 @@ START_TEST(eolian_override)
183 eolian_init(); 183 eolian_init();
184 Eolian *eos = eolian_new(); 184 Eolian *eos = eolian_new();
185 /* Parsing */ 185 /* Parsing */
186 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 186 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
187 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/override.eo"))); 187 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/override.eo")));
188 188
189 /* Class */ 189 /* Class */
190 fail_if(!(class = eolian_class_get_by_name(unit, "Override"))); 190 fail_if(!(class = eolian_class_get_by_name(unit, "Override")));
@@ -240,8 +240,8 @@ START_TEST(eolian_consts)
240 eolian_init(); 240 eolian_init();
241 Eolian *eos = eolian_new(); 241 Eolian *eos = eolian_new();
242 /* Parsing */ 242 /* Parsing */
243 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 243 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
244 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/consts.eo"))); 244 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/consts.eo")));
245 fail_if(!(class = eolian_class_get_by_name(unit, "Consts"))); 245 fail_if(!(class = eolian_class_get_by_name(unit, "Consts")));
246 246
247 /* Method */ 247 /* Method */
@@ -267,8 +267,8 @@ START_TEST(eolian_ctor_dtor)
267 eolian_init(); 267 eolian_init();
268 Eolian *eos = eolian_new(); 268 Eolian *eos = eolian_new();
269 /* Parsing */ 269 /* Parsing */
270 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 270 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
271 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/ctor_dtor.eo"))); 271 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/ctor_dtor.eo")));
272 fail_if(!(class = eolian_class_get_by_name(unit, "Ctor_Dtor"))); 272 fail_if(!(class = eolian_class_get_by_name(unit, "Ctor_Dtor")));
273 fail_if(!(base = eolian_class_get_by_name(unit, "Base"))); 273 fail_if(!(base = eolian_class_get_by_name(unit, "Base")));
274 274
@@ -336,8 +336,8 @@ START_TEST(eolian_typedef)
336 eolian_init(); 336 eolian_init();
337 Eolian *eos = eolian_new(); 337 Eolian *eos = eolian_new();
338 /* Parsing */ 338 /* Parsing */
339 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 339 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
340 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/typedef.eo"))); 340 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/typedef.eo")));
341 341
342 /* Check that the class Dummy is still readable */ 342 /* Check that the class Dummy is still readable */
343 fail_if(!(class = eolian_class_get_by_name(unit, "Typedef"))); 343 fail_if(!(class = eolian_class_get_by_name(unit, "Typedef")));
@@ -421,8 +421,8 @@ START_TEST(eolian_complex_type)
421 eolian_init(); 421 eolian_init();
422 Eolian *eos = eolian_new(); 422 Eolian *eos = eolian_new();
423 /* Parsing */ 423 /* Parsing */
424 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 424 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
425 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/complex_type.eo"))); 425 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/complex_type.eo")));
426 fail_if(!(class = eolian_class_get_by_name(unit, "Complex_Type"))); 426 fail_if(!(class = eolian_class_get_by_name(unit, "Complex_Type")));
427 427
428 /* Properties return type */ 428 /* Properties return type */
@@ -505,8 +505,8 @@ START_TEST(eolian_scope)
505 eolian_init(); 505 eolian_init();
506 Eolian *eos = eolian_new(); 506 Eolian *eos = eolian_new();
507 /* Parsing */ 507 /* Parsing */
508 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 508 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
509 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/scope.eo"))); 509 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/scope.eo")));
510 fail_if(!(class = eolian_class_get_by_name(unit, "Scope"))); 510 fail_if(!(class = eolian_class_get_by_name(unit, "Scope")));
511 511
512 /* Property scope */ 512 /* Property scope */
@@ -548,8 +548,8 @@ START_TEST(eolian_simple_parsing)
548 eolian_init(); 548 eolian_init();
549 Eolian *eos = eolian_new(); 549 Eolian *eos = eolian_new();
550 /* Parsing */ 550 /* Parsing */
551 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 551 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
552 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/class_simple.eo"))); 552 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/class_simple.eo")));
553 fail_if(!(class = eolian_class_get_by_name(unit, "Class_Simple"))); 553 fail_if(!(class = eolian_class_get_by_name(unit, "Class_Simple")));
554 fail_if(eolian_class_get_by_file(unit, "class_simple.eo") != class); 554 fail_if(eolian_class_get_by_file(unit, "class_simple.eo") != class);
555 fail_if(strcmp(eolian_class_file_get(class), "class_simple.eo")); 555 fail_if(strcmp(eolian_class_file_get(class), "class_simple.eo"));
@@ -686,8 +686,8 @@ START_TEST(eolian_struct)
686 Eolian *eos = eolian_new(); 686 Eolian *eos = eolian_new();
687 687
688 /* Parsing */ 688 /* Parsing */
689 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 689 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
690 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/struct.eo"))); 690 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/struct.eo")));
691 691
692 /* Check that the class Dummy is still readable */ 692 /* Check that the class Dummy is still readable */
693 fail_if(!(class = eolian_class_get_by_name(unit, "Struct"))); 693 fail_if(!(class = eolian_class_get_by_name(unit, "Struct")));
@@ -754,8 +754,8 @@ START_TEST(eolian_extern)
754 Eolian *eos = eolian_new(); 754 Eolian *eos = eolian_new();
755 755
756 /* Parsing */ 756 /* Parsing */
757 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 757 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
758 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/extern.eo"))); 758 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/extern.eo")));
759 759
760 /* Check that the class Dummy is still readable */ 760 /* Check that the class Dummy is still readable */
761 fail_if(!(class = eolian_class_get_by_name(unit, "Extern"))); 761 fail_if(!(class = eolian_class_get_by_name(unit, "Extern")));
@@ -796,8 +796,8 @@ START_TEST(eolian_var)
796 Eolian *eos = eolian_new(); 796 Eolian *eos = eolian_new();
797 797
798 /* Parsing */ 798 /* Parsing */
799 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 799 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
800 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/var.eo"))); 800 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/var.eo")));
801 801
802 /* Check that the class Dummy is still readable */ 802 /* Check that the class Dummy is still readable */
803 fail_if(!(class = eolian_class_get_by_name(unit, "Var"))); 803 fail_if(!(class = eolian_class_get_by_name(unit, "Var")));
@@ -867,8 +867,8 @@ START_TEST(eolian_enum)
867 Eolian *eos = eolian_new(); 867 Eolian *eos = eolian_new();
868 868
869 /* Parsing */ 869 /* Parsing */
870 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 870 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
871 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/enum.eo"))); 871 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/enum.eo")));
872 872
873 /* Check that the class Dummy is still readable */ 873 /* Check that the class Dummy is still readable */
874 fail_if(!(class = eolian_class_get_by_name(unit, "Enum"))); 874 fail_if(!(class = eolian_class_get_by_name(unit, "Enum")));
@@ -963,8 +963,8 @@ START_TEST(eolian_class_funcs)
963 eolian_init(); 963 eolian_init();
964 Eolian *eos = eolian_new(); 964 Eolian *eos = eolian_new();
965 /* Parsing */ 965 /* Parsing */
966 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 966 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
967 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/class_funcs.eo"))); 967 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/class_funcs.eo")));
968 fail_if(!(class = eolian_class_get_by_name(unit, "Class_Funcs"))); 968 fail_if(!(class = eolian_class_get_by_name(unit, "Class_Funcs")));
969 969
970 /* Class properties */ 970 /* Class properties */
@@ -1004,8 +1004,8 @@ START_TEST(eolian_free_func)
1004 Eolian *eos = eolian_new(); 1004 Eolian *eos = eolian_new();
1005 1005
1006 /* Parsing */ 1006 /* Parsing */
1007 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1007 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1008 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/free_func.eo"))); 1008 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/free_func.eo")));
1009 1009
1010 /* Check that the class Dummy is still readable */ 1010 /* Check that the class Dummy is still readable */
1011 fail_if(!(class = eolian_class_get_by_name(unit, "Free_Func"))); 1011 fail_if(!(class = eolian_class_get_by_name(unit, "Free_Func")));
@@ -1054,8 +1054,8 @@ START_TEST(eolian_null)
1054 Eolian *eos = eolian_new(); 1054 Eolian *eos = eolian_new();
1055 1055
1056 /* Parsing */ 1056 /* Parsing */
1057 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1057 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1058 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/null.eo"))); 1058 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/null.eo")));
1059 1059
1060 fail_if(!(class = eolian_class_get_by_name(unit, "Null"))); 1060 fail_if(!(class = eolian_class_get_by_name(unit, "Null")));
1061 fail_if(!(func = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD))); 1061 fail_if(!(func = eolian_class_function_get_by_name(class, "foo", EOLIAN_METHOD)));
@@ -1103,9 +1103,9 @@ START_TEST(eolian_import)
1103 eolian_init(); 1103 eolian_init();
1104 Eolian *eos = eolian_new(); 1104 Eolian *eos = eolian_new();
1105 1105
1106 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1106 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1107 1107
1108 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/import.eo"))); 1108 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/import.eo")));
1109 fail_if(!(class = eolian_class_get_by_name(unit, "Import"))); 1109 fail_if(!(class = eolian_class_get_by_name(unit, "Import")));
1110 1110
1111 fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Imported"))); 1111 fail_if(!(tdl = eolian_typedecl_alias_get_by_name(unit, "Imported")));
@@ -1131,9 +1131,9 @@ START_TEST(eolian_decl)
1131 eolian_init(); 1131 eolian_init();
1132 Eolian *eos = eolian_new(); 1132 Eolian *eos = eolian_new();
1133 1133
1134 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1134 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1135 1135
1136 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/decl.eo"))); 1136 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/decl.eo")));
1137 fail_if(!(class = eolian_class_get_by_name(unit, "Decl"))); 1137 fail_if(!(class = eolian_class_get_by_name(unit, "Decl")));
1138 1138
1139 fail_if(!(itr = eolian_declarations_get_by_file(eos, "decl.eo"))); 1139 fail_if(!(itr = eolian_declarations_get_by_file(eos, "decl.eo")));
@@ -1200,9 +1200,9 @@ START_TEST(eolian_docs)
1200 eolian_init(); 1200 eolian_init();
1201 Eolian *eos = eolian_new(); 1201 Eolian *eos = eolian_new();
1202 1202
1203 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1203 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1204 1204
1205 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/docs.eo"))); 1205 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/docs.eo")));
1206 1206
1207 fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Foo"))); 1207 fail_if(!(tdl = eolian_typedecl_struct_get_by_name(unit, "Foo")));
1208 fail_if(!(doc = eolian_typedecl_documentation_get(tdl))); 1208 fail_if(!(doc = eolian_typedecl_documentation_get(tdl)));
@@ -1444,10 +1444,10 @@ START_TEST(eolian_function_types)
1444 eolian_init(); 1444 eolian_init();
1445 Eolian *eos = eolian_new(); 1445 Eolian *eos = eolian_new();
1446 1446
1447 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1447 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1448 1448
1449 /* Parsing */ 1449 /* Parsing */
1450 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/function_types.eot"))); 1450 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/function_types.eot")));
1451 1451
1452 /* void func(void); */ 1452 /* void func(void); */
1453 fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "VoidFunc"))); 1453 fail_if(!(decl = eolian_typedecl_alias_get_by_name(unit, "VoidFunc")));
@@ -1572,9 +1572,9 @@ START_TEST(eolian_function_as_arguments)
1572 eolian_init(); 1572 eolian_init();
1573 Eolian *eos = eolian_new(); 1573 Eolian *eos = eolian_new();
1574 1574
1575 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1575 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1576 1576
1577 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/function_as_argument.eo"))); 1577 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/function_as_argument.eo")));
1578 1578
1579 fail_if(!(cls = eolian_class_get_by_name(unit, "Function_As_Argument"))); 1579 fail_if(!(cls = eolian_class_get_by_name(unit, "Function_As_Argument")));
1580 1580
@@ -1614,9 +1614,9 @@ START_TEST(eolian_parts)
1614 eolian_init(); 1614 eolian_init();
1615 Eolian *eos = eolian_new(); 1615 Eolian *eos = eolian_new();
1616 1616
1617 fail_if(!eolian_directory_scan(eos, PACKAGE_DATA_DIR"/data")); 1617 fail_if(!eolian_directory_scan(eos, TESTS_SRC_DIR"/data"));
1618 1618
1619 fail_if(!(unit = eolian_file_parse(eos, PACKAGE_DATA_DIR"/data/parts.eo"))); 1619 fail_if(!(unit = eolian_file_parse(eos, TESTS_SRC_DIR"/data/parts.eo")));
1620 1620
1621 fail_if(!(cls = eolian_class_get_by_name(unit, "Parts"))); 1621 fail_if(!(cls = eolian_class_get_by_name(unit, "Parts")));
1622 1622