summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Fix compatibility with Python 3.5Tomasz Miąsko2019-03-151-2/+2
| | | | | | | | Use call_count to verify the number of calls. This replaces assert_called_once used previously, which is only available since Python 3.6. Fixes issue #274.
* Drop autotools build systemChristoph Reiter2019-03-116-523/+0
|
* Revert "Restore original meaning of disguised attribute."Christoph Reiter2019-01-163-6/+12
| | | | | | This reverts commit f606183a010fbec4382acb728882cc0eddbaf7f7. See https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/9#note_409979
* maintransformer: Don't warn on (optional) annotations on (inout)Guido Günther2019-01-131-5/+5
| | | | This makes the scanner consistent with the docs.
* autotools: don't pass all the libregress cflags to the scanner. Fixes #226Christoph Reiter2019-01-121-1/+4
| | | | | | | | | | | | They contain things like -fvisibility=hidden which, in case of building with CFLAGS="-flto -O2" LDFLAGS="-Wl,--as-needed -flto", results in the linker throwing out unused symbols and not linking the dumper against libregress. This results in errors like: Invalid GType function: 'regress_test_enum_get_type' Failed to find symbol 'regress_test_enum_get_type' Fix this by only passing the required CFLAGS to the scanner instead.
* Restore original meaning of disguised attribute.Tomasz Miąsko2019-01-103-12/+6
| | | | | | | | | | | | | | | | > Certain types like GIConv and GdkAtom are pointers internally but don't > look like pointers when referenced. They have the form. > > typedef struct _X *X; > > Parse these as structures/records but mark them in the gir with a 'disguised' > attribute so that we know that they need special handling. Additionally, stop relaying on disguised attribute when deciding whether to render a page. Check number of fields instead, so as to avoid introducing large regression in the docs. Fixes #101.
* message: simplify handling of error levelsChristoph Reiter2019-01-103-10/+10
| | | | | | | | 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.
* maintransformer: parse deprecation annotations for section blocks. Fixes #213Christoph Reiter2019-01-093-1/+75
| | | | | | | | | | The scanner matches gtk-doc sections which match the lower case type name to the type and uses that for the type documentation. The only problem is it only takes the docs and none of the other annotations like deprecation info etc. This changes things to also parse the annotations in that case and adds some tests while at it.
* tests: Add functions using flat struct arraysTomasz Miąsko2019-01-0825-0/+1091
| | | | | | | | | | | | | | Relatively common in practice are: * output with transfer full, which is already covered by `regress_test_array_struct_out`, * input with transfer none, covered by a new `regress_test_array_struct_in_none` Other variants are quite esoteric, but it still might be useful to include them so that bindings can verify that they are handled gracefully, e.g., by reporting an error instead of crashing. Issue #90
* tests: add some tests for get_source_root_dirsChristoph Reiter2019-01-083-1/+33
| | | | | To make it easier to test make sure it always returns absolute paths. Also fix a typo, oops!
* scanner: Flatten multi-dimensional arrays fieldsTomasz Miąsko2019-01-073-0/+68
| | | | | | | | | | | | | Provide partial support for multi-dimensional arrays by representing them as flattened one dimensional array with size that is equal to product of sizes in each dimension. Previously only the first dimension would be actually used. This should be sufficient to ensure that those fields have layout compatible with C, without using nested array types that are currently unsupported by vapigen Issue #255.
* scanner: Remove incorrect c:type generated for array of synthesized unionsTomasz Miąsko2019-01-061-1/+1
| | | | | | | | This also reverts workaround introduced to support this use case in f77cfc4275b1fba4f9fedea6e40b00e0ebbe142c, since it is no longer necessary. Fixes issue #141.
* scanner: Remove incorrect c:type from fields with array typeTomasz Miąsko2019-01-062-14/+10
| | | | | | | | | | Neither `_create_source_type` nor `_create_complete_source_type` actually support fixed size arrays, so previously generated C types were incorrect. Remove C types from array fields instead of producing incorrect ones. Fixes issue #145.
* meson: warn that not all tests will be run if building without cairo/doctoolChristoph Reiter2019-01-061-1/+1
|
* scanner: Merge specifiers and qualifiers when merging basic types.Tomasz Miąsko2019-01-051-1/+1
|
* scanner: Merge basic types in `specifier_qualifier_list` production.Tomasz Miąsko2019-01-058-185/+246
| | | | | | | | | | | This is necessary to parse types like `unsigned char` or `long double`, and is already done when parsing `declarations_specifiers`. Examples that are fixed by this change include: * `GLib.TestLogMsg.nums` previously parsed as `long` but should be `long double`. * `GMime.Encoding.uubuf` previously parsed as `unsigned` but should be `unsigned char`.
* autotools: dist test_docwriter.pyChristoph Reiter2019-01-041-1/+2
|
* meson: port doctool testsChristoph Reiter2019-01-031-0/+58
|
* tests: try building Bar-1.0 againChristoph Reiter2019-01-021-1/+36
| | | | This time pass the libgirepository build dir
* gimarshallingtests: Remove declarations of nonexistent functionsPhilip Chimento2019-01-011-8/+0
| | | | | | | These functions were removed a long time ago in commit af7be95a. Being present in the header file means they are present in the generated GIR file, but trying to resolve them with dlsym will fail and crash the program.
* meson: port more typelib testsChristoph Reiter2019-01-013-30/+138
|
* meson: make test_offsets.py work on WindowsChristoph Reiter2019-01-011-6/+7
| | | | | meson doesn't set PATH for the test dependencies so we have to do it manually. Also make sure the test depends on the test binary.
* gitestoffsets: use g_fprintf and fix the format specifier for the struct offsetChristoph Reiter2019-01-011-19/+20
| | | | | | | G_GSIZE_FORMAT should only be used with glib functions and G_STRUCT_OFFSET() returns glong not gsize. This fixes various compiler warnings on Windows.
* tests: add the utility dep to the right targetChristoph Reiter2019-01-011-2/+2
| | | | I added it to the wrong one in d2bd6390ed8, oops..
* tests: revert building Bar-1.0.girChristoph Reiter2019-01-011-26/+1
| | | | | It broke continuous https://build.gnome.org/continuous/buildmaster/builds/2019/01/01/0/build/log-gobject-introspection.txt
* meson: port more gir testsChristoph Reiter2019-01-011-0/+92
|
* meson: fix missing regress dependency on the utility gir.Christoph Reiter2018-12-311-2/+3
|
* meson: build libregress with cairo supportChristoph Reiter2018-12-311-7/+25
| | | | | The cairo dependency fallback code is copied from pygobject. I assume that will work for msvc users (cairo is disabled by default anyway)
* meson: port some .gir testsChristoph Reiter2018-12-311-0/+271
|
* customize_compiler: also replace the linker command if CC is setChristoph Reiter2018-12-301-0/+5
| | | | | | | | Otherwise when you set CC=clang then distuils will still use gcc for linking. While it seems we don't invoke the link command atm this shouldn't hurt. The upstream customize_compiler() does the same thing on macOS and there is a bug for enabling it everywhere: https://bugs.python.org/issue24935
* tests: Use macros to print field offsetsTomasz Miąsko2018-12-291-60/+63
|
* tests: Drop separate functions for offsets testsTomasz Miąsko2018-12-291-56/+11
|
* tests: Use macro to determine alignmentTomasz Miąsko2018-12-291-49/+9
|
* ccompiler: don't use Python compiler flags. Fixes #150Christoph Reiter2018-12-291-2/+0
| | | | | | | Only use flags provided by env vars from the user and never from the Python sysconfig. The sysconfig values depend on the way Python was built, might conflict when using g-i with a different compiler and can't be controlled by the g-i user.
* Test commands executed by unix C compiler.Tomasz Miąsko2018-12-293-0/+217
| | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes intended. Tests check that: * Compiler is obtained from CC. * cc is used as the default compiler. Currently not true as a Python build time compiler is used as the default. * Preprocessor is obtained from CC when CPP is unspecified by adding -E. * Preprocessor is obtained from CPP. * cpp is used as the default preprocessor. Currently not true as Python build time preprocessor is used as the default. * Shell word splitting rules are used to split CC. * Shell word splitting rules are used to split CPP. * Deprecation warnings are disabled during compilation. * Preprocessing step includes CPPFLAGS. * Compilation step includes both CFLAGS and CPPFLAGS, in that order. * Macros from CFLAGS are defined only once. Currently not true as they are defined twice. * Flags that would retain macros after preprocessing step are filtered out. Currently only partially true as they aren't filtered out from CPPFLAGS. * Preprocessing step includes flag that preserves comments. * Preprocessing step includes current working directory. * Complete preprocessing command doesn't contain anything unexpected. Currently not true as Python build time CPPFLAGS are included as well. * Complete build command doesn't contain anything unexpected. Currently not true as Python build time CFLAGS and CPPFLAGS are included as well.
* tests: Remove temporary files created when testing transformerTomasz Miąsko2018-12-221-4/+7
|
* scanner: make using bool without stdbool include work again. Fixes #247Christoph Reiter2018-12-211-0/+5
| | | | | | | | | With !45 special casing of bool in the lexer was removed which previously allowed the usage of bool without including stdbool.h. This breaks scanning of graphene headers which guarded the stdbool include with __GI_SCANNER__ (I haven't figured out why). Add back the special handling for bool in the lexer and also map it to gboolean like _Bool as if stdbool.h was included.
* tests: make scanner tests work with msvc + subprojectsChristoph Reiter2018-12-204-28/+44
| | | | | | | | 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.
* tests: Introspect list of fields in offsets testTomasz Miąsko2018-12-191-185/+31
|
* tests: Drop autogeneration of offsets testsTomasz Miąsko2018-12-194-264/+430
| | | | | | | | Generating offsets test makes them quite hard to understand. The fact that they parse C code with custom regular expressions don't help either. Replace offsets test with their generated form.
* build: extend PYTHONPATH instead of replacing it. Fixes #126Christoph Reiter2018-12-191-1/+2
| | | | So we don't ignore any PYTHONPATH set by the user.
* meson: add default compiler warning flags and enable -Werror on CIChristoph Reiter2018-12-182-3/+14
| | | | | | | | This enables various compiler warnings project wide and disables the triggered ones for each library/executable. This should give us roughly the same behaviour as with autotools. Tested with gcc8 and clang7.
* meson: install everything.c/h like with autotoolsChristoph Reiter2018-12-171-2/+6
| | | | | | This requires a code change in codegen.py to support the case whre output files are not installed in the working directory. Instead of using the output path for the header include use the relative path to the output source file.
* meson: install various test sources to match what autotools doesChristoph Reiter2018-12-171-0/+8
| | | | Not sure if they are used, but we should try to do the same thing as autotools for starters
* meson: build/install mdextensions.py; and add a simple testChristoph Reiter2018-12-172-0/+16
| | | | | Add a simple test using the docwriter so we trigger the docwriter related Python imports.
* autotools: dist newly added meson build filesChristoph Reiter2018-12-163-2/+5
|
* girepository: Add version macros and functions. Fixes #200Christoph Reiter2018-12-163-6/+6
| | | | | | | | | | | This adds the following macros and functions: GI_MAJOR_VERSION, GI_MICRO_VERSION, GI_MINOR_VERSION, GI_CHECK_VERSION, gi_get_major_version,gi_get_micro_version, gi_get_minor_version. Since we share a prefix with glib we have to namespace these by using the gi_ prefix. g_gi would also work but we already export symbols with gi_ like gi_cclosure_marshal_generic(), gi_type_tag_get_ffi_type() and gi_type_info_extract_ffi_return_value(), so let's not add another naming scheme.
* baseinfo: don't abort when calling g_base_info_get_name() on a GITypeInfo. ↵Christoph Reiter2018-12-151-0/+25
| | | | | | | | | | Fixes #96 GITypeInfo is a GIBaseInfo so calling g_base_info_get_name() on it should do something sensible. g_base_info_get_name() has always been documented to return NULL in case no name is available so return that instead.
* meson: Don't install test typelibsTomasz Miąsko2018-12-101-2/+0
|
* meson: Port offsets testsTomasz Miąsko2018-12-102-0/+80
|