Signed-off-by: Julien Rische <jrische@redhat.com> (cherry picked from commit be6251ccdd390e3a56d84f352cde78aaceff81fb) Co-authored-by: Julien Rische <jrische@redhat.com>
30 lines
1.2 KiB
Bash
Executable File
30 lines
1.2 KiB
Bash
Executable File
#!/bin/sh -eux
|
|
|
|
export RPM_PACKAGE_NAME={{ name }}
|
|
export RPM_PACKAGE_VERSION={{ version }}
|
|
export RPM_PACKAGE_RELEASE={{ release }}
|
|
export RPM_ARCH={{ arch }}
|
|
export RPM_BUILD_NCPUS="$(getconf _NPROCESSORS_ONLN)"
|
|
|
|
testdir="$(mktemp -d)"
|
|
|
|
# Will remove the temporary test directory when the script terminates
|
|
# (even if stopped by an exit signal)
|
|
trap "rm -rf ${testdir}" EXIT
|
|
|
|
build_flags="$(eval "echo $(rpm --eval '%{_smp_mflags}')")"
|
|
|
|
mkdir "${testdir}/{{ name }}-tests"
|
|
cp -rp /usr/share/{{ name }}-tests/{{ arch }} "${testdir}/{{ name }}-tests/"
|
|
|
|
autoreconf -fiv "${testdir}/{{ name }}-tests/{{ arch }}"
|
|
|
|
mkdir -p "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs"
|
|
ln -s {{ libdir }}/libverto.so "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
|
ln -s {{ libdir }}/libverto.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
|
ln -s {{ libdir }}/libverto-glib.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
|
ln -s {{ libdir }}/libverto-libev.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
|
ln -s {{ libdir }}/libverto-libevent.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
|
|
|
make -C "${testdir}/{{ name }}-tests/{{ arch }}/tests/" $build_flags check-TESTS
|