summaryrefslogtreecommitdiff
path: root/tests/scanner
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add more regression tests for (not nullable)Philip Withnall2015-11-0610-0/+344
| | | | | | | | | | | | On bug #719966, the question arose of whether parameters annotated with (element-type) but not (not nullable) are regarded as nullable or non-nullable. Add some new unit tests to Regress-1.0.gir to check the behaviour is as expected: annotating a parameter with (element-type) implicitly makes it non-nullable (unless also annotated with (nullable)). https://bugzilla.gnome.org/show_bug.cgi?id=757678
* tests: Usage a single allocation for test_ghash_gvalue_returnSimon Feltman2015-10-191-22/+26
| | | | | | | | Use a single static allocation for the hash created in regress_test_ghash_gvalue_return(). This function is explicitly marked as returning the hash with transfer-none and doesn't need to re-create the hash each call. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* tests: Free input array in test_array_int_inout()Simon Feltman2015-10-191-0/+2
| | | | | | Transfer is annotated as full so the function should free its input. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* tests: Free input string in regress_test_utf8_inout()Simon Feltman2015-10-191-0/+1
| | | | | | | Transfer is annotated as full so the function should free its input after testing and before output assignment. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* tests: Unref async result after adding to idle callbackSimon Feltman2015-10-191-0/+1
| | | | | | | | g_simple_async_result_complete_in_idle() will add its own reference for managing the async result. We need to unref the result after calling this so we don't leak. https://bugzilla.gnome.org/show_bug.cgi?id=736517
* Add support for function typedefs without pointerBen Iofel2015-10-1910-0/+214
| | | | | | | | | | g-ir-scanner now supports something like this: typedef void my_callback(int); Notice how my_callback is not a pointer. https://bugzilla.gnome.org/show_bug.cgi?id=755645
* maintransformer: Fix regression in callback closure assignmentColin Walters2015-10-102-27/+14
| | | | | | | The nullable code needs to search via index lookup of closure_name, which drops the need to (incorrectly) assign closure_name again. https://bugzilla.gnome.org/show_bug.cgi?id=756352
* 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-044-16/+122
| | | | | | | | | | | | | 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: Mark (closure) parameters as (nullable) by conventionPhilip Withnall2015-10-042-20/+100
| | | | | | | | All user_data pointers should be nullable, and they should all be annotated as closures too. I have not found any counter-examples where a closure is non-nullable. https://bugzilla.gnome.org/show_bug.cgi?id=729660
* scanner: Fix allow-none on return valuesGarrett Regier2015-09-2910-1/+234
| | | | | | | | The optional annotation was being applied which is invalid for return values. https://bugzilla.gnome.org/show_bug.cgi?id=752029 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* tests: Fix python2/3 difference with respect to rawunicodeescapeColin Walters2015-09-291-1/+1
| | | | | Apparently Python 2 still tries to interpret r"\u" in some circumstances?
* giscanner: Use builtins module in Python 3Simon Feltman2015-09-291-2/+6
| | | | | | Add conditional import for Python 3's renamed builtins module. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use unicode literals in all Python filesSimon Feltman2015-09-294-5/+22
| | | | | | | | | | | | 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-294-0/+4
| | | | | | | 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-294-0/+4
| | | | | | | | | | 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-294-1/+6
| | | | | | Use absolute_import to ensure Python 3 compatibility of the code base. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* tests: Add expected files for previous commitColin Walters2015-09-283-0/+94
|
* scanner: GVariants are also valid to be floatingColin Walters2015-09-284-0/+21
| | | | More followup to https://bugzilla.gnome.org/show_bug.cgi?id=752047
* scanner: Warn and ignore on incorrect transfer annotationsColin Walters2015-09-271-1/+1
| | | | This reverts commit 232f3c831260f596e36159112292897962a505b4.
* Revert "scanner: Warn and ignore on incorrect transfer annotations"Michael Catanzaro2015-09-271-1/+1
| | | | | | It broke at least atk and mutter. This reverts commit 5ae7bd58b6266997b61d897ad6562118eeb59210.
* scanner: Warn and ignore on incorrect transfer annotationsGarrett Regier2015-09-261-1/+1
| | | | | | | | This is an issue in various code bases and tends to confuse newcomers. https://bugzilla.gnome.org/show_bug.cgi?id=752047 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* regress: Add a test for (nullable)Colin Walters2015-09-037-0/+138
| | | | Related to: https://bugzilla.gnome.org/719966
* test: Add a test for GList containing GType.Christoph Reiter2015-07-057-0/+146
| | | | | | See https://bugzilla.gnome.org/show_bug.cgi?id=749696 https://bugzilla.gnome.org/show_bug.cgi?id=751978
* 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: go through 'env' for all TESTS_ENVIRONMENTDieter Verfaillie2015-06-291-1/+1
| | | | | we already go through 'env' for all other TESTS_ENVIRONMENT statements, reason to not do so here too...
* tests: don't repeat --warn-all --reparse-validate argumentsDieter Verfaillie2015-06-292-2/+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: make sure g-ir-scanner can find cairo-1.0.girDieter Verfaillie2015-06-241-8/+8
| | | | | | | | | | "cairo-1.0.gir" is generated into "$(top_builddir)/gir" but g-ir-scanner is never instructed to look into that directory. This fails somewhat when there is no system installed copy of it when VPATH building "tests/scanner/Regress-1.0.gir": Couldn't find include cairo-1.0.gir (search path: "everything except the correct value") https://bugzilla.gnome.org/show_bug.cgi?id=745636
* 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: remove unused test filesDieter Verfaillie2015-06-242-1534/+0
| | | | | | | libfoo was moved into libregress in 9fc6eb16e954559d97cdd9a03437c8b1877c2a1d libtestinherit was moved into libregress in bb1ac9cf2dc450c5d44b1e39e3162ba06069f4a1 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
* tests: fix make distcheckDieter Verfaillie2015-06-208-0/+204
| | | | | Add missing doc-tool tests, fixes "make distcheck" breakage introduced by 09daa28c5b4625b6f274b3b340bc85e33bef80b5
* Add deprecation guards for GSimpleAsyncResult deprecationChristoph Reiter2015-06-191-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=751150
* tests: Add regression test for (transfer full) returning callbacksDebarshi Ray2015-06-182-0/+22
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=750286
* scanner: Add --symbol-filter-cmdGarrett Regier2015-04-204-0/+107
| | | | | | | | | | Add the command line flag --symbol-filter-cmd to g-ir-scanner which allows running symbol names through a filtering shell command. The symbol is sent as stdin to the filter command and expects a filtered result written to stdout. https://bugzilla.gnome.org/show_bug.cgi?id=744534 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* 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
* Makefile.introspection: pass CC to scannerDieter Verfaillie2015-04-181-0/+1
| | | | | | Extends commit 92d9c38 to also pass CC to g-ir-scanner. https://bugzilla.gnome.org/show_bug.cgi?id=700066
* giscanner: enable the --reparse-validate option for our test suiteDieter Verfaillie2015-03-041-1/+1
| | | | | | | | | | Doing so reveals GIRParser did not yet support: - the (skip) annotation on parameters and return values - the (attributes) annotation This patch fixes both issues an prevents further similar problems. https://bugzilla.gnome.org/show_bug.cgi?id=738171
* scanner: allow (array zero-terminated) instead of (array zero-terminated=1)Dieter Verfaillie2015-03-032-6/+4
| | | | | | | | | | | | | | 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
* Don't unconditionally include config.h in regress.cMatthias Clasen2014-10-101-0/+3
| | | | | | | This is an installed file, so we can't assume that config.h will be around. https://bugzilla.gnome.org/show_bug.cgi?id=737275
* tests: Change names with case-only distinctionPhilip Chimento2014-10-013-5/+5
| | | | | | | | | | | | | | | | | | RegressIntSet and RegressIntset, aliases of one another, were causing two documentation pages to be built by the documentation tests that were named identically except for letter case. On OSX and Windows, the most common filesystems are case-insensitive, and those two files can't exist in the same directory on case- insensitive filesystems. That caused the tests to fail. It also caused problems when checking out the repository, because the expected documentation set also contains those files. This commit fixes the symptom (so that JHbuild will stop erroring out on this module) but not the problem of generating a documentation set for two identifiers which differ (perfectly legally) only by case. https://bugzilla.gnome.org/show_bug.cgi?id=725264
* scanner: Honor nested types on array declarations as wellColin Walters2014-09-056-1/+69
| | | | | | | | | We have special code to look at (type GLib.List(utf8)), but (type GLib.PtrArray(utf8)) didn't work. This allows NetworkManager to annotate the ActiveConnections property. https://bugzilla.gnome.org/show_bug.cgi?id=733879
* tests/scanner: Decorate Symbols for ExportChun-wei Fan2014-08-1522-1/+752
| | | | | | | | | | This updates the test headers and sources to decorate the symbols with the macro that can be used to export the symbols, and include config.h first in the c-sources so that the macro can be defined with the compiler directive to export the symbols. Update the CFLAGS as well so that the header that defines the export decoration macro can be found. https://bugzilla.gnome.org/show_bug.cgi?id=732669
* Update Regress-1.0-sections-expected.txtSimon Feltman2014-08-071-0/+1
| | | | | | Update based additional test added with commit e2b96aaa4 https://bugzilla.gnome.org/show_bug.cgi?id=702508
* tests: Add regression test for callbacks with an inout arrayGarrett Regier2014-08-079-0/+283
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702508
* Parse and expose ownership transfer for instance parametersGiovanni Campagna2014-07-037-0/+125
| | | | | | | | | | | Knowing the ownership transfer for instance parameters is necessary for correct memory management of functions which "eat" their instance argument, such as g_dbus_method_invocation_return_*. Parse this information from the gir file and store in the typelib, and then provide new API on GICallableInfo to retrieve this. https://bugzilla.gnome.org/show_bug.cgi?id=729662
* build: Fix distcheck after addition of identifier filteringSimon Feltman2014-06-031-1/+2
| | | | | Add missing identfilter.py to EXTRA_DIST and correct spelling of Identfilter-1.0-expected.gir.
* scanner: Add --identifier-filter-cmdSimon Feltman2014-06-035-1/+152
| | | | | | | | | Add the command line flag --identifier-filter-cmd to g-ir-scanner which allows running identifier names through a filtering shell command. The identifier is sent as stdin to the filter command and expects a filtered result written to stdout. https://bugzilla.gnome.org/show_bug.cgi?706898
* tests: fix Regress expected outputRyan Lortie2014-05-071-2/+11
| | | | | Now that Cancellable and AsyncReadyCallback are being correctly recognised again, adjust the expected output of the Regress testcase.