summaryrefslogtreecommitdiff
path: root/tests/repository
Commit message (Collapse)AuthorAgeFilesLines
* Meson: Fix build as subprojectXavier Claessens2020-05-061-5/+5
| | | | | meson.build_root() is the root of the main project, better use meson.current_build_dir() instead.
* gitypelibtest: make tests fail if the library can't be foundChristoph Reiter2019-10-191-1/+3
| | | | | | | | Check that g_object_info_get_ref_function_pointer() actually returns something, which it doesn't if the shared lib isn't found. In case a shared lib isn't found g-i will emit a warning, so also make sure we fail on warnings to avoid similar problems in the future.
* tests: Actually test libregress by specifying the LD_LIBRARY_PATHCorentin Noël2019-10-191-0/+4
|
* girepository: Return pointer array for interface cachePhilip Chimento2019-06-201-0/+24
| | | | | | | | | | | | | In g_irepository_get_object_gtype_interfaces(), returning the address of the first GIBaseInfo* does not work reliably, because the GIBaseInfos are not necessarily stored contiguously. So the second and subsequent ones might be garbage. Instead, return the address of the array of GIBaseInfo pointers. Add a test that verifies the functionality, as well. This is unfortunately an API and ABI break.
* Drop autotools build systemChristoph Reiter2019-03-111-30/+0
|
* meson: port more typelib testsChristoph Reiter2019-01-011-19/+25
|
* meson: add default compiler warning flags and enable -Werror on CIChristoph Reiter2018-12-181-1/+6
| | | | | | | | 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.
* autotools: dist newly added meson build filesChristoph Reiter2018-12-161-0/+1
|
* girepository: Add version macros and functions. Fixes #200Christoph Reiter2018-12-161-4/+4
| | | | | | | | | | | 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: Port repository testsTomasz Miąsko2018-12-101-0/+22
|
* autotools: start using AX_COMPILER_FLAGS, enable -Werror on CIChristoph Reiter2018-07-291-2/+2
| | | | | | | | | * 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.
* removing $(srcdir) because it is not replaced correctly and not necessaryKarl-Philipp Richter2018-02-081-4/+4
| | | | See #120.
* Revert "removing $(srcdir) because it is not replaced correctly and not ↵Emmanuele Bassi2017-05-041-4/+4
| | | | | | | | necessary" This reverts commit 17ef691e9b3ebd475b01d1e623d3df7b1f534dfa. This breaks builddir != srcdir builds, like GNOME Continuous.
* removing $(srcdir) because it is not replaced correctly and not necessaryKarl-Philipp Richter2017-05-041-4/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=744021
* tests: don't add $(top_srcdir)/gir to XDG_DATA_DIRSDieter Verfaillie2015-06-241-1/+0
| | | | | | | | Adding "$(top_srcdir)/gir" to XDG_DATA_DIRS is pointless as scanner/transformer.py actually goes looking for "$(top_srcdir)/gir/gir-1.0", which doesn't exist. https://bugzilla.gnome.org/show_bug.cgi?id=745636
* girepository: Support GError exceptions on callbacksGarrett Regier2015-06-211-0/+81
| | | | | | | | | | | Generalize "throws" attribute to SignatureBlob which can be used by all callable blob types. Keep FunctionBlob and VFuncBlob throw attributes around and functional for compatibility. Refactor girwriter.c to write out throws attribute for all callable types. Based on a patch by Simon Feltman. https://bugzilla.gnome.org/show_bug.cgi?id=729543
* tests: Convert gitestthrows to use GTest frameworkGarrett Regier2015-06-211-6/+12
| | | | Based on a patch by Simon Feltman.
* girepository: Add g_struct_info_find_field()Garrett Regier2015-06-212-2/+64
| | | | | | | | | | | Add find_field utility function for finding a field info by name. Beyond convenience, this should be faster than manually using the get_n_fields and get_field functions because get_field does an additional iteration for each field to calculate offsets O(n^2). Thus find_field combines the offset and comparison computations into a single loop O(n). Based on a patch by Simon Feltman.
* Makefile.introspection: pass CC to scannerDieter Verfaillie2015-04-181-4/+5
| | | | | | Extends commit 92d9c38 to also pass CC to g-ir-scanner. https://bugzilla.gnome.org/show_bug.cgi?id=700066
* tests/repository: Drop Unneeded IncludesChun-wei Fan2014-08-133-3/+0
| | | | | | | unistd.h is not universally available, and dropping that include did not seem to cause any warnings or errors, and did not affect the tests running. https://bugzilla.gnome.org/show_bug.cgi?id=734640
* Parse and expose ownership transfer for instance parametersGiovanni Campagna2014-07-031-0/+29
| | | | | | | | | | | 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
* tests: Use EXTRA_LTLIBRARIES instead of check_LTLIBRARIESSimon Feltman2013-12-291-1/+2
| | | | | | | | Update tests/Makefile.am and tests/scanner/Makefile.am to use EXTRA_LTLIBRARIES which minimizes the building of libraries to only dependencies of specific tests when using: make check TESTS="..." https://bugzilla.gnome.org/show_bug.cgi?id=720713
* Reformat code to GNU styleMartin Pitt2013-02-271-216/+218
| | | | | This was achieved by running "indent -gnu -i2 -nut -l120" over C files which use a different style, and manually fixing pointer declarations and modelines.
* Add test case for signal with a C array and length argumentMartin Pitt2013-02-271-0/+43
| | | | By-product of https://bugzilla.gnome.org/show_bug.cgi?id=662241.
* girepository: gchar is a signed typeMartin Pitt2013-01-111-0/+55
| | | | | | | gchar is signed, not unsigned. Add "guchar" alias as unsigned for completeness (but usually it appears as guint8). https://bugzilla.gnome.org/show_bug.cgi?id=691524
* tests: work around make check warningDieter Verfaillie2012-10-311-2/+5
| | | | | | | | | | The tests in tests/repository/ depend on libregress.so from tests/scanner which cannot be loaded during make check. Fixing this properly would require migrating to non-recursive automake for the tests, but for now we can just work around and set LD_LIBRARY_PATH (for linux) and PATH (for win32). http://bugzilla.gnome.org/show_bug.cgi?id=675049
* Drop calls to g_type_init()Colin Walters2012-10-163-6/+0
| | | | And bump our GLib requirement.
* girepository: avoid crash when querying nonexistent infoPavel Holejsovsky2012-05-121-0/+11
| | | | | | | | | It appears that cmph library can return (n+1) when querying item not present in its original n-item-sized set. Adjust code so that it detects this condition and do not chase stray pointers resulting from this bogus(?) hash result. https://bugzilla.gnome.org/show_bug.cgi?id=675939
* Avoid _get_func() consuming reference from input infoPavel Holejsovsky2012-04-071-0/+13
| | | | | | | | | | | | Fix of leak in 4c9424e18d71237f438a99bc5f2d45ae7de60b78 was a bit overaggressive, stealing also one reference from input 'info' argument. Also fixes another bug in that commit - local 'func' shadowing the return value, causing that function always returned NULL even when some result was actually found. https://bugzilla.gnome.org/show_bug.cgi?id=673282
* Revert "gitypelibtest: Remove test on TestStructE size"Colin Walters2011-10-031-0/+13
| | | | | | | | This reverts commit e17c09749c23edbd928db19a8162484ddb6299b8. We actually want the test for sizeof(GValue). https://bugzilla.gnome.org/show_bug.cgi?id=660338
* gitypelibtest: Remove test on TestStructE sizeColin Walters2011-09-301-27/+0
| | | | | | | It's redundant since we're already checking that it's equal to GValue, and a problem is that padding may break exact assertions on the size. https://bugzilla.gnome.org/show_bug.cgi?id=660338
* Bug 660338: Account for padding in struct size checkMartin Pitt2011-09-291-3/+4
| | | | | | | On some platform like armel or powerpc the compiler adds extra padding to structs. Make the test_size_of_struct_with_array_of_anon_unions() check more liberal by only requiring that the size of the struct is at least as big as expected. Also use g_assert_cmpuint() to make it easier to see the actual diff.
* repository: Fix g_irepository_get_c_prefix()Colin Walters2011-09-211-0/+5
| | | | | | It was returning the wrong data. https://bugzilla.gnome.org/show_bug.cgi?id=659749
* tests: Add gir/ to toplevel typelib pathColin Walters2011-09-131-1/+1
| | | | Fixes the test when running uninstalled.
* Fix g_type_info_is_pointer() for overriden types of arguments.Pavel Holejsovsky2011-09-121-0/+39
| | | | | | | | | Algorithm which detects whether argument type is pointer checks for trailing '*' characters in c:type .gir elements. This failed if ctype is either 'gpointer' or 'gconstpointer'. Add specific check for gpointer/gconstpointer types when deducing pointerness of the type. https://bugzilla.gnome.org/show_bug.cgi?id=658848
* scanner: correctly handle structs with arrays of anon unionsTorsten Schönfeld2011-09-112-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies mainly to GValue, which is defined as: struct _GValue { /*< private >*/ GType g_type; /* public for GTypeValueTable methods */ union { gint v_int; guint v_uint; glong v_long; gulong v_ulong; gint64 v_int64; guint64 v_uint64; gfloat v_float; gdouble v_double; gpointer v_pointer; } data[2]; }; Previously, the scanner did not understand the array of unions. This resulted in g_struct_info_get_size returning an incorrect size for GValue (at least on 32bit systems). Fix this by making up a separate union declaration for the GIR that can be referenced by the array. https://bugzilla.gnome.org/show_bug.cgi?id=657040
* scanner: Add "notify" signal to GObjectColin Walters2011-09-091-0/+9
| | | | | For gjs we want to switch to using introspection data for signals, and the "notify" signal being missing from GObject was a problem.
* tests: build tests only on make checkAlexandre Rostovtsev2011-08-231-1/+1
| | | | | | | | | | | | Use automake's check_ prefix and avoid putting anything nontrivial in BUILT_SOURCES so that tests are build only on make check. The dummy -rpath in AM_LDFLAGS in tests/scanner/Makefile.am is needed to force libtool to build shared libraries for check_LTLIBRARIESS targets (automake builds check_LTLIBRARIES as static by default); see http://lists.gnu.org/archive/html/automake/2005-10/msg00107.html https://bugzilla.gnome.org/show_bug.cgi?id=657066
* Allow enums and bitfields to have static methodsTorsten Schönfeld2011-08-161-2/+55
| | | | | | | | | | | | | This uses the same backcompat machinery that was introduced for static methods for non-class types, so this change does not break users of the existing presentations. New libgirepository API: g_enum_info_get_n_methods g_enum_info_get_method https://bugzilla.gnome.org/show_bug.cgi?id=656499
* Add g_irepository_find_by_error_domain()Dan Winship2011-08-121-0/+9
| | | | | | | | Add a method to look up a GIEnumInfo given its associated error quark. Based on a patch from Colin Walters. https://bugzilla.gnome.org/show_bug.cgi?id=602516
* Add "c:identifier" attribute to GIrNodeValue (for flags and enum values).GOBJECT_INTROSPECTION_0_10_3Laszlo Pandy2011-02-232-3/+77
| | | | | | | | | | | | | | | Flags and enums with a GType have a value_nick and value_name strings available in the class struct. But for flags and enums without GType, we need to get this information from introspection. g_base_info_get_name() gives the string for value_nick. In the GIR, the attribute "c:identifier" is the string neede for value_name. This patch adds the "c:identifier" from GIR to the typelib for all flags and enum values. It can be retireved using g_base_info_get_attribute(info, "c:identifier"). https://bugzilla.gnome.org/show_bug.cgi?id=642757
* Fix tests to look in correct directory for typelibsColin Walters2010-11-163-11/+1
| | | | With nonrecursive they're in $(top_builddir) now
* tests: Print an error messageColin Walters2010-11-161-2/+2
|
* Add g_object_info_find_signalColin Walters2010-11-121-0/+7
| | | | | | | This matches g_object_info_find_method, and allows us to add indexing later. https://bugzilla.gnome.org/show_bug.cgi?id=633204
* Switch to nonrecursive make for core (i.e. not tests/)Colin Walters2010-11-091-3/+3
| | | | | This is cleaner and faster, and prepares us better for an incoming import of CMPH.
* [GIRepository] Rename GTypelib to GITypelibJohan Dahlin2010-08-312-2/+2
| | | | | Keep a typedef for backwards compatibility, until the major bindings has moved over.
* [GIRepository] Rename GArgument to GIArgumentJohan Dahlin2010-08-311-2/+2
| | | | | Keep a typedef for backwards compatibility, until the major bindings has moved over.
* Bug 557383 - Virtual method supportColin Walters2009-03-052-2/+50
| | | | | | | | | | | | | | | | Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-251-0/+3
| | | | | | | | Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.