run_mru_tests.sh 527 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # Script to run the unit-tests for the MRU Vim plugin
  3. VIMPRG=${VIMPRG:=/usr/bin/vim}
  4. VIM_CMD="$VIMPRG -N -u NONE -U NONE -i NONE --noplugin"
  5. rm -f test.log
  6. $VIM_CMD -S unit_tests.vim
  7. if [ ! -f test.log ]
  8. then
  9. echo "ERROR: Test results file 'test.log' is not found"
  10. exit 1
  11. fi
  12. echo "MRU unit test results:"
  13. echo "====================="
  14. cat test.log
  15. echo
  16. grep FAIL test.log > /dev/null 2>&1
  17. if [ $? -eq 0 ]
  18. then
  19. echo "ERROR: Some test(s) failed."
  20. exit 1
  21. fi
  22. echo "SUCCESS: All the tests passed."
  23. exit 0