2017-05-25 00:16:27 +00:00
|
|
|
testconf = configuration_data()
|
|
|
|
testconf.set('MUTTER_TYPELIB_DIR', mutter_typelibdir)
|
|
|
|
testconf.set('srcdir', meson.current_source_dir())
|
2017-08-19 08:43:38 +00:00
|
|
|
run_test = configure_file(
|
2017-05-25 00:16:27 +00:00
|
|
|
input: 'run-test.sh.in',
|
|
|
|
output: 'run-test.sh',
|
|
|
|
configuration: testconf
|
|
|
|
)
|
2017-08-19 08:43:38 +00:00
|
|
|
|
2022-08-16 11:04:27 +00:00
|
|
|
mutter_tests_datadir = mutter_test_dep.get_variable('tests_datadir')
|
|
|
|
dbusrunnerconf = configuration_data()
|
|
|
|
dbusrunnerconf.set('MUTTER_TEST_PKGDATADIR', mutter_tests_datadir)
|
|
|
|
dbusrunnerconf.set('SRCDIR', meson.current_source_dir())
|
|
|
|
|
|
|
|
dbus_runner = configure_file(
|
|
|
|
input: 'gnome-shell-dbus-runner.py.in',
|
|
|
|
output: 'gnome-shell-dbus-runner.py',
|
|
|
|
configuration: dbusrunnerconf,
|
|
|
|
)
|
|
|
|
|
2021-11-17 02:05:05 +00:00
|
|
|
tests = [
|
|
|
|
'highlighter',
|
|
|
|
'insertSorted',
|
|
|
|
'jsParse',
|
|
|
|
'markup',
|
|
|
|
'params',
|
signalTracker: Provide monkey-patching for (dis)connectObject()
The module exports a `addObjectSignalMethods()` method that extends
the provided prototype with `connectObject()` and `disconnectObject()`
methods.
In its simplest form, `connectObject()` looks like the regular
`connect()` method, except for an additional parameter:
```js
this._button.connectObject('clicked',
() => this._onButtonClicked(), this);
```
The additional object can be used to disconnect all handlers on the
instance that were connected with that object, similar to
`g_signal_handlers_disconnect_by_data()` (which cannot be used
from introspection).
For objects that are subclasses of Clutter.Actor, that will happen
automatically when the actor is destroyed, similar to
`g_signal_connect_object()`.
Finally, `connectObject()` allows to conveniently connect multiple
signals at once, similar to `g_object_connect()`:
```js
this._toggleButton.connect(
'clicked', () => this._onClicked(),
'notify::checked', () => this._onChecked(), this);
```
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1953>
2021-08-15 22:01:40 +00:00
|
|
|
'signalTracker',
|
2021-11-17 02:05:05 +00:00
|
|
|
'url',
|
|
|
|
'versionCompare',
|
|
|
|
]
|
|
|
|
|
|
|
|
foreach test : tests
|
2017-08-19 08:43:38 +00:00
|
|
|
test(test, run_test,
|
|
|
|
args: 'unit/@0@.js'.format(test),
|
|
|
|
workdir: meson.current_source_dir())
|
|
|
|
endforeach
|
2022-08-17 14:43:13 +00:00
|
|
|
|
2023-06-27 18:22:28 +00:00
|
|
|
shell_tests = [
|
2023-02-02 15:28:06 +00:00
|
|
|
{
|
|
|
|
'name': 'basic',
|
|
|
|
},
|
2023-03-24 09:22:41 +00:00
|
|
|
{
|
|
|
|
'name': 'closeWithActiveWindows',
|
|
|
|
},
|
2023-02-02 15:28:06 +00:00
|
|
|
{
|
|
|
|
'name': 'headlessStart',
|
|
|
|
'options': ['--hotplug'],
|
|
|
|
},
|
2022-08-17 14:43:13 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
gvc_typelib_path = fs.parent(libgvc.get_variable('libgvc_gir')[1].full_path())
|
|
|
|
libgvc_path = fs.parent(libgvc.get_variable('libgvc').full_path())
|
|
|
|
|
2022-09-02 22:15:51 +00:00
|
|
|
background_file = files(join_paths('data', 'background.png'))
|
|
|
|
|
2023-06-27 18:22:28 +00:00
|
|
|
shell_testenv = environment()
|
|
|
|
shell_testenv.set('G_DEBUG', 'fatal-warnings')
|
|
|
|
shell_testenv.set('G_MESSAGES_DEBUG', 'GNOME Shell')
|
|
|
|
shell_testenv.set('GNOME_SHELL_DATADIR', data_builddir)
|
|
|
|
shell_testenv.set('GNOME_SHELL_BUILDDIR', src_builddir)
|
|
|
|
shell_testenv.set('GNOME_SHELL_SESSION_MODE', 'user')
|
|
|
|
shell_testenv.set('SHELL_BACKGROUND_IMAGE', '@0@'.format(background_file))
|
|
|
|
shell_testenv.append('GI_TYPELIB_PATH', gvc_typelib_path, separator: ':')
|
|
|
|
shell_testenv.append('LD_LIBRARY_PATH', libgvc_path, separator: ':')
|
2022-08-17 14:43:13 +00:00
|
|
|
|
2023-06-27 18:22:28 +00:00
|
|
|
foreach shell_test : shell_tests
|
|
|
|
test_name = shell_test['name']
|
|
|
|
options = shell_test.get('options', [])
|
2023-02-02 15:28:06 +00:00
|
|
|
|
2023-06-27 18:22:28 +00:00
|
|
|
test('shell-' + test_name, dbus_runner,
|
2022-08-17 14:43:13 +00:00
|
|
|
args: [
|
2023-06-27 18:22:28 +00:00
|
|
|
test_tool,
|
2022-08-17 14:43:13 +00:00
|
|
|
'--headless',
|
2023-02-02 15:28:06 +00:00
|
|
|
options,
|
2023-06-27 18:27:53 +00:00
|
|
|
'@0@/shell/@1@.js'.format(meson.current_source_dir(), test_name),
|
2022-08-17 14:43:13 +00:00
|
|
|
],
|
2023-02-02 15:50:13 +00:00
|
|
|
is_parallel: false,
|
2023-06-27 18:22:28 +00:00
|
|
|
env: shell_testenv,
|
2022-08-17 14:43:13 +00:00
|
|
|
)
|
|
|
|
endforeach
|