mirror of
https://github.com/encounter/flutter.git
synced 2026-03-30 11:10:35 -07:00
dev/bots/test.sh += robustness (#4682)
This commit is contained in:
+13
-6
@@ -1,20 +1,27 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
|
||||
|
||||
die() {
|
||||
trap detect_error_on_exit EXIT HUP INT QUIT TERM
|
||||
|
||||
detect_error_on_exit() {
|
||||
exit_code=$?
|
||||
set +x
|
||||
echo "Error: script exited early due to error"
|
||||
exit 1
|
||||
if [[ $exit_code -ne 0 ]]; then
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
echo "Error: script exited early due to error ($exit_code)"
|
||||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
fi
|
||||
}
|
||||
|
||||
set -ex
|
||||
|
||||
# analyze all the Dart code in the repo
|
||||
flutter analyze --flutter-repo
|
||||
|
||||
# verify that the tests actually return failure on failure and success on success
|
||||
(cd dev/automated_tests; ! flutter test test_smoke_test/fail_test.dart > /dev/null) || die
|
||||
(cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null) || die
|
||||
(cd dev/automated_tests; ! flutter test test_smoke_test/fail_test.dart > /dev/null)
|
||||
(cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null)
|
||||
|
||||
# run tests
|
||||
(cd packages/flutter; flutter test)
|
||||
|
||||
Reference in New Issue
Block a user