aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2022-09-13 21:08:01 +0200
committerMauro Sardara <msardara@cisco.com>2022-09-13 21:08:54 +0200
commit6c9f120f028bcca93fd087afa648f653b208eb35 (patch)
tree26fe62efde7104b77b07f3904a9f0a561e620237 /scripts
parent4a67ff4f13a73023590cb6bd7f3ee53a13abe153 (diff)
ci: group all unit test reports under same folder
Ref: HICN-872 Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: I29f34e15e3cc4e04d50de937568a4e4e76a33f33
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build-packages.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh
index 0ac9dce8b..598b3f626 100644
--- a/scripts/build-packages.sh
+++ b/scripts/build-packages.sh
@@ -27,12 +27,25 @@ function build_package() {
echo "********************* STARTING PACKAGE BUILD **********************"
echo "*******************************************************************"
- # Make the package
+ # Run unit tests and make the package
+ export GTEST_OUTPUT="xml:report.xml"
make -C "${SCRIPT_PATH}/.." BUILD_PATH="${SCRIPT_PATH}/../packages" INSTALL_PREFIX=/usr test package-release
pushd ${SCRIPT_PATH}/../packages
- find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true
- rm *Unspecified* *Development* *development* || true
+ # Find and collect reports
+ mkdir -p reports
+ REPORTS=($(find . -iname 'report.xml'))
+ echo "${REPORTS[@]}"
+ for report in "${REPORTS[@]}"; do
+ mv "${report}" "reports/$(echo ${report} | awk -F/ '{print $(2)"-"$(NF)}')"
+ done
+
+ find . -not -name '*.deb' \
+ -not -name '*.rpm' \
+ -not -name 'reports' \
+ -not -name '*report.xml' \
+ -print0 | xargs -0 rm -rf -- || true
+ rm ./*Unspecified* ./*Development* ./*development* || true
popd
echo "*******************************************************************"