#!/usr/bin/env bash

# This runs a test while providing diagnostic output on error. It is a
# convenience script that wraps around ../testhelper to provide some
# often-used options. The usage is the same, except that $2 is the
# actual input used as a string, not a filename.
#

action="$1"
shift

tmpFile="./errorTestHelperTmp"
echo "$1" > $tmpFile
shift

outputFile="$1.err"
shift

../testScripts/testhelper $action $tmpFile $outputFile  _expectExitCode 1 _matchError $*
