brotli/tests/test-brotli-with-curl.sh
2023-06-21 14:42:45 +02:00

35 lines
786 B
Bash

#!/bin/bash
# exit immediately if any command returns non-zero exit code
set -e
# print commands as they are executed by the shell interpreter
set -x
# list of upstream tests to run
CURL_TESTS="314 315 316"
# obtain source RPM of curl
SRPM_URL=$(yum repoquery -q --srpm curl --location)
SRPM=${SRPM_URL##*/}
curl -Lo "$SRPM" "$SRPM_URL"
# install build-time deps
yum -y builddep "$SRPM"
# extract source RPM
rpmdev-extract "$SRPM"
cd "${SRPM%.rpm}"
# local build of curl
rpmbuild --nodeps -bc curl.spec \
--define "_sourcedir $PWD" \
--define "_builddir $PWD"
# local build of upstream tests
cd curl-*/build-full/tests
make $(rpm --eval '%{_smp_mflags}')
# run selected upstream tests
srcdir=../../tests perl -I../../tests ../../tests/runtests.pl -a -p -v $CURL_TESTS