Adds functionality and with already migrated components integration test to cmake targets unter ./Z
This commit is contained in:
6 files changed
+795
-17
No files matched your search
@@ -11,6 +11,7 @@ set -euo pipefail
|
||||
# - 3 separately switchable make build groups
|
||||
# - Optional usage of a prebuilt Docker image with installed dependencies
|
||||
# - Optional creation of that prebuilt Docker image via --build-prebuilt-image
|
||||
# - Optional deletion of that prebuilt Docker image via --delete-prebuilt-image
|
||||
# - Optional disabling of ctest
|
||||
# - Optional tests-only mode
|
||||
# - Uses a temporary container-side script for robust execution
|
||||
@@ -33,16 +34,18 @@ Build groups:
|
||||
Test execution:
|
||||
--no-ctest Skip ctest execution
|
||||
--tests-only Run only ctest, skip all make build groups
|
||||
--integration-test Run only Z-module integration tests (test_z_*)
|
||||
|
||||
Prebuilt Docker image usage:
|
||||
--use-prebuilt-image Use a Docker image with dependencies already installed
|
||||
--no-prebuilt-image Use base image and run apt-get install inside the container
|
||||
--docker-image IMAGE Docker image name to use/build
|
||||
--docker-image IMAGE Docker image name to use/build/delete
|
||||
|
||||
Prebuilt Docker image creation:
|
||||
Prebuilt Docker image management:
|
||||
--build-prebuilt-image Build the prebuilt Docker image before running the build
|
||||
If used alone, the script builds the image and exits
|
||||
If combined with --use-prebuilt-image, the built image is used immediately
|
||||
--delete-prebuilt-image Delete the configured Docker image and exit
|
||||
|
||||
Environment variable overrides:
|
||||
BUILD_RTI=ON|OFF
|
||||
@@ -51,8 +54,10 @@ Environment variable overrides:
|
||||
BUILD_GROUP3=ON|OFF
|
||||
RUN_CTEST=ON|OFF
|
||||
TESTS_ONLY=ON|OFF
|
||||
INTEGRATION_TEST=ON|OFF
|
||||
USE_PREBUILT_IMAGE=ON|OFF
|
||||
BUILD_PREBUILT_IMAGE=ON|OFF
|
||||
DELETE_PREBUILT_IMAGE=ON|OFF
|
||||
DOCKER_IMAGE=<image-name>
|
||||
|
||||
Required .envrc variable:
|
||||
@@ -68,8 +73,10 @@ Defaults:
|
||||
BUILD_GROUP3=ON
|
||||
RUN_CTEST=ON
|
||||
TESTS_ONLY=OFF
|
||||
INTEGRATION_TEST=OFF
|
||||
USE_PREBUILT_IMAGE=OFF
|
||||
BUILD_PREBUILT_IMAGE=OFF
|
||||
DELETE_PREBUILT_IMAGE=OFF
|
||||
DOCKER_IMAGE=qt-migration-builder:latest
|
||||
|
||||
Examples:
|
||||
@@ -82,6 +89,8 @@ Examples:
|
||||
./build.sh --build-prebuilt-image --docker-image qt-migration-builder:latest
|
||||
./build.sh --use-prebuilt-image --docker-image qt-migration-builder:latest
|
||||
./build.sh --build-prebuilt-image --use-prebuilt-image --docker-image qt-migration-builder:latest
|
||||
./build.sh --delete-prebuilt-image --docker-image qt-migration-builder:latest
|
||||
./build.sh --use-prebuilt-image --no-group1 --no-group3 --integration-test
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -169,6 +178,18 @@ cleanup_temp_dir() {
|
||||
fi
|
||||
}
|
||||
|
||||
delete_prebuilt_image() {
|
||||
local image_name="$1"
|
||||
|
||||
if docker image inspect "$image_name" >/dev/null 2>&1; then
|
||||
log_info "Deleting Docker image: ${image_name}"
|
||||
docker rmi "$image_name"
|
||||
log_info "Docker image deleted successfully: ${image_name}"
|
||||
else
|
||||
log_info "Docker image does not exist, nothing to delete: ${image_name}"
|
||||
fi
|
||||
}
|
||||
|
||||
APT_PACKAGES=(
|
||||
build-essential
|
||||
cmake
|
||||
@@ -202,7 +223,6 @@ GROUP2_TARGETS=(
|
||||
|
||||
GROUP3_TARGETS=(
|
||||
NGLLogger
|
||||
SV
|
||||
nglapplication
|
||||
nglcompression
|
||||
nglcoreapplication
|
||||
@@ -266,6 +286,7 @@ RUN_CTEST="${RUN_CTEST:-ON}"
|
||||
TESTS_ONLY="${TESTS_ONLY:-OFF}"
|
||||
USE_PREBUILT_IMAGE="${USE_PREBUILT_IMAGE:-OFF}"
|
||||
BUILD_PREBUILT_IMAGE="${BUILD_PREBUILT_IMAGE:-OFF}"
|
||||
DELETE_PREBUILT_IMAGE="${DELETE_PREBUILT_IMAGE:-OFF}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-qt-migration-builder:latest}"
|
||||
|
||||
if [[ $# -gt 0 ]]; then
|
||||
@@ -303,6 +324,9 @@ while [[ $# -gt 0 ]]; do
|
||||
--tests-only)
|
||||
TESTS_ONLY=ON
|
||||
;;
|
||||
--integration-test)
|
||||
INTEGRATION_TEST=ON
|
||||
;;
|
||||
--use-prebuilt-image)
|
||||
USE_PREBUILT_IMAGE=ON
|
||||
;;
|
||||
@@ -312,6 +336,9 @@ while [[ $# -gt 0 ]]; do
|
||||
--build-prebuilt-image)
|
||||
BUILD_PREBUILT_IMAGE=ON
|
||||
;;
|
||||
--delete-prebuilt-image)
|
||||
DELETE_PREBUILT_IMAGE=ON
|
||||
;;
|
||||
--docker-image)
|
||||
shift
|
||||
[[ $# -gt 0 ]] || die "--docker-image requires an image name"
|
||||
@@ -335,10 +362,18 @@ BUILD_GROUP2="$(normalize_on_off "$BUILD_GROUP2" "BUILD_GROUP2")"
|
||||
BUILD_GROUP3="$(normalize_on_off "$BUILD_GROUP3" "BUILD_GROUP3")"
|
||||
RUN_CTEST="$(normalize_on_off "$RUN_CTEST" "RUN_CTEST")"
|
||||
TESTS_ONLY="$(normalize_on_off "$TESTS_ONLY" "TESTS_ONLY")"
|
||||
INTEGRATION_TEST="$(normalize_on_off "$INTEGRATION_TEST" "INTEGRATION_TEST")"
|
||||
USE_PREBUILT_IMAGE="$(normalize_on_off "$USE_PREBUILT_IMAGE" "USE_PREBUILT_IMAGE")"
|
||||
BUILD_PREBUILT_IMAGE="$(normalize_on_off "$BUILD_PREBUILT_IMAGE" "BUILD_PREBUILT_IMAGE")"
|
||||
DELETE_PREBUILT_IMAGE="$(normalize_on_off "$DELETE_PREBUILT_IMAGE" "DELETE_PREBUILT_IMAGE")"
|
||||
|
||||
require_non_empty "${DOCKER_IMAGE}" "DOCKER_IMAGE"
|
||||
|
||||
if [[ "${DELETE_PREBUILT_IMAGE}" == "ON" ]]; then
|
||||
delete_prebuilt_image "${DOCKER_IMAGE}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
require_non_empty "${MIGRATE_PIPELINE_ROOT:-}" "MIGRATE_PIPELINE_ROOT"
|
||||
require_directory "${MIGRATE_PIPELINE_ROOT}" "MIGRATE_PIPELINE_ROOT"
|
||||
|
||||
@@ -362,8 +397,10 @@ log_group "Build Group 2 (migration_tests)" "$BUILD_GROUP2"
|
||||
log_group "Build Group 3 (application targets)" "$BUILD_GROUP3"
|
||||
log_info "RUN_CTEST=${RUN_CTEST}"
|
||||
log_info "TESTS_ONLY=${TESTS_ONLY}"
|
||||
log_info "INTEGRATION_TEST=${INTEGRATION_TEST}"
|
||||
log_info "USE_PREBUILT_IMAGE=${USE_PREBUILT_IMAGE}"
|
||||
log_info "BUILD_PREBUILT_IMAGE=${BUILD_PREBUILT_IMAGE}"
|
||||
log_info "DELETE_PREBUILT_IMAGE=${DELETE_PREBUILT_IMAGE}"
|
||||
log_info "DOCKER_IMAGE=${DOCKER_IMAGE}"
|
||||
log_info "MIGRATE_PIPELINE_ROOT=${MIGRATE_PIPELINE_ROOT}"
|
||||
log_info "RTI_LICENSE_FILE_HOST=${RTI_LICENSE_FILE_HOST}"
|
||||
@@ -398,6 +435,17 @@ cat > "${CONTAINER_SCRIPT_HOST}" <<'EOF'
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Default variable assignments to prevent unbound variable errors
|
||||
USE_PREBUILT_IMAGE="${USE_PREBUILT_IMAGE:-OFF}"
|
||||
BUILD_RTI="${BUILD_RTI:-ON}"
|
||||
BUILD_GROUP1="${BUILD_GROUP1:-ON}"
|
||||
BUILD_GROUP2="${BUILD_GROUP2:-ON}"
|
||||
BUILD_GROUP3="${BUILD_GROUP3:-ON}"
|
||||
RUN_CTEST="${RUN_CTEST:-ON}"
|
||||
TESTS_ONLY="${TESTS_ONLY:-OFF}"
|
||||
INTEGRATION_TEST="${INTEGRATION_TEST:-OFF}"
|
||||
APT_PACKAGES_STRING="${APT_PACKAGES_STRING:-}"
|
||||
|
||||
log_info() {
|
||||
printf 'INFO: %s\n' "$*"
|
||||
}
|
||||
@@ -454,8 +502,13 @@ else
|
||||
fi
|
||||
|
||||
if [[ "${RUN_CTEST}" == "ON" ]]; then
|
||||
log_info "Running CTest"
|
||||
ctest --test-dir . --output-on-failure
|
||||
if [[ "${INTEGRATION_TEST}" == "ON" ]]; then
|
||||
log_info "Running Z-module integration tests only"
|
||||
ctest --test-dir . --output-on-failure -R "test_z_"
|
||||
else
|
||||
log_info "Running CTest"
|
||||
ctest --test-dir . --output-on-failure
|
||||
fi
|
||||
else
|
||||
log_info "Skipping CTest"
|
||||
fi
|
||||
@@ -473,6 +526,7 @@ docker run --rm \
|
||||
-e BUILD_GROUP3 \
|
||||
-e RUN_CTEST \
|
||||
-e TESTS_ONLY \
|
||||
-e INTEGRATION_TEST \
|
||||
-e USE_PREBUILT_IMAGE \
|
||||
-e APT_PACKAGES_STRING="${APT_PACKAGES_STRING}" \
|
||||
-e GROUP1_TARGETS="${GROUP1_TARGETS_STRING}" \
|
||||
|
||||
Reference in new issue
Block a user