1#!/bin/sh23TMSIM="${TMSIM:-$(pwd)/../../../tmsim}"4if [ ! -x "${TMSIM}" ]; then5 echo "Couldn't find tmsim executable: '${TMSIM}'" 1>&26 exit 17fi89exitstatus=01011for test in *.csv; do12 tmsimfile="${test%%.csv}.tm"1314 printf "\n"1516 while read -r line; do17 input="$(echo "${line}" | cut -d ',' -f1)"18 status="$(echo "${line}" | cut -d ',' -f2)"1920 echo "Testing '${test##*/}' with input '${input}':"21 ${TMSIM} "${tmsimfile}" "${input}"2223 ret=$?24 if [ ${ret} -eq ${status} ]; then25 printf "\tOK.\n"26 else27 exitstatus=128 printf "\tFAIL: Expected '${status}', got '${ret}'.\n"29 fi30 done < "${test}"31done3233exit ${exitstatus}