summaryrefslogtreecommitdiff
path: root/src/tests/eolian/eolian_parsing.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-01-18 17:24:12 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2019-01-21 17:19:14 +0100
commit7feeda0410382a2d121e5de1ba89982eda9a41b6 (patch)
tree9ebe815b576448969c0a9a95040b17b5fdd35ae4 /src/tests/eolian/eolian_parsing.c
parentdab4d8d8a446f98b4fa2f63e5b948b8f629e460d (diff)
eolian: add support for composite section into regular classes
Each regular class can now have a section called 'composite', which can contain interfaces and interfaces only. This defines a list of interfaces that are allowed to be unimplemented on the class, as it is assumed the class will be composited with some other class implementing those interfaces. Only regular classes can have this, as only regular classes can be instantiated. It will also be necessary to check whether the classes in the section appear somewhere within the inheritance tree. For now, this testing is not being done. Example of usage: composite { Some.Magic.Interface; Another.Magic.Interface; } directly in the class body.
Diffstat (limited to '')
-rw-r--r--src/tests/eolian/eolian_parsing.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c
index ce2ea68e2f..b029a4ddad 100644
--- a/src/tests/eolian/eolian_parsing.c
+++ b/src/tests/eolian/eolian_parsing.c
@@ -1633,6 +1633,21 @@ EFL_START_TEST(eolian_class_requires_classes)
1633} 1633}
1634EFL_END_TEST 1634EFL_END_TEST
1635 1635
1636EFL_START_TEST(eolian_class_unimpl)
1637{
1638 Eolian_State *eos = eolian_state_new();
1639
1640 fail_if(!eolian_state_directory_add(eos, TESTS_SRC_DIR"/data"));
1641
1642 setenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN", "1", 1);
1643 const Eolian_Unit *unit = eolian_state_file_parse(eos, TESTS_SRC_DIR"/data/unimpl.eo");
1644 unsetenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN");
1645 fail_if(!unit);
1646
1647 eolian_state_free(eos);
1648}
1649EFL_END_TEST
1650
1636void eolian_parsing_test(TCase *tc) 1651void eolian_parsing_test(TCase *tc)
1637{ 1652{
1638 tcase_add_test(tc, eolian_simple_parsing); 1653 tcase_add_test(tc, eolian_simple_parsing);
@@ -1658,4 +1673,5 @@ void eolian_parsing_test(TCase *tc)
1658 tcase_add_test(tc, eolian_parts); 1673 tcase_add_test(tc, eolian_parts);
1659 tcase_add_test(tc, eolian_mixins_require); 1674 tcase_add_test(tc, eolian_mixins_require);
1660 tcase_add_test(tc, eolian_class_requires_classes); 1675 tcase_add_test(tc, eolian_class_requires_classes);
1676 tcase_add_test(tc, eolian_class_unimpl);
1661} 1677}