#!/bin/bash # # test.sh - Run tests for mod_reqin_log in Docker # set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" IMAGE_NAME="mod_reqin_log-build" echo "========================================" echo "mod_reqin_log - Test Suite" echo "========================================" echo "" # Build image if not exists if ! docker images "$IMAGE_NAME" | grep -q "$IMAGE_NAME"; then echo "Building Docker image first..." "$SCRIPT_DIR/scripts/build.sh" fi echo "Running unit tests..." echo "" # Run unit tests in container docker run --rm "$IMAGE_NAME" bash -c "cd build/tests && ctest --output-on-failure" echo "" echo "========================================" echo "Unit tests completed" echo "========================================"