aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-packages.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-packages.sh')
-rw-r--r--scripts/build-packages.sh29
1 files changed, 18 insertions, 11 deletions
diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh
index 598b3f626..dddc98deb 100644
--- a/scripts/build-packages.sh
+++ b/scripts/build-packages.sh
@@ -17,6 +17,20 @@ set -euxo pipefail
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
source ${SCRIPT_PATH}/functions.sh
+BUILD_PATH="${SCRIPT_PATH}/../packages"
+TEST_REPORT_DIR="${BUILD_PATH}/reports"
+BUILD_ROOT_DIR="${BUILD_PATH}/build-root/bin"
+MAKE_FOLDER="${SCRIPT_PATH}/.."
+
+function execute_tests() {
+ mkdir -p "${TEST_REPORT_DIR}"
+ pushd "${BUILD_ROOT_DIR}"
+ for component in "${TEST_COMPONENTS[@]}"; do
+ GTEST_OUTPUT="xml:${TEST_REPORT_DIR}/${component}-report.xml" "./${component}_tests"
+ done
+ popd
+}
+
# Parameters:
# $1 = Package name
#
@@ -28,18 +42,11 @@ function build_package() {
echo "*******************************************************************"
# 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 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
+ make -C "${MAKE_FOLDER}" BUILD_PATH="${BUILD_PATH}" INSTALL_PREFIX=/usr package-release
+
+ execute_tests
+ pushd "${BUILD_PATH}"
find . -not -name '*.deb' \
-not -name '*.rpm' \
-not -name 'reports' \