Check exit code for test subprocess (#7269)
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
This directory is used by ///flutter/travis/test.sh to verify that
|
||||
This directory is used by //flutter/dev/bots/test.sh to verify that
|
||||
`flutter test` actually correctly fails when a test fails.
|
||||
|
||||
16
dev/automated_tests/test_smoke_test/crash1_test.dart
Normal file
16
dev/automated_tests/test_smoke_test/crash1_test.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
// 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.
|
||||
|
||||
import 'dart:io' as system;
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
// this is a test to make sure our tests consider engine crashes to be failures
|
||||
// see //flutter/dev/bots/test.sh
|
||||
|
||||
void main() {
|
||||
test('test smoke test -- this test should fail', () async {
|
||||
system.Process.killPid(system.pid, system.ProcessSignal.SIGSEGV);
|
||||
});
|
||||
}
|
||||
12
dev/automated_tests/test_smoke_test/crash2_test.dart
Normal file
12
dev/automated_tests/test_smoke_test/crash2_test.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
// 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.
|
||||
|
||||
import 'dart:io' as system;
|
||||
|
||||
// this is a test to make sure our tests consider engine crashes to be failures
|
||||
// see //flutter/dev/bots/test.sh
|
||||
|
||||
void main() {
|
||||
system.Process.killPid(system.pid, system.ProcessSignal.SIGSEGV);
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
// this is a test to make sure our tests actually catch failures
|
||||
// see ///flutter/travis/test.sh
|
||||
// see //flutter/dev/bots/test.sh
|
||||
|
||||
void main() {
|
||||
test('test smoke test -- this test SHOULD FAIL', () async {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// 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.
|
||||
|
||||
// this is a test to make sure our tests consider syntax errors to be failures
|
||||
// see //flutter/dev/bots/test.sh
|
||||
|
||||
void main() {
|
||||
fail(); // inspired by https://github.com/flutter/flutter/issues/2698
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
// this is a test to make sure our tests actually catch failures
|
||||
// see ///flutter/travis/test.sh
|
||||
// see //flutter/dev/bots/test.sh
|
||||
|
||||
void main() {
|
||||
test('test smoke test -- this test should pass', () async {
|
||||
|
||||
@@ -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.
|
||||
|
||||
// this is a test to make sure our tests consider syntax errors to be failures
|
||||
// see //flutter/dev/bots/test.sh
|
||||
|
||||
The challenge: demand satisfaction
|
||||
If they apologize, no need for further action.
|
||||
@@ -22,6 +22,10 @@ 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 dev/automated_tests; ! flutter test test_smoke_test/crash1_test.dart > /dev/null)
|
||||
(cd dev/automated_tests; ! flutter test test_smoke_test/crash2_test.dart > /dev/null)
|
||||
(cd dev/automated_tests; ! flutter test test_smoke_test/syntax_error_test.broken_dart > /dev/null)
|
||||
(cd dev/automated_tests; ! flutter test test_smoke_test/missing_import_test.broken_dart > /dev/null)
|
||||
(cd packages/flutter_driver; ! flutter drive --use-existing-app -t test_driver/failure.dart >/dev/null 2>&1)
|
||||
|
||||
COVERAGE_FLAG=
|
||||
|
||||
Reference in New Issue
Block a user