#!/bin/bash ALL_OUTPUT=0 test () { file_content=$( /dev/null) else res=$(echo -n "$var1" | smp) fi if [ ! "$res" = "$var2" ]; then tput setaf 1 echo "$1 NOT OK:" tput setaf 3 echo "- Expected --" echo "$var2" tput setaf 1 echo "- Result ----" echo "$res" echo "-------------" tput sgr0 exit 1 else tput setaf 2 echo "$1 OK" tput sgr0 fi } if [ "$#" -eq 1 ]; then ALL_OUTPUT=1 test $1 else for file in tests/smp/*; do test "$(basename $file)" done fi