From d63430773c8d957f368e3c60047c3215851eb800 Mon Sep 17 00:00:00 2001 From: Yegor Date: Wed, 9 Nov 2016 15:28:30 -0800 Subject: [PATCH] add driver failure test (#6776) --- dev/bots/test.sh | 1 + packages/flutter_driver/test_driver/failure.dart | 7 +++++++ packages/flutter_driver/test_driver/failure_test.dart | 9 +++++++++ 3 files changed, 17 insertions(+) create mode 100644 packages/flutter_driver/test_driver/failure.dart create mode 100644 packages/flutter_driver/test_driver/failure_test.dart diff --git a/dev/bots/test.sh b/dev/bots/test.sh index 0ae9f9d627..52415f0951 100755 --- a/dev/bots/test.sh +++ b/dev/bots/test.sh @@ -22,6 +22,7 @@ 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) (cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null) +(cd packages/flutter_driver; ! flutter drive --use-existing-app -t test_driver/failure.dart >/dev/null 2>&1) COVERAGE_FLAG= if [ -n "$TRAVIS" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then diff --git a/packages/flutter_driver/test_driver/failure.dart b/packages/flutter_driver/test_driver/failure.dart new file mode 100644 index 0000000000..6494a6c7d0 --- /dev/null +++ b/packages/flutter_driver/test_driver/failure.dart @@ -0,0 +1,7 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +void main() { + // Dummy. Only needed because driver needs an entry point. +} diff --git a/packages/flutter_driver/test_driver/failure_test.dart b/packages/flutter_driver/test_driver/failure_test.dart new file mode 100644 index 0000000000..436d0c1a43 --- /dev/null +++ b/packages/flutter_driver/test_driver/failure_test.dart @@ -0,0 +1,9 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +void main() { + // Intentionally fail the test. We want to see driver return a non-zero exit + // code when this happens. + throw 'Failed'; +}