[gnome-control-center/benzea/interactive-test-panels] Run interactive test from builddir
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/benzea/interactive-test-panels] Run interactive test from builddir
- Date: Fri, 9 Nov 2018 22:06:22 +0000 (UTC)
commit 44128a4c03a811aa64371cf27ebebb7e68a56981
Author: Benjamin Berg <bberg redhat com>
Date: Fri Nov 9 23:05:03 2018 +0100
Run interactive test from builddir
meson.build | 5 -----
meson_options.txt | 1 -
.../gtp-dynamic-panel.desktop.in | 0
.../gtp-header-widget.desktop.in | 0
.../{ => applications}/gtp-static-init.desktop.in | 0
tests/interactive-panels/applications/meson.build | 21 +++++++++++++++++++
tests/interactive-panels/main.c | 11 ++++++++++
tests/interactive-panels/meson.build | 24 +---------------------
tests/meson.build | 4 +---
9 files changed, 34 insertions(+), 32 deletions(-)
---
diff --git a/meson.build b/meson.build
index 38045f997..c322d3c8b 100644
--- a/meson.build
+++ b/meson.build
@@ -25,9 +25,6 @@ host_is_linux_not_s390 = host_is_linux and not host_machine.cpu().contains('s390
cc = meson.get_compiler('c')
-# Test panels
-enable_test_panels = get_option('test_panels')
-
# Tracing
enable_tracing = get_option('tracing')
@@ -275,7 +272,5 @@ output += ' IBus (Region panel IBus support) ........... ' + enable_ibus.to_
output += ' NetworkManager (Network panel) ............. ' + host_is_linux.to_string() + '\n'
output += ' Wacom (Wacom tablet panel) ................. ' + host_is_linux_not_s390.to_string() + '\n'
output += ' Wayland .................................... ' + enable_wayland.to_string() + '\n'
-output += ' Tests \n'
-output += ' Panels ..................................... ' + enable_test_panels.to_string() + '\n'
message(output)
\ No newline at end of file
diff --git a/meson_options.txt b/meson_options.txt
index b28e6dc95..a347168b7 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,6 +2,5 @@ option('cheese', type: 'boolean', value: true, description: 'build with cheese w
option('documentation', type: 'boolean', value: false, description: 'build documentation')
option('gnome_session_libexecdir', type: 'string', value: '', description: 'Directory for gnome-session\'s
libexecdir')
option('ibus', type: 'boolean', value: true, description: 'build with IBus support')
-option('test_panels', type: 'boolean', value: false, description: 'build test panels and install their
desktop files')
option('tracing', type: 'boolean', value: false, description: 'add extra debugging information')
option('wayland', type: 'boolean', value: true, description: 'build with Wayland support')
\ No newline at end of file
diff --git a/tests/interactive-panels/gtp-dynamic-panel.desktop.in
b/tests/interactive-panels/applications/gtp-dynamic-panel.desktop.in
similarity index 100%
rename from tests/interactive-panels/gtp-dynamic-panel.desktop.in
rename to tests/interactive-panels/applications/gtp-dynamic-panel.desktop.in
diff --git a/tests/interactive-panels/gtp-header-widget.desktop.in
b/tests/interactive-panels/applications/gtp-header-widget.desktop.in
similarity index 100%
rename from tests/interactive-panels/gtp-header-widget.desktop.in
rename to tests/interactive-panels/applications/gtp-header-widget.desktop.in
diff --git a/tests/interactive-panels/gtp-static-init.desktop.in
b/tests/interactive-panels/applications/gtp-static-init.desktop.in
similarity index 100%
rename from tests/interactive-panels/gtp-static-init.desktop.in
rename to tests/interactive-panels/applications/gtp-static-init.desktop.in
diff --git a/tests/interactive-panels/applications/meson.build
b/tests/interactive-panels/applications/meson.build
new file mode 100644
index 000000000..2b02a904c
--- /dev/null
+++ b/tests/interactive-panels/applications/meson.build
@@ -0,0 +1,21 @@
+#################
+# Desktop files #
+#################
+
+desktop_files = [
+ 'dynamic-panel',
+ 'header-widget',
+ 'static-init',
+]
+
+foreach desktop_file : desktop_files
+ i18n.merge_file(
+ desktop,
+ type : 'desktop',
+ input : 'gtp-@0 desktop in'.format(desktop_file),
+ output : 'gnome-@0@-panel.desktop'.format(desktop_file),
+ po_dir : po_dir,
+ build_by_default : true,
+ )
+endforeach
+
diff --git a/tests/interactive-panels/main.c b/tests/interactive-panels/main.c
index df53fd8f3..7b5a5df69 100644
--- a/tests/interactive-panels/main.c
+++ b/tests/interactive-panels/main.c
@@ -44,6 +44,7 @@ gint
main (gint argc,
gchar *argv[])
{
+ const gchar *orig_data_dirs;
g_autoptr(GtkApplication) application = NULL;
/* Manually register GResources */
@@ -53,6 +54,16 @@ main (gint argc,
/* Override the panels vtable with the test panels */
cc_panel_loader_override_vtable (test_panels, G_N_ELEMENTS (test_panels));
+ /* Override */
+ /*g_desktop_app_info_new_from_filename ("./gnome-dynamic-panel-panel.desktop");
+ g_desktop_app_info_new_from_filename ("./gnome-header-widget-panel.desktop");
+ g_desktop_app_info_new_from_filename ("./gnome-static-init-panel.desktop");*/
+ orig_data_dirs = g_strdup (g_getenv ("XDG_DATA_DIRS"));
+ if (orig_data_dirs)
+ g_setenv ("XDG_DATA_DIRS", g_strconcat (".", ":", orig_data_dirs, NULL), TRUE);
+ else
+ g_setenv ("XDG_DATA_DIRS", ".", TRUE);
+
application = cc_application_new ();
return g_application_run (G_APPLICATION (application), argc, argv);
diff --git a/tests/interactive-panels/meson.build b/tests/interactive-panels/meson.build
index 337602060..6c0f15166 100644
--- a/tests/interactive-panels/meson.build
+++ b/tests/interactive-panels/meson.build
@@ -1,26 +1,4 @@
-#################
-# Desktop files #
-#################
-
-desktop_files = [
- 'dynamic-panel',
- 'header-widget',
- 'static-init',
-]
-
-
-foreach desktop_file : desktop_files
- i18n.merge_file(
- desktop,
- type : 'desktop',
- input : 'gtp-@0 desktop in'.format(desktop_file),
- output : 'gnome-@0@-panel.desktop'.format(desktop_file),
- po_dir : po_dir,
- install : true,
- install_dir : control_center_desktopdir
- )
-endforeach
-
+subdir('applications')
###########
# Sources #
diff --git a/tests/meson.build b/tests/meson.build
index f27d96c0b..7d745d779 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -4,9 +4,7 @@ subdir('common')
# subdir('network')
#endif
-if enable_test_panels
- subdir('interactive-panels')
-endif
+subdir('interactive-panels')
subdir('printers')
subdir('info')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]