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