dati_test.sh 542 B

12345678910111213141516171819202122
  1. #!/usr/bin/env sh
  2. # if nothing prints, the test passed
  3. diff="diff -bs"
  4. fail=0
  5. go build -o dati dati.go
  6. if [ -e dati ]; then
  7. ./dati -cfg ../examples/dati.cfg -r ../examples/template/html.hmpl > out.html
  8. $diff out.html ../examples/out.html
  9. if [ $? -ne 0 ]; then fail=1; else rm out.html; fi
  10. ./dati -cfg ../examples/dati.cfg -r ../examples/template/txt.mst > out.txt
  11. $diff out.txt ../examples/out.txt
  12. if [ $? -ne 0 ]; then fail=1; else rm out.txt; fi
  13. rm dati
  14. if [ $fail -eq 1 ]; then echo "TEST FAIL"; else echo "TEST PASS"; fi
  15. fi