From 8708cf77fa871abd85ff7e22fc3967d3669e3a3b Mon Sep 17 00:00:00 2001 From: evanweible-wf Date: Fri, 20 Nov 2015 09:18:17 -0600 Subject: [PATCH] Fix browser file detection (dart2js output changed) --- lib/src/tasks/coverage/api.dart | 3 ++- lib/src/tasks/test/api.dart | 5 +++-- test/integration/coverage_test.dart | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/src/tasks/coverage/api.dart b/lib/src/tasks/coverage/api.dart index 00e0d076..300c14d9 100644 --- a/lib/src/tasks/coverage/api.dart +++ b/lib/src/tasks/coverage/api.dart @@ -395,7 +395,8 @@ class CoverageTask extends Task { // TODO: When dart2js has fixed the issue with their exitcode we should // rely on the exitcode instead of the stdout. isBrowserTest = pr.stdout != null && - (pr.stdout as String).contains('Error: Library not found'); + (pr.stdout as String) + .contains(new RegExp(r'Error: Library not (found|supported)')); } String _observatoryFailPattern = 'Could not start Observatory HTTP server'; diff --git a/lib/src/tasks/test/api.dart b/lib/src/tasks/test/api.dart index 97adcdce..b7df3916 100644 --- a/lib/src/tasks/test/api.dart +++ b/lib/src/tasks/test/api.dart @@ -46,8 +46,9 @@ TestTask test( StreamController stdoutc = new StreamController(); process.stdout.listen((line) { stdoutc.add(line); - if (line.contains('All tests passed!') || - line.contains('Some tests failed.')) { + if ((line.contains('All tests passed!') || + line.contains('Some tests failed.')) && + !outputProcessed.isCompleted) { task.testSummary = line; outputProcessed.complete(); } diff --git a/test/integration/coverage_test.dart b/test/integration/coverage_test.dart index d5b9afcc..0c1287b0 100644 --- a/test/integration/coverage_test.dart +++ b/test/integration/coverage_test.dart @@ -22,8 +22,8 @@ import 'package:dart_dev/util.dart' show TaskProcess; import 'package:test/test.dart'; const String projectWithDartFile = 'test/fixtures/coverage/non_test_file'; -const String projectWithVmTests = 'test/fixtures/coverage/browser'; -const String projectWithBrowserTests = 'test/fixtures/coverage/vm'; +const String projectWithBrowserTests = 'test/fixtures/coverage/browser'; +const String projectWithVmTests = 'test/fixtures/coverage/vm'; const String projectWithoutCoveragePackage = 'test/fixtures/coverage/no_coverage_package';