eolian: initial test file for docs (no APIs to test yet)
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 3 Jun 2015 11:06:36 +0000 (12:06 +0100)
committerDaniel Kolesa <d.kolesa@osg.samsung.com>
Wed, 3 Jun 2015 11:06:36 +0000 (12:06 +0100)
src/Makefile_Eolian.am
src/tests/eolian/data/docs.eo [new file with mode: 0644]
src/tests/eolian/eolian_parsing.c

index efe3a22..12d8ef5 100644 (file)
@@ -96,6 +96,7 @@ tests/eolian/data/null.eo \
 tests/eolian/data/no_nmsp.eo \
 tests/eolian/data/import.eo \
 tests/eolian/data/decl.eo \
+tests/eolian/data/docs.eo \
 tests/eolian/data/import_types.eot
 
 EOLIAN_TESTS_EOS_GENERATED = \
diff --git a/src/tests/eolian/data/docs.eo b/src/tests/eolian/data/docs.eo
new file mode 100644 (file)
index 0000000..36d1c8f
--- /dev/null
@@ -0,0 +1,63 @@
+struct Foo {
+    [[This is struct Foo.
+
+      This is a longer description for struct Foo.
+    ]]
+    field1: int; [[Field documentation.]]
+    field2: float;
+    field3: short; [[Another field documentation.]]
+}
+
+enum Bar {
+    [[Docs for enum Bar.]]
+    blah = 0,
+    foo = 1, [[Docs for foo.]]
+    bar = 2 [[Docs for bar.]]
+}
+
+type Alias: Bar; [[Docs for typedef.
+
+                   More docs for typedef.
+                   See @Bar.
+                 ]]
+
+var pants: int = 150; [[Docs for var.]]
+
+struct Opaque; [[Opaque struct docs. See @Foo for another struct.]]
+
+class Docs {
+    [[Docs for class.
+
+      More docs for class.
+      @Foo
+      @Bar
+      @Alias
+      @pants
+    ]]
+    methods {
+        meth {
+            [[Method documentation.]]
+            params {
+                @in a: int; [[Param documentation.]]
+                @out b: float;
+                @out c: long; [[Another param documentation.]]
+            }
+            return: int; [[Return documentation.]]
+        }
+        @property prop {
+            [[Property common documentation.]]
+            get {
+                [[Get documentation.]]
+            }
+            set {
+                [[Set documentation.]]
+            }
+            values {
+                val: int; [[Value documentation.]]
+            }
+        }
+    }
+    events {
+        clicked; [[Event docs.]]
+    }
+}
index 528eda3..f3d86a5 100644 (file)
@@ -1128,6 +1128,19 @@ START_TEST(eolian_decl)
 }
 END_TEST
 
+START_TEST(eolian_docs)
+{
+   eolian_init();
+
+   fail_if(!eolian_directory_scan(PACKAGE_DATA_DIR"/data"));
+
+   fail_if(!eolian_file_parse(PACKAGE_DATA_DIR"/data/docs.eo"));
+   fail_if(!eolian_class_get_by_name("Docs"));
+
+   eolian_shutdown();
+}
+END_TEST
+
 void eolian_parsing_test(TCase *tc)
 {
    tcase_add_test(tc, eolian_simple_parsing);
@@ -1148,5 +1161,6 @@ void eolian_parsing_test(TCase *tc)
    tcase_add_test(tc, eolian_null);
    tcase_add_test(tc, eolian_import);
    tcase_add_test(tc, eolian_decl);
+   tcase_add_test(tc, eolian_docs);
 }