#!/bin/bash # Get the directory where this script is located SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PROJECT_DIR="$( cd "$SCRIPT_DIR/.." && pwd )" cd "$SCRIPT_DIR" # Clean up old test data rm -rf dehydrate_test_data # Build the test program - mount the entire project directory to access ../output/dehydrate docker run --rm -v "$PROJECT_DIR":/workdir -w /workdir/test gitea.jde.nz/public/dropshell-build-base:latest \ bash -c " if [ -f dehydrate_test.cpp ]; then g++ -std=c++23 -static dehydrate_test.cpp -o dehydrate_test else echo 'ERROR: dehydrate_test.cpp not found in current directory' exit 1 fi " # Check if compilation succeeded if [ ! -f "./dehydrate_test" ]; then echo "Error: Failed to compile dehydrate_test" exit 1 fi # Run the test ./dehydrate_test