test (609B)
1 #!/bin/sh 2 3 logfile=test.log 4 5 export NB_PATH=sample 6 export EDITOR=ls 7 export FUZZER="xargs" 8 9 test_browse() { FUZZER="echo good_file.txt" ./nb; } 10 11 test_browsefail() { ! FUZZER="echo bad_file.txt" ./nb; } 12 13 test_nonexistentfile() { ! ./nb n -c nonexistentfile; } 14 15 test_existentfile() { ./nb 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