summaryrefslogtreecommitdiff
path: root/tests/scanner/annotationparser
Commit message (Collapse)AuthorAgeFilesLines
* Revert "giscanner: Fix section matching for documentation"Mathieu Duponchelle2020-09-291-34/+0
| | | | | | | | | This reverts commit de6512b31b614567bf1800406303d1ccfb6d9455. This was causing naming conflicts when the SECTION documentation was picked over the class documentation. See https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/360
* giscanner: Fix section matching for documentationJames Westman2020-09-071-0/+34
| | | | | | | | | | | | | When writing documentation to the GIR files, GIR tries to match classes with their matching SECTION: comment in the source code. Some codebases use kebab-case or CamelCase for their section names, but GIR always expects them to be flatcase or the matching will fail. This commit converts all section names to flatcase (by removing "-" and converting to lowercase) while they are being parsed, so that they are matched properly later on. Fixes #350.
* Support the gtk-doc action syntaxEmmanuele Bassi2020-04-241-1/+153
| | | | | | | | | | | | | | | | GTK4 allows adding widget-related actions to the documentation with the newly defined syntax: <class_name> '|' <action_name> ':' This means g-ir-scanner needs to detect this new format, to avoid emitting unnecessary warnings. Currently, we don't do anything with the actions; in the future we might want to add them to the documentation in the GIR, but for that we'd need a new element. See also: GNOME/gtk-doc!30
* Drop autotools build systemChristoph Reiter2019-03-111-70/+0
|
* message: simplify handling of error levelsChristoph Reiter2019-01-101-2/+2
| | | | | | | | Instead of allowing each error level to be enabled just enable all of them through the enable_warnings() method. This matches what the code is currently doing (minus that one helper script) and simplifies things. Also remove the error count, it's not used.
* tests: make scanner tests work with msvc + subprojectsChristoph Reiter2018-12-201-12/+6
| | | | | | | | Manually add all the subproject build directories to PATH for running the scanner tests. I'm wondering if meson shouldn't do this for us based on the dependency we pass to test(), but this will do for now.
* autotools: dist newly added meson build filesChristoph Reiter2018-12-161-1/+2
|
* meson: Run annotationparser testsTomasz Miąsko2018-12-091-0/+20
|
* Drop all Python 2 compat codeChristoph Reiter2018-12-082-26/+4
| | | | We only support 3.4+ now.
* gi-tester: Port to PythonChristoph Reiter2018-07-221-1/+1
| | | | | | Removes the dependency on bash there, so we can potentially use it on Windows as well. Not integrated with meson yet, but will hopefully make it easier to do so.
* build: Add test XML file to buildPhilip Withnall2015-10-051-0/+1
| | | | | | | Fixup to commit 10cb665fee2cc378dd2f13bad16e6384836a8b16. I failed to work git properly when submitting the patch. https://bugzilla.gnome.org/show_bug.cgi?id=729660
* giscanner: Mark gpointer nodes as nullable by defaultPhilip Withnall2015-10-041-0/+76
| | | | | | | | | | | | | gpointer parameters and return types should be marked as nullable by default, unless: • also annotated with (type) and not with (nullable); or • explicitly annotated with (not nullable). This introduces the (not nullable) annotation as a direct opposite to (nullable). In future, (not) could be extended to invert other annotations. https://bugzilla.gnome.org/show_bug.cgi?id=729660
* giscanner: Use unicode literals in all Python filesSimon Feltman2015-09-292-5/+20
| | | | | | | | | | | | Add unicode_literals future import which turns any string literal into a unicode string. Return unicode strings from the Python C extension module. Force writing of annotations (g-ir-annotation-tool) to output utf8 encoded data to stdout. This is an initial pass at following the "unicode sandwich" model of programming (http://nedbatchelder.com/text/unipain.html) needed for supporting Python 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use print as a function for Python 3 compatibilitySimon Feltman2015-09-292-0/+2
| | | | | | | Use future import "print_function" and update relevant uses of print as a function call. See: PEP 3105 https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Enable "true division" for all Python filesSimon Feltman2015-09-292-0/+2
| | | | | | | | | | Import Python 3 compatible "true division" from the future (PEP 238). This changes the Python 2 classic division which uses floor division on integers to true division. Verfied we don't actually use the division operator anywhere in the code base so this a safety for supporting both Python 2 and 3. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use absolute_import for all Python filesSimon Feltman2015-09-292-1/+2
| | | | | | Use absolute_import to ensure Python 3 compatibility of the code base. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* tests: add missing fixed-size array annotation testsDieter Verfaillie2015-06-291-0/+55
| | | | | | Cases where fixed-size has no value and fixed-size has a non-integer value where not yet tested. Found thanks to coverage.py
* tests: don't repeat --warn-all --reparse-validate argumentsDieter Verfaillie2015-06-291-1/+1
| | | | | "--warn-all --reparse-validate" is already contained in $(INTROSPECTION_SCANNER_ARGS), no need to repeat
* tests: sync with GTK-Doc test suite @ ↵Dieter Verfaillie2015-06-2410-40/+1229
| | | | | | 02e545371e2132a97458888895cacf57b8c0f83a (2015-06-23) https://bugzilla.gnome.org/show_bug.cgi?id=725685
* tests: execute annotationparser tests just onceDieter Verfaillie2015-06-242-40/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 42bb69a6a2f12165a9758b192e80da089e00ab5c introduced a bug causing test_parser.py and test_patterns.py tests to be executed twice. This patch fixes this and still allows the tests to be executed: - using 'make check' - manually: PYTHONPATH=. python tests/scanner/annotationparser/test_parser.py PYTHONPATH=. python tests/scanner/annotationparser/test_patterns.py - individually: python -m unittest test_parser.TestGiTag_Stability.test_001 python -m unittest test_patterns.TestCommentAsterisk.test_000 test_parser.py now results in: Ran 360 tests in 0.172s instead of: Ran 720 tests in 0.339s test_patterns.py now results in: Ran 213 tests in 0.014s instead of Ran 426 tests in 0.041s https://bugzilla.gnome.org/show_bug.cgi?id=745636
* tests: Python 3 fixesDieter Verfaillie2015-06-242-2/+2
| | | | | | | | tests/scanner/annotationparser/test_[parser|patterns].py stopped working with Python3 somewhere down the line due to the iteritems() call... https://bugzilla.gnome.org/show_bug.cgi?id=745636
* scanner: allow multiline annotationsDieter Verfaillie2015-04-184-44/+629
| | | | | | | Allow `identifier`, `parameter` and `tag` part `annotations` fields to span multiple lines https://bugzilla.gnome.org/show_bug.cgi?id=676133
* scanner: allow (array zero-terminated) instead of (array zero-terminated=1)Dieter Verfaillie2015-03-031-5/+3
| | | | | | | | | | | | | | What we already had: - (array zero-terminated=1) > array which is NULL terminated - (array zero-terminated=0) > array which is not NULL terminated - (array) > array which is not NULL terminated - (array zero-terminated=X) > array which is not NULL terminated where X can be anything What this patch adds: - (array zero-terminated) > array which is NULL terminated https://bugzilla.gnome.org/show_bug.cgi?id=657754
* Revert "giscanner: don't accept (allow-none) on Returns:"Ryan Lortie2014-05-064-37/+34
| | | | | | | This reverts commit 0839e696e9fbc1942ac5c61054de3b47e9578152. This was accidentally picked up by my 'git bz apply' against the bug as I was getting ready to push the last set of changes.
* giscanner: don't accept (allow-none) on Returns:Dieter Verfaillie2014-05-064-34/+37
| | | | | | | | | The old annotationparser.py happily parsed this, but giscanner/girwriter.py never serialized an allow-none attribute to the .gir file and girepository/girparser.c never looked for an allow-none attribute either. https://bugzilla.gnome.org/show_bug.cgi?id=660879
* tests: Update GI to use parallel test harnessSimon Feltman2014-01-041-2/+2
| | | | | | | | There was some dependence on the serial test harness in the recent tests that were added. Update GI to use the parallel test harness to avoid incompatibilities. https://bugzilla.gnome.org/show_bug.cgi?id=721477
* tests: Use Python unittest module parameterization for annotationparserSimon Feltman2013-12-291-0/+68
| | | | | | | | | | | | | | Add Python unittest module parameterization support to gi-tester through the use of a "TESTARGS" variable. Use the Automake test harness along with gi-tester for running the Python annotationparser tests. Add tests/scanner/annotationparser/Makefile.am and localize testing rules and EXTRA_DIST setup to this file. Specific Python tests can now be run as follows: cd tests/scanner/annotationparser make check TESTS=test_patterns.py TESTARGS=TestTagValueStability https://bugzilla.gnome.org/show_bug.cgi?id=720713
* tests: Refactor test_parser and test_patterns to use unittest.TestSuiteSimon Feltman2013-12-292-50/+119
| | | | | | | | | | | | | Update both test_parser.py and test_patterns.py to dynamically generate TestCase sub-classes rather than modify a statically defined one. Use unittest.TestSuite to queue up the generated test cases via the "load_tests" hook. Use underscores instead of periods as a seperator for dynamically generated test cases and methods to match Python identifiers. Beyond general cleanup, these changes will help the ability to specify Python tests individually. https://bugzilla.gnome.org/show_bug.cgi?id=720713
* tests: interesting annotationparser test caseDieter Verfaillie2013-10-091-0/+167
| | | | | | | | | GTK-Doc has trouble parsing multiline parameter description fields if the first word of a continuation line is "returns". We're already doing the right thing but make sure we continue to do so in the future https://bugzilla.gnome.org/show_bug.cgi?id=708445
* giscanner: fix c0e748e1cdf8cf0803266f94c3c5ad154df504a8Dieter Verfaillie2013-10-081-0/+2
| | | | | | | | | | | When encountering /**/ in the source, parse_gtk_doc_comment() would be executed (due to the /** part starting a GTK-Doc comment block) and would happily consume the / and everything up until the next comment block was closed or EOF, thus consuming a whole block of C code... Encoutered in the wild here: https://git.gnome.org/browse/clutter-gst/tree/clutter-gst/clutter-gst-player.c?id=03f0d8f48bd7f60e582e6185cb73a07038e8d55d#n1926
* giscanner: complain about text before the ' * 'Dieter Verfaillie2013-10-082-11/+14
| | | | | | Makes our GTK-Doc comment block rewriting tool halt on such issues, requireing user intervention instead of writing back even more bogus data.
* giscanner: write virtual method instance parameter docs to .gir fileDieter Verfaillie2013-10-081-0/+49
|
* docs: document some annotationparser.py hacking hintsDieter Verfaillie2013-10-081-11/+11
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=688897
* tests: sync with GTK-Doc test suite @ 1846fc7e904f6f56b74c366d205d6bb946eac17eDieter Verfaillie2013-10-084-9/+132
|
* giscanner: refactor GTK-Doc comment block serializationDieter Verfaillie2013-10-0855-92/+2338
|
* giscanner: add missing testsDieter Verfaillie2013-10-0820-9/+2295
|
* giscanner: make some warnings errorsDieter Verfaillie2013-10-087-12/+12
| | | | | | | GTK-Doc comment block fixer tool will refuse to rewrite source files that generated errors (indicating a source->parse tree->source would result in information being lost), but will happily continue on warnings (which do not result in information being lost).
* giscanner: honor line and paragraph breaks in description fieldsDieter Verfaillie2013-10-0813-18/+124
| | | | | | | | | GTK-Doc parameter description fields are allowed to span multiple lines, tag description fields are allowed to span multiple lines and paragraphs. A tool fixing/rewriting GTK-Doc comment blocks in source files would need to have description fields parsed and stored (almost) exactly as they appear in the source file.
* giscanner: improve state trackingDieter Verfaillie2013-10-084-67/+10
|
* giscanner: store indentation before the '*' of each lineDieter Verfaillie2013-10-081-0/+19
|
* giscanner: store code before and after comment blockDieter Verfaillie2013-10-082-58/+220
| | | | | | so we can later use them to re-write source files containing broken GTK-Doc comment blocks where /** is preceded by and/or */ is followed by code...
* giscanner: refactor annotation validationDieter Verfaillie2013-10-081-0/+32
| | | | | | | | - annotations on the identifier (formerly g-i specific tags) have never been validated before, so fix this - removes duplicate validation code from GtkDocTag and GtkDocParameter - remove repeated validation code doing the same thing as annotationparser from maintransformer...
* giscanner: give parameters their own storage classDieter Verfaillie2013-10-081-2/+2
|
* giscanner: deprecate GObject-Introspection GTK-Doc tagsDieter Verfaillie2013-10-089-69/+941
| | | | | | | | | | | | | | | | | | | | | After discussing a different issue with the GTK-Doc maintainers, we learned that our g-i specific top level tags should never have existed in the first place. The prefered notation for annotations that apply to the identifier should be written on the identifier line, for example like what we already do with (skip). As a result, this patch deprecates g-i specific top level tags and implements them as annotations on the identifier instead but still keeps support for malformed comment blocks using g-i specific top level tags. This means that all annotated code "out there" will continue to work just fine with this version of g-i, but when a developer decides to fix deprecation warnings in his/her comment blocks, the dependency on g-i needs to be raised to a version that contains at least this patch. #676133 https://bugzilla.gnome.org/show_bug.cgi?id=676133
* giscanner: flesh out annotation parsing and storageDieter Verfaillie2013-10-089-173/+556
| | | | | | | | | | - remove annotations regex, restore proper parens parsing - drop weird DocOption() storage class and use lists/dicts as appropriate - make GtkDocAnnotations a simple OrderedDict subclass instead of a weird hybrid dict/list storage class - Deprecate Attribute: tag, replace with (attributes) annotation on the identifier
* giscanner: extract tag valuesDieter Verfaillie2013-10-0821-41/+120
|
* giscanner: remove unused GtkDocCommentBlock.valueDieter Verfaillie2013-10-081-2/+2
|
* giscanner: fix GTK-Doc section parsingDieter Verfaillie2013-10-081-12/+6
|
* giscanner: fix GTK-Doc identifier parsingDieter Verfaillie2013-10-081-3/+16
| | | | | | No need to track what type of identifier we've found as we don't use that information later on. Continue searching for an identifier if it's not found on the first line like gtkdoc-mkdb does.
* giscanner: rename DocBlock to GtkDocCommentBlockDieter Verfaillie2013-10-081-2/+2
| | | | | and move it downwards after DocTag, DocOptions etc for easier reading