#!/bin/sh

set -e

# get configured frame libraries to test against
frame_libraries=""
while test "x$1" != "x--"; do
    frame_libraries="${frame_libraries} $1"
    shift
done
if [ "x${frame_libraries}" = x ]; then
    echo "WARNING: no frame libraries configured" >&2
    exit 77
fi
shift

# run tests against each configured frame library
for frame_library in ${frame_libraries}; do
    export LAL_FRAME_LIBRARY=${frame_library}
    echo
    echo ">>>>>>> Running test with LAL_FRAME_LIBRARY=${LAL_FRAME_LIBRARY}"
    echo
    eval "$@"
    echo
    echo "^^^^^^^ Test above was run with LAL_FRAME_LIBRARY=${LAL_FRAME_LIBRARY}"
    echo
done
