summaryrefslogtreecommitdiff
path: root/installed-tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'meson-test-dependencies-fix' into 'master'Philip Chimento2023-04-092-2/+7
|\ | | | | | | | | installed-tests/meson: Add tests dependencies on gjs console and GjsPrivate See merge request GNOME/gjs!835
| * installed-tests/meson: Add GjsPrivate as tests dependencyMarco Trevisan (Treviño)2023-04-052-2/+7
| | | | | | | | | | | | It's used by gjs internally, so add it as default tests dependencies. Without this `meson test` would fail without compiling before.
| * installed-tests/meson: Add tests dependencies on gjs consoleMarco Trevisan (Treviño)2023-04-051-2/+2
| | | | | | | | We require the console to run the tests so add it as dependencies.
* | stack: Print stack trace using glib logging functionsSebastian Keller2023-04-062-9/+3
|/ | | | | | | | | | | | | | | | When the gjs process is logging to the systemd journal directly via the glib logging functions, the stack trace would get logged indirectly via stderr. This however is not guaranteed to get added to the journal at the same time as the error messages logged via glib. This is especially noticeable when triggered from an endless loop or an idle callback. In some cases it even can result in the stack trace not getting logged at all. There is currently no public API in mozjs to dump a stack trace directly to a string from arbitrary threads, only to files, so this uses open_memstream() as a workaround. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1868
* fix(build, tests): move `have_gtk4` to the appropriate placeDominik Opyd2023-03-081-3/+7
|
* minijasmine: Remove irrelevant commentPhilip Chimento2023-03-041-1/+0
| | | | | Calling this matter of opinion "lame" annoys me and is not the kind of example I want to set in this codebase.
* minijasmine: Remove unused stack filter linePhilip Chimento2023-03-041-1/+0
| | | | | The tag `<jasmine-start>` is no longer used, this has moved into resource:///org/gjs/jsunit/minijasmine-executor.js
* repo: Check that GI module override function is callablePhilip Chimento2023-03-049-1/+71
| | | | | Previously, we would return the override function if it was null, or a non-callable object, and then try to call it. Add tests for this case.
* gi: Roll back change to imports.gi.versions object if gi.require() failsPhilip Chimento2023-03-041-0/+6
| | | | | If something like gi.require('GLib', '1.75') fails, then we don't want the faulty version number remaining on the imports.gi.versions object.
* function: Do not leak strings returned by transfer-none trampolinesMarco Trevisan (Treviño)2023-03-041-6/+6
| | | | | | | | | | | | | When a VFunc or a callback returns a transfer-none string we were breaking the introspection because it was causing a leak. Now, in case these strings are returned by vfunc's of an object, we can just safely associate them to the object using qdata, while in case we're handling a callback we can use GLib internal strings to hold these strings just once in memory. While this is technically still a waste we're leaking just once, so it shouldn't be a big deal. Closes: #519
* testGObjectValue: Enable creating object with a string propertyMarco Trevisan (Treviño)2023-02-241-2/+0
| | | | This required GNOME/gobject-introspection!268 but that's now merged.
* Gio: Add support for initializing a DBus Proxy via a promiseMarco Trevisan (Treviño)2023-02-201-0/+22
| | | | | | | | | Add a newAsync() static method to DBus proxy wrappers, that returns a promise that allows to initialize a proxy object asynchronously, keeping around all the wrappers as expected, and allowing to use nicer try/catch syntax. (Edited from Gio.makeProxyPromise to a static method by Philip)
* jasmine: Port jasmine executor to async mainloopEvan Welsh2023-02-207-53/+131
|
* signals: Simulate GObject's connect_after behavior on signalsMarco Trevisan (Treviño)2023-02-191-114/+150
| | | | | | | GObject signals have a connect_after function that we don't have in the gjs core signals, while it can be useful in some situations. So introduce it.
* CI: Put testGtk4.js in 'dbus' suitePhilip Chimento2023-02-191-25/+34
| | | | | | This is a temporary fix for GTK 4 trying to acquire a message bus on startup, until we figure out what magic environment variable will prevent that.
* function: Do not allow returning a transfer-none string from JS callbackPhilip Chimento2023-02-191-3/+4
| | | | | | | | | | | In order to marshal a string from JS into C, we have to create a temporary UTF-8 string. That string cannot be returned as transfer-none, because there is no obvious place to keep it alive so that it can live as long as the C code needs it to. See #519 for more explanation. This is currently "supported" but causes a memory leak. Instead, throw when creating a callback or vfunc in JS that would otherwise have this memory leak.
* tests: Fix test descriptionPhilip Chimento2023-02-191-1/+1
| | | | | This test is added twice, and was supposed to adapt its description each time.
* build: Use dependency get_variable() methodPhilip Chimento2023-02-191-1/+1
| | | | get_pkgconfig_variable() will be deprecated in a future Meson release.
* test: Relax assertion in cr.textExtents() againPhilip Chimento2023-02-191-2/+2
| | | | | | | These are two more values that seem to depend on what fonts you have installed. See: #461
* debugger: Support Symbol valuesPhilip Chimento2023-01-015-5/+11
| | | | | | | | | | | We get this for free already for Symbol primitive values and Symbol property keys and values, due to it being supported in the pretty-printer. For the 'keys' command, we need to start using Object.getOwnPropertySymbols() to get the Symbol property keys. While we are at it, switch from using Object.keys() which only gives enumerable string/number property keys, to Object.getOwnPropertyNames(), in order to be able to debug non-enumerable properties as well.
* print: Format Symbol property keysPhilip Chimento2023-01-011-0/+15
| | | | | Introduce a new property key formatter which formats a Symbol property key in brackets.
* print: Pretty-print formatting for SymbolsPhilip Chimento2023-01-011-0/+27
| | | | | | | This formats Symbols as the source text with which they should be able to be constructed. It makes a distinction between registered symbols (created with Symbol.for()), well-known symbols (always existing), and regular symbols (created with Symbol()).
* signals: Fix bugs when multiple handlers are connected and disconnect is calledEvan Welsh2022-11-301-0/+24
|
* cairo-surface: Add finish() and flush()tuberry2022-11-211-0/+14
| | | | closes #515
* arg-cache: Add support passing caller-allocated C-arraysMarco Trevisan (Treviño)2022-11-201-0/+16
| | | | | | | | When a function uses caller-allocated C-arrays are used, we can easily create such structures when we know the size of the array elements. GI tests at: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/370
* minijasmine: Add function override to print and free the errorMarco Trevisan (Treviño)2022-11-191-3/+10
|
* Merge branch '510-null-pointer-get-set-property' into 'master'Philip Chimento2022-11-191-0/+35
|\ | | | | | | | | | | | | gobject: Guard against null JS wrapper in set/get property Closes #510 See merge request GNOME/gjs!813
| * gobject: Guard against null JS wrapper in set/get propertyPhilip Chimento2022-11-141-0/+35
| | | | | | | | | | | | | | | | | | The wrapper object may be disassociated from the GObject if dispose has been run. In that case, the pointers in the get/set property vfuncs may be null. Handle that case with a warning and don't get or set the property. Closes: #510
* | signals: Use a Dict to associate connection IDs to objectsMarco Trevisan (Treviño)2022-11-161-1/+1
| | | | | | | | | | | | | | | | | | We often reference connection IDs, so now we can use a more optimized native way to handle connections without having to iterate them all the times. This could have been implemented using the newer Map() object, but sadly it's still way slower than using normal objects.
* | Merge branch '518-fix-gi-functions-as-signal-handlers' into 'master'Philip Chimento2022-11-162-3/+8
|\ \ | |/ |/| | | | | | | | | Fix using g-i introspected function as callback Closes #518 See merge request GNOME/gjs!809
| * Revert "closure: Store JSFunction* pointer instead of JSObject*"Philip Chimento2022-11-062-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is basically a revert of commit 7140cac8, although so much has changed in the meantime that none of the revert applied cleanly, so it's more of an "un-rewrite". This fixes a regression that has been present for almost exactly 4 years. Storing a JSFunction* pointer in closures did not take into account the fact that not all callable JSObjects have an associated JSFunction. They could be exotic objects with a [[Call]] method. In particular, introspected functions are this, so this prevented g-i function objects from being used as signal handlers. (Less importantly, the same probably applied to callable Proxy objects.) Also adds a regression test so that this doesn't happen again. Closes: #518
* | tests: Disable test with unsupported vfunc returning const charPhilip Chimento2022-11-141-2/+2
| | | | | | | | See https://gitlab.gnome.org/GNOME/gjs/-/issues/519
* | meson: Depend on g-i 1.71 and enable newly supported testsMarco Trevisan (Treviño)2022-11-143-20/+17
|/ | | | | | With a newer g-i we can enable more tests that were not running so far, so bump the dependency and enable the tests that were depending on MR's that landed already.
* testSignals: Ensure that disconnecting an already disconnected signal throwsMarco Trevisan (Treviño)2022-11-021-0/+3
|
* testConsole: Test that console.assert works as expectedMarco Trevisan (Treviño)2022-11-021-0/+23
|
* console: Pass CODE information to structured warning logsMarco Trevisan (Treviño)2022-11-021-0/+10
| | | | | In case the log is severe enough it's better to fill such information by default.
* console: Also use formatters for console.traceMarco Trevisan (Treviño)2022-11-021-0/+1
| | | | | | Just fetch the error trace at printer function so that we can just use this at lower level without requiring explicitly using the printer when using trace()
* console: Include CODE file, function and line in structured loggingMarco Trevisan (Treviño)2022-11-021-5/+17
| | | | | This is what GLib does all the times for C code, in JS we can easily do it as well as we have traces, for now do it only for console.trace().
* console: Write the whole stack trace when using console.trace()Marco Trevisan (Treviño)2022-11-021-2/+54
| | | | Also ensure this in a test
* Make GInputStream iterable and async iterableSonny Piers2022-11-021-0/+30
|
* Gio: allow D-Bus implementations to return pre-packed variantsAndy Holmes2022-11-021-0/+13
| | | | | | When a D-Bus implementation returns a value from a getter, check if it is variant matching the expected property signature. If it is, skip packing a new variant and just return the value.
* GObject: Handle versions of GLib without GBindingGroupPhilip Chimento2022-11-011-0/+4
| | | | | | We don't require GLib 2.72 for anything else, so it makes sense to conditionally define the override for GObject.BindingGroup.bind_full(). If GLib is too old then the override (and its tests) are skipped.
* maint: Fix ICon typoPhilip Chimento2022-10-291-4/+4
|
* maint: Fix eslint errorPhilip Chimento2022-10-291-1/+1
|
* Merge branch 'promisify-gdbus-async-init' into 'master'Philip Chimento2022-10-291-0/+78
|\ | | | | | | | | | | | | Gio: Promisify GDBusProxy.init_async by default Closes #494 See merge request GNOME/gjs!790
| * testGDBus: Ensure that proxy init failures are correctly thrownMarco Trevisan (Treviño)2022-08-101-0/+27
| |
| * Gio: Promisify GDBusProxy.init_async by defaultMarco Trevisan (Treviño)2022-08-101-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some code may promisify it after that it has been overridden, this means that when called we may not use the original method correctly as the function won't have the arguments set anymore and thus its length will be 0, causing the assumption included in commit 58840261 not to be true anymore. Since the function is already a wrapper, we can safely override it to be a promise and then override it again. Allowing code simplifications and being more future-proof, when all the async functions will be promises by default. Fixes: #494
* | GObject: Ensure that static methods are accessible from a subtypeMarco Trevisan (Treviño)2022-10-291-0/+10
|/ | | | It makes sense to be able to use a static method even from a subtype
* Gio: Add overrides for File.set_attribute and FileInfo.set_attributePhilip Chimento2022-08-081-0/+79
| | | | | | | | | These functions can crash if used from JS, because they take a raw pointer. Add an override that calls the appropriate type-safe method instead, on a best-effort basis; not all of these exist. In any case, the crashes should be prevented. Closes: #496
* Make GFileEnumerator iterable and async iterableSonny Piers2022-08-071-0/+30
|