* [PATCH] meson: add tests option
@ 2021-02-26 22:07 Romain Naour
2021-03-02 10:22 ` Thomas Huth
0 siblings, 1 reply; 5+ messages in thread
From: Romain Naour @ 2021-02-26 22:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Romain Naour
tests/fp/fp-bench.c use fenv.h that is not always provided
by the libc (uClibc).
To workaround this issue, add an new meson option to
disable tests while building Qemu.
Fixes:
http://autobuild.buildroot.net/results/53f5d8baa994d599b9da013ee643b82353366ec3/build-end.log
Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
configure | 7 +++++++
meson.build | 6 +++++-
meson_options.txt | 3 +++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index a79b3746d4..cd114f4b9e 100755
--- a/configure
+++ b/configure
@@ -464,6 +464,7 @@ gettext="auto"
fuse="auto"
fuse_lseek="auto"
multiprocess="no"
+tests="auto"
malloc_trim="auto"
@@ -1562,6 +1563,10 @@ for opt do
;;
--disable-multiprocess) multiprocess="no"
;;
+ --disable-tests) tests="disabled"
+ ;;
+ --enable-tests) tests="enabled"
+ ;;
*)
echo "ERROR: unknown option $opt"
echo "Try '$0 --help' for more information"
@@ -1915,6 +1920,7 @@ disabled with --disable-FEATURE, default is enabled if available
fuse FUSE block device export
fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports
multiprocess Multiprocess QEMU support
+ tests build tests
NOTE: The object files are built at the place where configure is launched
EOF
@@ -6428,6 +6434,7 @@ NINJA=$ninja $meson setup \
-Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi \
$(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
-Dtcg_interpreter=$tcg_interpreter \
+ -Dtests=$tests \
$cross_arg \
"$PWD" "$source_path"
diff --git a/meson.build b/meson.build
index 05a67c20d9..2d7cbc0fbd 100644
--- a/meson.build
+++ b/meson.build
@@ -2341,7 +2341,11 @@ subdir('scripts')
subdir('tools')
subdir('pc-bios')
subdir('docs')
-subdir('tests')
+
+if get_option('tests').enabled()
+ subdir('tests')
+endif
+
if gtk.found()
subdir('po')
endif
diff --git a/meson_options.txt b/meson_options.txt
index 675a9c500a..be30ad5450 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -114,6 +114,9 @@ option('virtfs', type: 'feature', value: 'auto',
option('virtiofsd', type: 'feature', value: 'auto',
description: 'build virtiofs daemon (virtiofsd)')
+option('tests', type : 'feature', value : 'auto',
+ description: 'Tests build support')
+
option('capstone', type: 'combo', value: 'auto',
choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
description: 'Whether and how to find the capstone library')
--
2.29.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] meson: add tests option
2021-02-26 22:07 [PATCH] meson: add tests option Romain Naour
@ 2021-03-02 10:22 ` Thomas Huth
2021-03-02 11:08 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2021-03-02 10:22 UTC (permalink / raw)
To: Romain Naour, qemu-devel, Paolo Bonzini
On 26/02/2021 23.07, Romain Naour wrote:
> tests/fp/fp-bench.c use fenv.h that is not always provided
> by the libc (uClibc).
For such problem it might be better to check for the availability of the
header and then to only disable the single test that depends on it if the
header is not available.
Anyway, a switch to disable the tests completely could still be handy in
some cases, so FWIW:
Acked-by: Thomas Huth <thuth@redhat.com>
> To workaround this issue, add an new meson option to
> disable tests while building Qemu.
>
> Fixes:
> http://autobuild.buildroot.net/results/53f5d8baa994d599b9da013ee643b82353366ec3/build-end.log
>
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
> configure | 7 +++++++
> meson.build | 6 +++++-
> meson_options.txt | 3 +++
> 3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index a79b3746d4..cd114f4b9e 100755
> --- a/configure
> +++ b/configure
> @@ -464,6 +464,7 @@ gettext="auto"
> fuse="auto"
> fuse_lseek="auto"
> multiprocess="no"
> +tests="auto"
>
> malloc_trim="auto"
>
> @@ -1562,6 +1563,10 @@ for opt do
> ;;
> --disable-multiprocess) multiprocess="no"
> ;;
> + --disable-tests) tests="disabled"
> + ;;
> + --enable-tests) tests="enabled"
> + ;;
> *)
> echo "ERROR: unknown option $opt"
> echo "Try '$0 --help' for more information"
> @@ -1915,6 +1920,7 @@ disabled with --disable-FEATURE, default is enabled if available
> fuse FUSE block device export
> fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE exports
> multiprocess Multiprocess QEMU support
> + tests build tests
>
> NOTE: The object files are built at the place where configure is launched
> EOF
> @@ -6428,6 +6434,7 @@ NINJA=$ninja $meson setup \
> -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek -Dguest_agent_msi=$guest_agent_msi \
> $(if test "$default_features" = no; then echo "-Dauto_features=disabled"; fi) \
> -Dtcg_interpreter=$tcg_interpreter \
> + -Dtests=$tests \
> $cross_arg \
> "$PWD" "$source_path"
>
> diff --git a/meson.build b/meson.build
> index 05a67c20d9..2d7cbc0fbd 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -2341,7 +2341,11 @@ subdir('scripts')
> subdir('tools')
> subdir('pc-bios')
> subdir('docs')
> -subdir('tests')
> +
> +if get_option('tests').enabled()
> + subdir('tests')
> +endif
> +
> if gtk.found()
> subdir('po')
> endif
> diff --git a/meson_options.txt b/meson_options.txt
> index 675a9c500a..be30ad5450 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -114,6 +114,9 @@ option('virtfs', type: 'feature', value: 'auto',
> option('virtiofsd', type: 'feature', value: 'auto',
> description: 'build virtiofs daemon (virtiofsd)')
>
> +option('tests', type : 'feature', value : 'auto',
> + description: 'Tests build support')
> +
> option('capstone', type: 'combo', value: 'auto',
> choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
> description: 'Whether and how to find the capstone library')
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] meson: add tests option
2021-03-02 10:22 ` Thomas Huth
@ 2021-03-02 11:08 ` Paolo Bonzini
2021-03-02 21:14 ` Romain Naour
0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2021-03-02 11:08 UTC (permalink / raw)
To: Thomas Huth, Romain Naour, qemu-devel
On 02/03/21 11:22, Thomas Huth wrote:
> On 26/02/2021 23.07, Romain Naour wrote:
>> tests/fp/fp-bench.c use fenv.h that is not always provided
>> by the libc (uClibc).
>
> For such problem it might be better to check for the availability of
> the header and then to only disable the single test that depends on it
> if the header is not available.
>
> Anyway, a switch to disable the tests completely could still be handy in
> some cases, so FWIW:
>
> Acked-by: Thomas Huth <thuth@redhat.com>
I disagree, without a use case the right thing to do is to check for
fenv.h. It's as easy as this:
diff --git a/tests/meson.build b/tests/meson.build
index 0c939f89f7..3b9b2f0483 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -281,7 +281,7 @@ test('decodetree', sh,
workdir: meson.current_source_dir() / 'decode',
suite: 'decodetree')
-if 'CONFIG_TCG' in config_all
+if 'CONFIG_TCG' in config_all and cc.has_header('fenv.h')
subdir('fp')
endif
Thanks,
Paolo
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] meson: add tests option
2021-03-02 11:08 ` Paolo Bonzini
@ 2021-03-02 21:14 ` Romain Naour
2021-03-03 12:22 ` Paolo Bonzini
0 siblings, 1 reply; 5+ messages in thread
From: Romain Naour @ 2021-03-02 21:14 UTC (permalink / raw)
To: Paolo Bonzini, Thomas Huth, qemu-devel
Hello,
Le 02/03/2021 à 12:08, Paolo Bonzini a écrit :
> On 02/03/21 11:22, Thomas Huth wrote:
>> On 26/02/2021 23.07, Romain Naour wrote:
>>> tests/fp/fp-bench.c use fenv.h that is not always provided
>>> by the libc (uClibc).
>>
>> For such problem it might be better to check for the availability of the
>> header and then to only disable the single test that depends on it if the
>> header is not available.
You're right, I thought about adding a header check but I noticed that was no
option to disable all tests. Buildroot try to avoid as much as possible building
tests program.
>>
>> Anyway, a switch to disable the tests completely could still be handy in some
>> cases, so FWIW:
It can save some build time:
qemu build with tests disabled
real 3m27,310s
user 19m56,887s
sys 2m1,738s
qemu build with tests enabled
real 4m0,638s
user 23m34,963s
sys 2m32,944s
>>
>> Acked-by: Thomas Huth <thuth@redhat.com>
>
> I disagree, without a use case the right thing to do is to check for fenv.h.
> It's as easy as this:
Is it ok if I take your patch to disable fp tests when fenv.h is missing and
resend my patch with an updated commit log to disable all tests to save some
build time?
Best regards,
Romain
>
> diff --git a/tests/meson.build b/tests/meson.build
> index 0c939f89f7..3b9b2f0483 100644
> --- a/tests/meson.build
> +++ b/tests/meson.build
> @@ -281,7 +281,7 @@ test('decodetree', sh,
> workdir: meson.current_source_dir() / 'decode',
> suite: 'decodetree')
>
> -if 'CONFIG_TCG' in config_all
> +if 'CONFIG_TCG' in config_all and cc.has_header('fenv.h')
> subdir('fp')
> endif
>
> Thanks,
>
> Paolo
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] meson: add tests option
2021-03-02 21:14 ` Romain Naour
@ 2021-03-03 12:22 ` Paolo Bonzini
0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-03-03 12:22 UTC (permalink / raw)
To: Romain Naour, Thomas Huth, qemu-devel
On 02/03/21 22:14, Romain Naour wrote:
>> I disagree, without a use case the right thing to do is to check for fenv.h.
>> It's as easy as this:
> Is it ok if I take your patch to disable fp tests when fenv.h is missing and
> resend my patch with an updated commit log to disable all tests to save some
> build time?
To save build time you could also mark the tests as "build_by_default:
false". They should be built lazily when you run "make check".
Paolo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-03-03 12:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 22:07 [PATCH] meson: add tests option Romain Naour
2021-03-02 10:22 ` Thomas Huth
2021-03-02 11:08 ` Paolo Bonzini
2021-03-02 21:14 ` Romain Naour
2021-03-03 12:22 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.