Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From 1481c6d5f08f9dbbe10abc87b372a1f61db36476 Mon Sep 17 00:00:00 2001 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 3 | Date: Mon, 9 Nov 2015 11:07:27 +0200 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 4 | Subject: [PATCH] Enable more tests while cross-compiling |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 5 | |
| 6 | Upstream disables a few tests while cross-compiling because their build requires |
| 7 | running other built binaries. This usually makes sense but in the cross-compile |
| 8 | case we can depend on glib-2.0-native. |
| 9 | |
| 10 | Upstream-Status: Inappropriate [OE specific] |
| 11 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 12 | --- |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 13 | gio/tests/Makefile.am | 10 ++++++---- |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 14 | gio/tests/meson.build | 15 ++++++++------- |
| 15 | tests/gobject/Makefile.am | 6 ++++++ |
| 16 | 3 files changed, 20 insertions(+), 11 deletions(-) |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 17 | |
| 18 | diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 19 | index c4e7a92..633e85c 100644 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 20 | --- a/gio/tests/Makefile.am |
| 21 | +++ b/gio/tests/Makefile.am |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 22 | @@ -583,10 +583,9 @@ test_programs += \ |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 23 | 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 Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 35 | @@ -611,7 +610,11 @@ if !ENABLE_INSTALLED_TESTS |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 36 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 45 | test-generated.txt: test1.txt |
| 46 | $(AM_V_GEN) echo "Generated" > $@ && \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 47 | @@ -632,7 +635,6 @@ test.gresource: test.gresource.xml Makefile $(shell $(glib_compile_resources) -- |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 48 | |
| 49 | EXTRA_DIST += test.gresource.xml test1.txt test2.gresource.xml test2.txt test3.gresource.xml test3.txt test4.gresource.xml |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 50 | CLEANFILES += test-generated.txt test_resources.c test_resources2.[ch] plugin_resources.c test.gresource |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 51 | -endif # !CROSS_COMPILING |
| 52 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | BUILT_SOURCES += giotypefuncs.inc |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 54 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 55 | diff --git a/gio/tests/meson.build b/gio/tests/meson.build |
| 56 | index 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 Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 120 | diff --git a/tests/gobject/Makefile.am b/tests/gobject/Makefile.am |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 121 | index 1bcefbe..77e646a 100644 |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 122 | --- a/tests/gobject/Makefile.am |
| 123 | +++ b/tests/gobject/Makefile.am |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 124 | @@ -51,7 +51,13 @@ if ENABLE_TIMELOOP |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 125 | installed_test_programs += timeloop-closure |
| 126 | endif |
| 127 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 128 | +# The marshal test requires running a binary, which means we require |
| 129 | +# glib-native when cross-compiling |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 130 | +if !CROSS_COMPILING |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 131 | 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 |