test (609B)
1 #!/bin/sh 2 3 logfile=test.log 4 5 export HB_PATH=sample 6 export EDITOR=ls 7 export FUZZER="xargs" 8 9 test_browse() { FUZZER="echo good_file.txt" ./hb; } 10 11 test_browsefail() { ! FUZZER="echo bad_file.txt" ./hb; } 12 13 test_nonexistentfile() { ! ./hb n -c nonexistentfile; } 14 15 test_existentfile() { ./hb n -c COPYING; } 16 17 set -- browse browsefail nonexistentfile existentfile 18 date +"==========[%Y/%m/%d %H:%M:%S]==========" >> $logfile 19 while [ $# -gt 0 ]; do 20 echo "# Running test ... $1" >> $logfile 21 echo "# Running test ... $1" $(if 1>>$logfile 2>>$logfile "test_$1" ; then echo "Passed"; else echo "Falied"; fi) 22 shift 23 done