summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* sourcescanner: Allow empty declarations. Fixes #216Christoph Reiter2018-12-091-0/+6
| | | | | As far as I see these are not valid C and only allowed in C++11. But they do occur in the wild (mingw headers) so let's try to handle them.
* Ignore __pragma keyword used by MSVCTomasz Miąsko2018-12-081-0/+13
|
* Merge branch 'drop-py-compat-code' into 'master'Christoph Reiter2018-12-088-61/+6
|\ | | | | | | | | Drop all Python 2 compat code See merge request GNOME/gobject-introspection!85
| * Drop all Python 2 compat codeChristoph Reiter2018-12-088-61/+6
| | | | | | | | We only support 3.4+ now.
* | sourcescanner: collect error messages and expose themChristoph Reiter2018-12-081-19/+42
|/ | | | | | | | | | | It just printed errors to stderr and always returns success even if parsing fails. This prevents us to write any tests for it. As a first step collect all lexing/parsing error messages and print them to stderr after the scanner is done. This allows us to add some regression tests for !78. In the future we probably want to raise an exception with those errors if parsing fails.
* writer: Include documentation and symbol position in source filesThibault Saunier2018-11-2811-378/+1625
| | | | | | | | | | | Some documentation tool (as hotdoc[0]) need to have information about symbol declaration and documentation positions in the source files to be able to do smart indexing (automatically build the documenation index). [0] https://hotdoc.github.io/ Fixes #175
* Define grefcount and gatomicrefcount as aliases to gintTomasz Miąsko2018-11-2311-0/+226
|
* regress: Implement interface and override propertiesPhilip Chimento2018-11-0711-8/+163
| | | | | | | | This adds a property to RegressTestInterface which can be overridden, and makes RegressTestSubObj implement it and override the property. This is in order to catch the regressions in GJS around property access. See gjs#193.
* Merge branch 'test-write-only-property' into 'master'Philip Chimento2018-10-236-1/+66
|\ | | | | | | | | regress: Add test for write-only property See merge request GNOME/gobject-introspection!67
| * regress: Add test for write-only propertyPhilip Chimento2018-10-226-1/+66
| | | | | | | | | | | | | | GTK contains a few write-only properties, so it makes sense to have one in the regress test suite. See gjs!246
* | 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>
* meson: Install warnlibJan Tojnar2018-09-071-0/+2
| | | | | | | For some reason, meson build system did not install warnlib. Let's do it. Patch from Arch Linux
* build: Fix a meson build file missing in the tarball. Fixes #223Christoph Reiter2018-08-171-0/+1
| | | | | tests/scanner/meson.build was missing leading to: tests/meson.build:20:0: ERROR: Non-existent build file 'tests/scanner/meson.build'
* tests: depend on flake8 instead of including pep8/pyflakesChristoph Reiter2018-08-153-8/+2
| | | | | | | | | | | | | | | | 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.
* regress: implement the getter/setter for the new byte-array property.Christoph Reiter2018-08-115-0/+42
| | | | | It was added as part of !25 but without any implementation. This made instantiating TestObject fail which we do in the pygobject test suite.
* build: enable -Wredundant-declsChristoph Reiter2018-07-291-1/+0
| | | | | The ffi decls were added in cbdd9ee09e367e4dd to work around broken ffi headers. Let's assume this is fixed now.
* build: enable -Wcast-function-typeChristoph Reiter2018-07-292-3/+15
| | | | | | | | Where it's easy add dummy args to match the cast; where the target is a subset just prevent the warning with a cast to void*. Provide a real copy function for the boxed type code in regress_foo. This code is never executed afaics, but why not.
* build: enable -Wincompatible-pointer-typesChristoph Reiter2018-07-291-1/+1
|
* build: enable -Wdiscarded-qualifiersChristoph Reiter2018-07-291-1/+1
| | | | | Except for the Python module because nothing in the CPython API is marked const and we'd have to cast everywhere.
* autotools: start using AX_COMPILER_FLAGS, enable -Werror on CIChristoph Reiter2018-07-294-8/+15
| | | | | | | | | * This adds a new dependency on autoconf-archive. * Pass WARN_CFLAGS/WARN_LDFLAGS/WARN_SCANNERFLAGS to everything we control the source of * Disables all warning flags which make the build error out for now, we'll re-enable them in followup commits. * AX_COMPILER_FLAGS is used with the release flag always on so we don't get -Werror by default.
* gimarshallingtests: Fix g_boxed_free usagePhilip Chimento2018-07-281-1/+5
| | | | | | | I made this edit to Simon's commit to resolve a merge conflict, but I messed it up. Revert to what it was before. See #113.
* Factor out pkg-config functionality to a separate module.Tomasz Miąsko2018-07-283-0/+120
| | | | | | | | | | | | | | Functional changes: * Consistently check that return code from pkg-config is zero. * Use shell word splitting rules to process pkg-config output to match behaviour obtained by running `cc program.cc $(pkg-config --cflags ...)`. Fixes issue #171 . * Use user preferred encoding to process output from pkg-config on Python 3. Python 2 behaviour defaults to using ascii encoding as before. edit creiter: still ignore pkg-config errors by default for now as we depend on it when glib is a subproject.
* gimarshallingtests: Don't leak properties in destructionSimon Feltman2018-07-271-9/+6
| | | | | | | | | Clear strv, boxed_struct, variant, boxed_glist, and object properties during destruction. This fixes trivial memory leaks found in the PyGObject tests suite. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
* regress: Don't leak in property setter and destructorSimon Feltman2018-07-271-0/+10
| | | | | | | | | | | Clear the string property of RegressTestObj prior to setting within the property setter. Make sure the linked list, hash table, and string properties are cleared during destruction. This fixes trivial memory leaks found with the PyGObject test suite. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
* regress: Use g_list_free_full and g_list_copy_deepSimon Feltman2018-07-271-9/+3
| | | | | | | | Cleanup which replaces manual loop implementation with API calls when setting the linked list property. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
* tests: add .exe extension when calling the offset test binaryChristoph Reiter2018-07-271-1/+2
| | | | autotools is picky on Windows and errors out otherwise
* xmlwriter: move collect_attributes() back to a Python implementationChristoph Reiter2018-07-271-2/+11
| | | | | | | | | This reverts f345916405d94829696985 and related. The commit states that both versions are about the same in performance, but the C version is more code and harder to maintain. It also states that the behaviour re invalid control characters is better with the C version which produces entities. But those make any Python xml parser fail, which given that most of our tooling is Python, doesn't seem better to me, see #135.
* tests: add some basic tests for collect_attributes() and build_xml_tag()Christoph Reiter2018-07-271-1/+57
|
* tests: run xmlwriter tests during make checkChristoph Reiter2018-07-273-1/+32
| | | | | There was a stray test() function already there. Move it to a unittest file and run it with the other tests.
* Merge branch 'tests-transformer-win32' into 'master'Christoph Reiter2018-07-272-20/+29
|\ | | | | | | | | transformer: don't shell out for filter commands and make the tests work on Windows See merge request GNOME/gobject-introspection!54
| * transformer: don't shell out for filter commands and make the tests work on ↵Christoph Reiter2018-07-252-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Windows Instead of passing the filter commands to the shell, split them with the shlex module. This gives us more control and a more similar behaviour on unix/win32 systems. I could only find two users in Debian which just call python with some script, so this seems safe to me. Adjust the tests accordingly and use the running python executable to test the functionality as we can be sure that's available on all platforms. Also add a new test for the symbol filter commadn which wasn't tested before.
* | tests: port offset tests to PythonChristoph Reiter2018-07-262-5/+52
|/ | | | | | | Use the test executable to generate files in a temporary location and use difflib to compare their content. This removes the requirement on "diff" for the test.
* tests: Fix function incompatibilityFlorian Müllner2018-07-231-3/+3
| | | | | | | | | | | | | | Casting a function type to a type with more parameters is invalid and triggers a warning on some compilers: installed-tests/gimarshallingtests.c: In function ‘gi_marshalling_tests_interface_get_type’: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type] Add those additional parameters to shut up the warnings. https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/53
* ci: add a msvc jobChristoph Reiter2018-07-221-1/+5
|
* gi-tester: Port to PythonChristoph Reiter2018-07-224-63/+124
| | | | | | 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.
* Fix scanner tests for new functions added with !32Christoph Reiter2018-07-2213-0/+399
| | | | These tests only get run with autotools atm
* meson: Add a "python" option to make the python to build against configurableChristoph Reiter2018-07-112-2/+2
| | | | | | | | 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.
* meson: skip test_transformer on Windows for nowChristoph Reiter2018-07-111-1/+5
|
* Avoid accidental library name matches when parsing ldd output.Tomasz Miąsko2018-07-113-0/+104
| | | | | | | | | | * Use a single pattern that matches against potentially complete paths. * Extract filename only afterwards on platforms where it is necessary. * Match patterns against complete words in ldd output instead of searching for them inside the lines - this avoids unintentional matches without complexity of negative lookbehinds and negative lookaheads. Fixes issue #208.
* meson: Run Python unit tests.Tomasz Miąsko2018-07-113-6/+14
|
* 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.
* Merge branch 'meson-warn-tests' into 'master'Christoph Reiter2018-06-234-2/+48
|\ | | | | | | | | meson: Add the giscanner warning tests See merge request GNOME/gobject-introspection!40
| * meson: Add the giscanner warning testsChristoph Reiter2018-06-214-2/+48
| | | | | | | | I couldn't get it to work on Windows, so skip that for now.
* | autotools: dist all meson filesChristoph Reiter2018-06-211-1/+2
|/
* gimarshallingtests: Add test readonly propertyPhilip Chimento2018-06-201-0/+11
| | | | | As far as I can tell there isn't one of these yet. It's a readonly int property whose value is always 42.
* regress: Avoid double-promotion warningPhilip Chimento2018-06-201-1/+1
| | | | | Float literal is silently promoted to a double here. Change it to a double literal.
* regress: Add test with signal inout parameterPhilip Chimento2018-06-203-0/+69
| | | | | | | This is modeled after GtkEditable::insert-text which isn't marshalled properly in GJS. See gjs#147.
* regress: Add test for interface signalPhilip Chimento2018-06-203-0/+52
| | | | | | | It includes a pointer parameter; for some reason, the pointer parameter breaks g_object_info_find_signal() but a parameter-less signal doesn't. See gjs#147.
* Preserve complete C type when applying array annotations.Tomasz Miąsko2018-06-202-7/+7
|