summaryrefslogtreecommitdiff
path: root/tests/warn/warningtester.py
Commit message (Collapse)AuthorAgeFilesLines
* Always pass an encoding to open() using text modeChristoph Reiter2020-11-071-1/+1
| | | | | | | | Otherwise we'll end up using the locale encoding. While it's usually utf-8, that's not the case on Windows. There is one place where a file with filenames is passed, not sure there so I left it and passed a explicit None.
* 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.
* 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 the giscanner warning testsChristoph Reiter2018-06-211-1/+5
| | | | I couldn't get it to work on Windows, so skip that for now.
* 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
* 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: 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.
* 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
* 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
* warningtester: Sort the list of warningsJasper St. Pierre2013-02-071-0/+3
| | | | | | | | This means that we can simply put all warnings at the bottom, unrelated to the order that they're emitted in the code, keeping line numbers more stable. https://bugzilla.gnome.org/show_bug.cgi?id=693098
* warningtester: make it possible to EXPECT multiple lines of outputDieter Verfaillie2012-04-171-60/+74
|
* warningtester: Hack in DATADIRGOBJECT_INTROSPECTION_1_29_15Colin Walters2011-07-271-0/+4
|
* Fix tests to look in correct directory for typelibsColin Walters2010-11-161-2/+2
| | | | With nonrecursive they're in $(top_builddir) now
* Switch to nonrecursive make for core (i.e. not tests/)Colin Walters2010-11-091-0/+4
| | | | | This is cleaner and faster, and prepares us better for an incoming import of CMPH.
* [warningtester] Prettify error outputJohan Dahlin2010-09-231-2/+6
|
* tests: Look for uninstalled .girsColin Walters2010-09-221-0/+3
| | | | | | | Add $(top_builddir)/gir to the include path, like we do in Makefile.introspection. https://bugzilla.gnome.org/show_bug.cgi?id=630160
* Pass in blocks to IntrospectablePassJohan Dahlin2010-09-201-1/+1
|
* Add a parameter mismatch warningJohan Dahlin2010-09-141-0/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=629708
* [warningtester] Do not sort expected warningsJohan Dahlin2010-09-141-1/+1
| | | | Instead just take them in the order they are in the file
* [warningtester] Invert expected/actualJohan Dahlin2010-09-141-1/+1
| | | | It makes it a little less confusing reading the error messages
* [tests] Handle multiple errors per file betterJohan Dahlin2010-09-021-11/+12
|
* [tests] Rework tester to be executed once per testJohan Dahlin2010-09-021-23/+31
| | | | Instead of running all tests in the same instance
* [tests] Add test infrastructure for warningsJohan Dahlin2010-09-021-0/+104
Add an infrastructure for testing warnings, add two examples how to verify warnings