summaryrefslogtreecommitdiff
path: root/tests/warn
Commit message (Collapse)AuthorAgeFilesLines
* Meson: Fix build as subprojectXavier Claessens2020-05-061-4/+4
| | | | | meson.build_root() is the root of the main project, better use meson.current_build_dir() instead.
* Drop autotools build systemChristoph Reiter2019-03-111-27/+0
|
* maintransformer: Don't warn on (optional) annotations on (inout)Guido Günther2019-01-131-5/+5
| | | | This makes the scanner consistent with the docs.
* 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.
* meson: Port repository testsTomasz Miąsko2018-12-101-2/+2
|
* Drop deprecated and redundant universal newline modeTomasz Miąsko2018-12-091-1/+1
|
* Drop all Python 2 compat codeChristoph Reiter2018-12-081-10/+1
| | | | We only support 3.4+ now.
* g-ir-tools: respect gir_dir_prefixKai Kang2018-10-081-0/+1
| | | | | | | | | Configure option gir_dir_prefix is used to configure install dir for .gir files, so add its value to include file search paths. Fix for flake8 and meson-test at same time. Signed-off-by: Kai Kang <kai.kang@windriver.com>
* tests: depend on flake8 instead of including pep8/pyflakesChristoph Reiter2018-08-151-0/+1
| | | | | | | | | | | | | | | | g-i includes an old version of pep8 and pyflakes and uses that during "make check". It (1) doesn't catch all cases newer versions of pycodestyle/pyflakes catch and (2) doesn't test all Python files (3) doesn't work with meson. Instead of updating just remove them and depend on flake8 instead. To run the checks simply run flake8 in the root dir. This also makes it possible to run those checks when using meson and not autotools. To not get test suite failures on flake8 updates move the checks from "make check" to an extra "make check.quality" target.
* meson: Add a "python" option to make the python to build against configurableChristoph Reiter2018-07-111-1/+1
| | | | | | | | This allows us to build with Python 2 and run tests with it. This requires the new "python" meson module which was added in 0.46.0 so bump the required meson version (glib needs a newer one anyway). Also fixes a small test error under Python 2.
* Convert _Bool to gboolean for backward compatibility.Tomasz Miąsko2018-06-231-13/+13
| | | | See !24 for the discussion
* Recognize additional basic types from ISO/IEC TS 18661-3:2015.Tomasz Miąsko2018-06-231-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | Recognize additional floating point types from ISO/IEC TS 18661-3:2015, that are already in use by glibc. This continues work from commit 8cf3e8e5cf6d0d49db359f50c6eb0bc9ca22fbef and fixes issue #201. * _Float16 * _Float32 * _Float64 * _Float128 * _Float32x * _Float64x * _Float128x Use a single BASIC_TYPE token for basic types, while using its string representation as a type name. This also fixes incorrect type used previously for __uint128_t, __int128_t, __uint128, __int128, and _Float128 (they have been mapped to int and float respectively). Also avoid mapping bool and _Bool to gboolean as those are distinct types and generally ABI incompatible. Fixes issue #202. After this changes, when _Bool, _Float* or _int128 types are used as a part of public API, g-ir-scanner will produce warning about unresolved type. This is appropriate given that they are currently inexpressible in GIRepository format.
* meson: Add the giscanner warning testsChristoph Reiter2018-06-213-2/+47
| | | | I couldn't get it to work on Windows, so skip that for now.
* Revert "removing $(srcdir) because it is not replaced correctly and not ↵Emmanuele Bassi2017-05-041-1/+1
| | | | | | | | necessary" This reverts commit 17ef691e9b3ebd475b01d1e623d3df7b1f534dfa. This breaks builddir != srcdir builds, like GNOME Continuous.
* Revert "build: Use $(srcdir) when calling Python scripts"Emmanuele Bassi2017-05-041-1/+1
| | | | This reverts commit b1200a87bc0bd4f4fcd5275f25422032104138ed.
* build: Use $(srcdir) when calling Python scriptsEmmanuele Bassi2017-05-041-1/+1
| | | | | | We need to point Python in the right direction, because unlike source rules, automake won't automatically expand commands in explicit make rules.
* removing $(srcdir) because it is not replaced correctly and not necessaryKarl-Philipp Richter2017-05-041-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744021
* scanner: Warn and ignore return annotations when there is no return valueGarrett Regier2015-10-042-0/+20
| | | | | | | | Otherwise the .gir can contain invalid data which would likely cause a crash at runtime. https://bugzilla.gnome.org/show_bug.cgi?id=752044 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* scanner: Warn and ignore on incorrect optional/nullable/allow-none annotationsGarrett Regier2015-10-044-0/+47
| | | | | | | These can easily be misunderstood, especially optional. https://bugzilla.gnome.org/show_bug.cgi?id=752065 Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
* tests/warn: Fix test for previous GVariant floating commitColin Walters2015-09-291-1/+1
|
* 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-291-0/+1
| | | | | | | | | | | | 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: Replace repr format usage with string formatterSimon Feltman2015-09-291-4/+4
| | | | | | | | | | | Replace occurances of "%r" (repr) in format strings where the intended behaviour is to output a quoted string "'foo'" with explicit usage of "'%s'". This is needed to move the codebase to unicode literals in order to upgrade to Python 3. Python 2 unicode strings are expanded with repr formatting prefixed with a "u" as in "u'foo'" which causes failures for various text formatting scenarios. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* giscanner: Use print as a function for Python 3 compatibilitySimon Feltman2015-09-291-0/+1
| | | | | | | 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-291-0/+1
| | | | | | | | | | 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-291-0/+2
| | | | | | Use absolute_import to ensure Python 3 compatibility of the code base. https://bugzilla.gnome.org/show_bug.cgi?id=679438
* scanner: Tweak "invalid transfer" warning to show type tooColin Walters2015-09-271-6/+6
| | | | Should help debugging.
* scanner: Warn and ignore on incorrect transfer annotationsColin Walters2015-09-271-4/+28
| | | | This reverts commit 232f3c831260f596e36159112292897962a505b4.
* Revert "scanner: Warn and ignore on incorrect transfer annotations"Michael Catanzaro2015-09-271-28/+4
| | | | | | It broke at least atk and mutter. This reverts commit 5ae7bd58b6266997b61d897ad6562118eeb59210.
* scanner: Warn and ignore on incorrect transfer annotationsGarrett Regier2015-09-261-4/+28
| | | | | | | | 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>
* scanner: allow (array zero-terminated) instead of (array zero-terminated=1)Dieter Verfaillie2015-03-031-5/+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
* tests: Switch two more uses to LOG_COMPILER to fix parallel-testsColin Walters2014-01-251-1/+1
| | | | | | This is similar to previous commits; we need to use LOG_COMPILER in order for Automake's parallel-tests framework to work. It's not allowed to include binaries in TESTS_ENVIRONMENT anymore.
* tests: Use Automake test harness for warning testsSimon Feltman2013-12-292-13/+4
| | | | | | | | | | Update warning tests to use the Automake test harness per-header file check. This allows for quicker more granular testing, for example: cd tests/warn make check TESTS=return-gobject.h https://bugzilla.gnome.org/show_bug.cgi?id=720713
* giscanner: Fix GtkDocBlock.position...Dieter Verfaillie2013-10-084-8/+8
| | | | | ... so it points to the start of the GTK-Doc comment block instead of the position of the identifier field.
* giscanner: refactor annotation validationDieter Verfaillie2013-10-086-40/+36
| | | | | | | | - 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: flesh out annotation parsing and storageDieter Verfaillie2013-10-081-5/+5
| | | | | | | | | | - 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: give message.ERROR a purposeDieter Verfaillie2013-10-081-2/+2
| | | | | | | | | | | | | | | | | | | It's not yet being used but will be in the future by annotationparser.py to signal the difference between message.WARNING: something is wrong but the comment block can still be parsed and serialized back into a comment block without information being lost message.ERROR: something is wrong and the comment block can *not* be parsed and serialized back into a comment block without information being lost Different tools can then act accordingly. Nothing will change for g-ir-scanner but this will be important for the GTK-Doc comment block rewriting tool to prevent extremely broken input leading to even more broken output...
* giscanner: give pointer to original comment block...Dieter Verfaillie2013-10-081-5/+14
| | | | | ...when complaining about multiple comment blocks documenting the same identifier.
* giscanner: rename the parse() method to parse_comment_blocks()Dieter Verfaillie2013-10-081-1/+1
| | | | | | We already have a parse_comment_block() method parsing a single GTK-Doc comment block so it only seems natural to have a plural parse_comment_blocks() to go along with that.
* giscanner: rename AnnotationParser() to GtkDocCommentBlockParser()Dieter Verfaillie2013-10-081-3/+3
| | | | | | Clarify the purpose of what up until now was know as the AnnotationParser() class, as it does more than just extracting annotations, it parses the complete GTK-Doc comment block.
* giscanner: rename "options" to "annotations"Dieter Verfaillie2013-10-081-1/+1
| | | | | | | Makes it easier to understand the difference between an annotation and an option, which are written as "(annotation option1=value1 option2=value2 ...)" in GTK-Doc comment blocks.
* tests: move GTK-Doc comment block warning testsDieter Verfaillie2013-10-081-198/+0
| | | | | | It makes sense to let test_parser.py check everything which is focused purely on testing GTK-Doc comment blocks (ie annotationparser.py functionality).
* tests: fix diff outputDieter Verfaillie2013-10-081-6/+3
| | | | | Empty lines do get removed or added sometimes, so make sure we see those in our diff output.
* tests: fix warning tests message sorting...Dieter Verfaillie2013-10-081-2/+3
| | | | | | | | ... by using the actual line numbers instead of sorting the whole expected/emitted string. The latter is wrong as for example tests/warn/annotationparser.h line 109 got sorted before line 120 which got sorted before line 12.
* tests: Update misc/pep8.py to 1.4.5Dieter Verfaillie2013-05-071-7/+9
| | | | | | | | | | | | | | | | | Version in our tree is a wee bit outdated. For example, later work will introduce an utf8 encoded python source file which our old pep8.py does not yet understand (yeah, it really was *that* ancient)... Updated from: https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py Takes 552c1f1525e37a30376790151c1ba437776682c5, f941537d1c0a40f0906490ed160db6c79af572d3, 5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and a17f157e19bd6792c00321c8020dca5e5a281f45 into account... https://bugzilla.gnome.org/show_bug.cgi?id=699535
* fix "make distcheck"Dieter Verfaillie2013-04-212-3/+3
| | | | | | | | | | - Configure with --enable-doctool when running "make distcheck" - Remove $(top_builddir)/.make-check-passed as the pre-commit hook using this was removed in de84ea0cf212c251e099f456bb675492f664e93d - Fix CLEANFILES + manual rm invocations - Fix running warning tests uninstalled (VPATH build issue) https://bugzilla.gnome.org/show_bug.cgi?id=697669
* Revert "gi-r-scanner: add support for raw CFLAGS flags option"Colin Walters2013-03-051-2/+1
| | | | | | Doesn't work with arguments that have shell quotes. This reverts commit 95b03cf87efbd4fea4b7d55601c9752cefd29bfc.
* gi-r-scanner: add support for raw CFLAGS flags optionTim Lunn2013-03-061-1/+2
| | | | | | | | gi-r-scanner chokes when gir_CFLAGS have an '-include <header>' since this is not a recognised option. This commit adds a new --cflags option that passes cflags directly to the spawned gcc. https://bugzilla.gnome.org/show_bug.cgi?id=695182
* Ship missing header files for tests/warn/ checkMartin Pitt2013-02-201-1/+1
|
* tests: Be compatible with Automake 1.11, 1.12 and 1.13, and the future, ↵Colin Walters2013-02-192-3/+13
| | | | | | | | hopefully Automake only sees it as one test now, but eh, who cares. https://bugzilla.gnome.org/show_bug.cgi?id=694198