blob: 5ccd3203fb2d8ec2e247d96d576523e92d9c6c66 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 1481c6d5f08f9dbbe10abc87b372a1f61db36476 Mon Sep 17 00:00:00 2001
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05002From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Mon, 9 Nov 2015 11:07:27 +0200
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08004Subject: [PATCH] Enable more tests while cross-compiling
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05005
6Upstream disables a few tests while cross-compiling because their build requires
7running other built binaries. This usually makes sense but in the cross-compile
8case we can depend on glib-2.0-native.
9
10Upstream-Status: Inappropriate [OE specific]
11Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
12---
Brad Bishop316dfdd2018-06-25 12:45:53 -040013 gio/tests/Makefile.am | 10 ++++++----
Brad Bishop19323692019-04-05 15:28:33 -040014 gio/tests/meson.build | 15 ++++++++-------
15 tests/gobject/Makefile.am | 6 ++++++
16 3 files changed, 20 insertions(+), 11 deletions(-)
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050017
18diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
Brad Bishop19323692019-04-05 15:28:33 -040019index c4e7a92..633e85c 100644
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050020--- a/gio/tests/Makefile.am
21+++ b/gio/tests/Makefile.am
Brad Bishop19323692019-04-05 15:28:33 -040022@@ -583,10 +583,9 @@ test_programs += \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050023 endif
24
25 # -----------------------------------------------------------------------------
26-# The resources test is a bit more complicated, and we cannot build it when
27-# cross-compiling GIO because it requires running a binary...
28+# The resources test is a bit more complicated, and requires glib-native
29+# for running a binary
30
31-if !CROSS_COMPILING
32 test_programs += resources
33 resources_SOURCES = resources.c
34 nodist_resources_SOURCES = test_resources.c test_resources2.c test_resources2.h
Brad Bishop19323692019-04-05 15:28:33 -040035@@ -611,7 +610,11 @@ if !ENABLE_INSTALLED_TESTS
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050036 libresourceplugin_la_LDFLAGS += -rpath /
37 endif
38
39+if !CROSS_COMPILING
40 glib_compile_resources=$(top_builddir)/gio/glib-compile-resources
41+else
42+glib_compile_resources=glib-compile-resources
43+endif
44
Brad Bishop316dfdd2018-06-25 12:45:53 -040045 test-generated.txt: test1.txt
46 $(AM_V_GEN) echo "Generated" > $@ && \
Brad Bishop19323692019-04-05 15:28:33 -040047@@ -632,7 +635,6 @@ test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) --
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050048
49 EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml
Patrick Williamsc0f7c042017-02-23 20:41:17 -060050 CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050051-endif # !CROSS_COMPILING
52
Brad Bishop316dfdd2018-06-25 12:45:53 -040053 BUILT_SOURCES += giotypefuncs.inc
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050054
Brad Bishop19323692019-04-05 15:28:33 -040055diff --git a/gio/tests/meson.build b/gio/tests/meson.build
56index dca33bd..181f5c7 100644
57--- a/gio/tests/meson.build
58+++ b/gio/tests/meson.build
59@@ -173,7 +173,7 @@ if host_machine.system() != 'windows'
60
61 # Test programs that need to bring up a session bus (requires dbus-daemon)
62 have_dbus_daemon = find_program('dbus-daemon', required : false).found()
63- if have_dbus_daemon
64+ if true
65 annotate_args = [
66 '--annotate', 'org.project.Bar', 'Key1', 'Value1',
67 '--annotate', 'org.project.Bar', 'org.gtk.GDBus.Internal', 'Value2',
68@@ -406,12 +406,13 @@ if installed_tests_enabled
69 install_subdir('cert-tests', install_dir : installed_tests_execdir)
70 endif
71
72-if not meson.is_cross_build() or meson.has_exe_wrapper()
73+#if not meson.is_cross_build() or meson.has_exe_wrapper()
74+if meson.is_cross_build()
75
76 plugin_resources_c = custom_target('plugin-resources.c',
77 input : 'test4.gresource.xml',
78 output : 'plugin-resources.c',
79- command : [glib_compile_resources,
80+ command : ['glib-compile-resources',
81 '--target=@OUTPUT@',
82 '--sourcedir=' + meson.current_source_dir(),
83 '--generate-source',
84@@ -428,7 +429,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
85 test_gresource = custom_target('test.gresource',
86 input : 'test.gresource.xml',
87 output : 'test.gresource',
88- command : [glib_compile_resources,
89+ command : ['glib-compile-resources',
90 '--target=@OUTPUT@',
91 '--sourcedir=' + meson.current_source_dir(),
92 '--sourcedir=' + meson.current_build_dir(),
93@@ -439,7 +440,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
94 test_resources2_c = custom_target('test_resources2.c',
95 input : 'test3.gresource.xml',
96 output : 'test_resources2.c',
97- command : [glib_compile_resources,
98+ command : ['glib-compile-resources',
99 '--target=@OUTPUT@',
100 '--sourcedir=' + meson.current_source_dir(),
101 '--generate',
102@@ -450,7 +451,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
103 test_resources2_h = custom_target('test_resources2.h',
104 input : 'test3.gresource.xml',
105 output : 'test_resources2.h',
106- command : [glib_compile_resources,
107+ command : ['glib-compile-resources',
108 '--target=@OUTPUT@',
109 '--sourcedir=' + meson.current_source_dir(),
110 '--generate',
111@@ -461,7 +462,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
112 test_resources_c = custom_target('test_resources.c',
113 input : 'test2.gresource.xml',
114 output : 'test_resources.c',
115- command : [glib_compile_resources,
116+ command : ['glib-compile-resources',
117 '--target=@OUTPUT@',
118 '--sourcedir=' + meson.current_source_dir(),
119 '--generate-source',
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500120diff --git a/tests/gobject/Makefile.am b/tests/gobject/Makefile.am
Brad Bishop19323692019-04-05 15:28:33 -0400121index 1bcefbe..77e646a 100644
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500122--- a/tests/gobject/Makefile.am
123+++ b/tests/gobject/Makefile.am
Brad Bishop19323692019-04-05 15:28:33 -0400124@@ -51,7 +51,13 @@ if ENABLE_TIMELOOP
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500125 installed_test_programs += timeloop-closure
126 endif
127
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500128+# The marshal test requires running a binary, which means we require
129+# glib-native when cross-compiling
Brad Bishop19323692019-04-05 15:28:33 -0400130+if !CROSS_COMPILING
Patrick Williamsd8c66bc2016-06-20 12:57:21 -0500131 glib_genmarshal=$(top_builddir)/gobject/glib-genmarshal
132+else
133+glib_genmarshal=$(shell which glib-genmarshal)
134+endif
135
136 testmarshal.h: stamp-testmarshal.h
137 @true