pslint_selftest.sh 639 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. rc=0
  3. rm -rf log
  4. mkdir -p log
  5. # add CR if missing, it won't possibly survive git
  6. sed -i -e 's/^e.example.com$/e.example.com\r/g' test_spaces.input
  7. for file in `ls *.input|cut -d'.' -f1`; do
  8. echo -n "${file}: "
  9. ./pslint.py ${file}.input >log/${file}.log 2>&1
  10. diff -u ${file}.expected log/${file}.log >log/${file}.diff
  11. if [ $? -eq 0 ]; then
  12. echo OK
  13. rm log/${file}.diff log/${file}.log
  14. else
  15. echo FAILED
  16. cat log/${file}.diff
  17. rc=1
  18. fi
  19. done
  20. # remove CR, to not appear as changed to git
  21. sed -i -e 's/^e.example.com\r$/e.example.com/g' test_spaces.input
  22. if [ $rc -eq 0 ]; then
  23. rmdir log
  24. fi
  25. exit $rc