X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=test.sh;h=3194c72cbb40661e179fc494d596a25ba3c9dcfa;hb=d0da31d021ee7a89b378182a60bf28f0873fc87b;hp=3d3bfbb6c1ae287d2400b52eb1bec8cc5df52bf7;hpb=e26b71566419e1c051f3fbd1f4f8f64b063a04c9;p=dygraphs.git diff --git a/test.sh b/test.sh index 3d3bfbb..3194c72 100755 --- a/test.sh +++ b/test.sh @@ -9,4 +9,16 @@ if [ $? != 0 ]; then exit 1 fi -phantomjs phantom-driver.js +# Don't run tests if the documentation doesn't parse. +./generate-documentation.py > /dev/null +if [ $? != 0 ]; then + echo Failed to generate documentation. Fix this before running tests. + exit 1 +fi + +phantomjs phantom-driver.js $* | tee /tmp/test-results.txt +trap "rm -f /tmp/test-results.txt" EXIT +if grep -q 'FAIL' /tmp/test-results.txt; then + echo One or more tests failed. + exit 1 +fi