From a1890354e58f7bc209b9111d107fea40fdacdf7b Mon Sep 17 00:00:00 2001 From: Ryan Schmidt Date: Mon, 9 May 2022 14:18:39 -0500 Subject: [PATCH] Tests: Build nginx in parallel on macOS --- t/build-and-run | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/build-and-run b/t/build-and-run index 68584b7..e632a99 100755 --- a/t/build-and-run +++ b/t/build-and-run @@ -12,6 +12,15 @@ if [[ $2 -eq 1 ]] ; then readonly DYNAMIC=$2 fi +case $(uname -s) in + Darwin) + JOBS=$(sysctl -n hw.activecpu) + ;; + *) + JOBS=1 + ;; +esac + cd "$(dirname "$0")/.." wget -O - http://nginx.org/download/nginx-${NGINX}.tar.gz | tar -xzf - rm -rf prefix/ @@ -20,6 +29,7 @@ cd nginx-${NGINX} --add-${DYNAMIC:+dynamic-}module=.. \ --with-http_addition_module \ --prefix="$(pwd)/../prefix" +make -j"$JOBS" make install cd .. exec ./t/run prefix ${DYNAMIC}