[gtk-doc] highlight: add a trivial test



commit 83a9b030ff74fb264b194fa5e33cc2733aa2b7c8
Author: Stefan Sauer <ensonic users sf net>
Date:   Tue Apr 16 07:51:21 2019 +0200

    highlight: add a trivial test

 tests/Makefile.am  |  4 +++-
 tests/highlight.py | 34 ++++++++++++++++++++++++++++++++++
 tests/meson.build  |  2 ++
 3 files changed, 39 insertions(+), 1 deletion(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 87edc44..d2d0b86 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,7 +1,9 @@
 ## Process this file with automake to produce Makefile.in
 
 SUBDIRS =
-TESTS = tools.sh check.py common.py mkdb.py mk_to_db.py mkhtml2.py scan.py
+TESTS = \
+  tools.sh check.py common.py highlight.py mkdb.py mk_to_db.py mkhtml2.py \
+  scan.py
 
 if BUILD_TESTS
 # we need to run '.' last so that sanity processes the generated docs
diff --git a/tests/highlight.py b/tests/highlight.py
new file mode 100644
index 0000000..7c88049
--- /dev/null
+++ b/tests/highlight.py
@@ -0,0 +1,34 @@
+# -*- python -*-
+#
+# gtk-doc - GTK DocBook documentation generator.
+# Copyright (C) 2018  Stefan Sauer
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+
+import unittest
+
+from gtkdoc import highlight
+
+
+class HighlightTestCase(unittest.TestCase):
+
+    def test_AlwaysKnowsCLang(self):
+        code = highlight.highlight_code('void main(int argc, char **argv')
+        self.assertIsNotNone(code)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/tests/meson.build b/tests/meson.build
index 41026a3..b48f978 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -7,6 +7,8 @@ gobject_docpath = join_paths(gobject_prefix, 'share', 'gtk-doc', 'html')
 gtkdoc_unit_tests = [
   'check',
   'common',
+  'highlight',
+  'mkdb',
   'mk-to-db',
   'mkhtml2',
   'scan',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]