[gjs: 1/2] When GTK isn't enabled, skip each test spec individually.
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/2] When GTK isn't enabled, skip each test spec individually.
- Date: Fri, 5 Mar 2021 04:43:49 +0000 (UTC)
commit ef8be176a4c37d1037e5d6e2b6f45b3e94a27c04
Author: Olivier <olivier tilloy net>
Date: Fri Mar 5 04:43:47 2021 +0000
When GTK isn't enabled, skip each test spec individually.
Fixes #383.
installed-tests/js/testIntrospection.js | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/installed-tests/js/testIntrospection.js b/installed-tests/js/testIntrospection.js
index d9f4843f..75f1a961 100644
--- a/installed-tests/js/testIntrospection.js
+++ b/installed-tests/js/testIntrospection.js
@@ -38,15 +38,19 @@ describe('Unsafe integer marshalling', function () {
describe('Marshalling empty flat arrays of structs', function () {
let widget;
+ let gtkEnabled;
beforeAll(function () {
- if (GLib.getenv('ENABLE_GTK') !== 'yes') {
- pending('GTK disabled');
+ gtkEnabled = GLib.getenv('ENABLE_GTK') === 'yes';
+ if (!gtkEnabled)
return;
- }
Gtk.init(null);
});
beforeEach(function () {
+ if (!gtkEnabled) {
+ pending('GTK disabled');
+ return;
+ }
widget = new Gtk.Label();
});
@@ -84,15 +88,19 @@ describe('GError domains', function () {
describe('Object properties on GtkBuilder-constructed objects', function () {
let o1;
+ let gtkEnabled;
beforeAll(function () {
- if (GLib.getenv('ENABLE_GTK') !== 'yes') {
- pending('GTK disabled');
+ gtkEnabled = GLib.getenv('ENABLE_GTK') === 'yes';
+ if (!gtkEnabled)
return;
- }
Gtk.init(null);
});
beforeEach(function () {
+ if (!gtkEnabled) {
+ pending('GTK disabled');
+ return;
+ }
const ui = `
<interface>
<object class="GtkButton" id="button">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]