Copy unit rules into build directories.

Run unittest for both build and export libs.
This commit is contained in:
Petr Menšík 2018-02-05 16:44:14 +01:00
parent bd8ef642c3
commit 21ad2a883e
1 changed files with 28 additions and 2 deletions

View File

@ -147,7 +147,7 @@ BuildRequires: libdb-devel
%endif
%if %{unittest}
# make unit dependencies
BuildRequires: libatf-c-devel kyua-cli softhsm
BuildRequires: libatf-c-devel kyua-cli softhsm findutils
%endif
%if %{systemtest}
# bin/tests/system dependencies
@ -589,7 +589,14 @@ popd
popd
popd
%endif
popd
popd # build
%if %{unittest}
# normal and pkcs11 unit tests
cp -uv Kyuafile Atffile build/
find lib -name 'Kyuafile' -exec cp -uv '{}' "build/{}" ';'
find lib -name 'Atffile' -exec cp -uv '{}' "build/{}" ';'
%endif
%if %{with_export_libs}
## Create export libs ##
@ -635,6 +642,13 @@ done;
%{__patch} -p2 -b --suffix .export-isc-config < %{PATCH135}
make %{?_smp_mflags}
popd
%if %{unittest}
# export library unit tests
cp -uv Kyuafile Atffile export-libs/
find lib -name 'Kyuafile' -exec cp -uv '{}' "export-libs/{}" ';'
find lib -name 'Atffile' -exec cp -uv '{}' "export-libs/{}" ';'
%endif
## End of export libs
%endif
@ -646,12 +660,24 @@ popd
%endif
%if %{unittest}
pushd build
make unit
e=$?
if [ "$e" -ne 0 ]; then
echo "ERROR: this build of BIND failed 'make unit'. Aborting."
exit $e;
fi;
popd
pushd export-libs
make unit
e=$?
if [ "$e" -ne 0 ]; then
echo "ERROR: this build of BIND export-libs failed 'make unit'. Aborting."
exit $e;
fi;
popd
%endif
%if %{systemtest}