#!/bin/sh

set -euo pipefail

TEST_SOURCE="$1"

export REDIS_PORT=6380
echo "Starting redis server on port $REDIS_PORT"
redis-server --port $REDIS_PORT --daemonize yes --dir "$AUTOPKGTEST_TMP"
trap 'echo "Shutting down redis server"; redis-cli -p $REDIS_PORT shutdown' EXIT

echo "Executing test: $TEST_SOURCE"
guile -s "$TEST_SOURCE"
