if [ -z "$SAGE_LOCAL" ]; then
    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
    echo >&2 "Maybe run 'sage -sh'?"
    exit 1
fi

cd src

# We don't have to set up any environment variables here since the
# Makefiles already have them from 'configure'.

echo "Now building and running MPIR's test suite..."
$MAKE check
if [ $? -ne 0 ]; then
    echo >&2 "Error: The MPIR test suite failed."
    exit 1
fi

echo "The MPIR test suite passed successfully."
