Browse files

Add a section on how to add a test for a parser in HACKING

  • Loading branch information...
b4n committed Jan 14, 2014
1 parent 7205b83 commit 5975931be8b43086da947728406408e6dc332445
Showing with 22 additions and 0 deletions.
  1. +22 −0 HACKING
@@ -541,6 +541,28 @@ Unless your parser uses C-like tag type kinds, update
add_top_level_items() for foo, calling tag_list_add_groups(). See
get_tag_type_iter() for which tv_iters fields to use.
+The tag parser tests checks if the proper tags are emitted
+for a given source. Tests for tag parsers consist of two files: the
+source to parse, and the expected output. Tests are run using ``make
+The source to parse should be in the file ``tests/ctags/mytest.ext``,
+where ``mytest`` is the name you choose for your test, and ``ext`` is an
+extension recognized by Geany as the language the test file is for.
+This file should contain a snippet of the language to test for.
+It can be either long or short, depending on what it tests.
+The expected output should be in the file ``tests/ctags/mytest.ext.tags``
+(which is the same name as the source, but with ``.tags`` appended), and
+should be in the format generated by ``geany -g``. This file contains
+the tag information expected to be generated from the corresponding
+source file.
+When you have these two files, you have to list your new test along the
+other ones in the ``test_source`` variable in ``tests/ctags/``.
+Please keep this list sorted alphabetically.

0 comments on commit 5975931

Please sign in to comment.