aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2019-04-23 08:31:38 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-04-28 20:30:30 +0300
commit65091b7677973b783cdb2ebb5b9be9b0b97db975 (patch)
treef9262302e663588cf0ff21195a4797f368479172 /data
parent9cd89f55fca0933dd2897ac7470c5827d939e0ac (diff)
downloadmeson-65091b7677973b783cdb2ebb5b9be9b0b97db975.zip
meson-65091b7677973b783cdb2ebb5b9be9b0b97db975.tar.gz
meson-65091b7677973b783cdb2ebb5b9be9b0b97db975.tar.bz2
RPM Macros: Use `meson test` for %meson_test
Previously, this called out to the %ninja_test macro to run the tests, but that limits us to only the arguments that ninja can understand. In particular, it is not possible to add a test timeout multiplier (such as is sometimes needed when building for slow architectures such as armv7hl). With this patch, it will be possible to specify `%meson_test -t 5` in the RPM spec file without needing to patch the sources to extend the timeouts, making life easier for packagers. Related: https://github.com/mesonbuild/meson/issues/2037 Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
Diffstat (limited to 'data')
-rw-r--r--data/macros.meson12
1 files changed, 11 insertions, 1 deletions
diff --git a/data/macros.meson b/data/macros.meson
index 05d21e5..c5b90de 100644
--- a/data/macros.meson
+++ b/data/macros.meson
@@ -2,6 +2,12 @@
%__meson_wrap_mode nodownload
%__meson_auto_features enabled
+%_smp_mesonflags %([ -z "$MESON_BUILD_NCPUS" ] \\\
+ && MESON_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
+ ncpus_max=%{?_smp_ncpus_max}; \\\
+ if [ -n "$ncpus_max" ] && [ "$ncpus_max" -gt 0 ] && [ "$MESON_BUILD_NCPUS" -gt "$ncpus_max" ]; then MESON_BUILD_NCPUS="$ncpus_max"; fi; \\\
+ if [ "$MESON_BUILD_NCPUS" -gt 1 ]; then echo "--num-processes $MESON_BUILD_NCPUS"; fi)
+
%meson \
%set_build_flags \
%{shrink:%{__meson} \
@@ -31,4 +37,8 @@
%ninja_install -C %{_vpath_builddir}
%meson_test \
- %ninja_test -C %{_vpath_builddir}
+ %{shrink: %{__meson} test \
+ -C %{_vpath_builddir} \
+ %{?_smp_mesonflags} \
+ --print-errorlogs \
+ %{nil}}