blob: f1c7a238a65c0777491c4b2d7d3f2345d999484b [file] [log] [blame]
#!/bin/bash
# Make sure dartfmt is run on everything
# This assumes you have dart_style as a dev_dependency
echo "Checking dartfmt..."
NEEDS_DARTFMT="$(find lib test -name "*.dart" | xargs pub run dart_style:format -n)"
if [[ ${NEEDS_DARTFMT} != "" ]]
then
echo "FAILED"
echo "${NEEDS_DARTFMT}"
exit 1
fi
echo "PASSED"
# Make sure we pass the analyzer
echo "Checking dartanalyzer..."
FAILS_ANALYZER="$(find lib test -name "*.dart" | xargs dartanalyzer --options .analysis_options)"
if [[ $FAILS_ANALYZER == *"[error]"* ]]
then
echo "FAILED"
echo "${FAILS_ANALYZER}"
exit 1
fi
echo "PASSED"
# Fail on anything that fails going forward.
set -e
THE_COMMAND="pub run test -p $TEST_PLATFORM"
if [ $TEST_PLATFORM == 'firefox' ]; then
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
t=0; until (xdpyinfo -display :99 &> /dev/null || test $t -gt 10); do sleep 1; let t=$t+1; done
fi
echo $THE_COMMAND
exec $THE_COMMAND
pub run test