run.sh 444 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. # visual_specs.js creates output in output/XXX.png
  3. phantomjs visual_specs.js
  4. # clear out old diffs
  5. mkdir -p diff
  6. rm -f diff/*
  7. # generate diffs
  8. PASS=1
  9. for i in exemplary/*.png
  10. do
  11. FN=`basename $i`
  12. perceptualdiff $i output/$FN -output diff/$FN
  13. if [ $? -eq 0 ]
  14. then
  15. echo "OK: $FN"
  16. else
  17. echo "FAIL: $FN"
  18. PASS=0
  19. fi
  20. done
  21. # pass / fail
  22. if [ $PASS -eq 1 ]
  23. then
  24. echo "Success."
  25. else
  26. echo "Failed."
  27. exit 1
  28. fi