forked from firka/flutter
Add coveralls support to Travis (#4690)
This patch causes us to upload a coverage report to coveralls.io.
This commit is contained in:
@@ -6,10 +6,14 @@ addons:
|
||||
- ubuntu-toolchain-r-test # if we don't specify this, the libstdc++6 we get is the wrong version
|
||||
packages:
|
||||
- libstdc++6
|
||||
install:
|
||||
- gem install coveralls-lcov
|
||||
before_script:
|
||||
- ./dev/bots/setup.sh
|
||||
script:
|
||||
- ./dev/bots/test.sh
|
||||
after_success:
|
||||
- coveralls-lcov packages/flutter/coverage/lcov.info
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.pub-cache
|
||||
|
||||
@@ -23,8 +23,13 @@ flutter analyze --flutter-repo
|
||||
(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)
|
||||
|
||||
COVERAGE_FLAG=
|
||||
if [ -n $TRAVIS ]; then
|
||||
COVERAGE_FLAG=--coverage
|
||||
fi
|
||||
|
||||
# run tests
|
||||
(cd packages/flutter; flutter test)
|
||||
(cd packages/flutter; flutter test $COVERAGE_FLAG)
|
||||
(cd packages/flutter_driver; dart -c test/all.dart)
|
||||
(cd packages/flutter_sprites; flutter test)
|
||||
(cd packages/flutter_test; flutter test)
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'dart:io';
|
||||
import 'package:coverage/coverage.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import '../dart/package_map.dart';
|
||||
import '../globals.dart';
|
||||
|
||||
class CoverageCollector {
|
||||
@@ -61,9 +62,7 @@ class CoverageCollector {
|
||||
assert(enabled);
|
||||
await finishPendingJobs();
|
||||
printTrace('formating coverage data');
|
||||
// TODO(abarth): Use PackageMap.globalPackagesPath once
|
||||
// https://github.com/dart-lang/coverage/issues/100 is fixed.
|
||||
Resolver resolver = new Resolver(packageRoot: path.absolute('packages'));
|
||||
Resolver resolver = new Resolver(packagesPath: PackageMap.globalPackagesPath);
|
||||
Formatter formater = new LcovFormatter(resolver);
|
||||
List<String> reportOn = <String>[path.join(Directory.current.path, 'lib')];
|
||||
return await formater.format(_globalHitmap, reportOn: reportOn);
|
||||
|
||||
@@ -10,7 +10,7 @@ environment:
|
||||
dependencies:
|
||||
archive: ^1.0.20
|
||||
args: ^0.13.4
|
||||
coverage: ^0.7.7
|
||||
coverage: ^0.7.8
|
||||
crypto: '>=1.1.1 <3.0.0'
|
||||
file: ^0.1.0
|
||||
http: ^0.11.3
|
||||
@@ -18,7 +18,7 @@ dependencies:
|
||||
json_schema: ^1.0.3
|
||||
linter: ^0.1.17
|
||||
mustache4dart: ^1.0.0
|
||||
package_config: ^0.1.3
|
||||
package_config: '>=0.1.5 <2.0.0'
|
||||
path: ^1.3.0
|
||||
pub_semver: ^1.0.0
|
||||
stack_trace: ^1.4.0
|
||||
|
||||
Reference in New Issue
Block a user