Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // These tests fork a second VM process that runs the script | 5 // These tests fork a second VM process that runs the script |
| 6 // ``tools/full-coverage.dart'' and verifies that the tool | 6 // ``tools/full-coverage.dart'' and verifies that the tool |
| 7 // produces the expeced output. | 7 // produces the expeced output. |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'dart:convert'; | 10 import 'dart:convert'; |
| 11 import 'dart:io'; | 11 import 'dart:io'; |
| 12 | 12 |
| 13 import 'package:path/path.dart' as path; | 13 import 'package:path/path.dart' as path; |
| 14 import 'package:unittest/unittest.dart'; | 14 import 'package:unittest/unittest.dart'; |
| 15 | 15 |
| 16 final String coverageScript = "tools/full-coverage.dart"; | 16 final String coverageScript = |
| 17 Platform.script.resolve('../../tools/full-coverage.dart').toFilePath(); | |
|
Ivan Posva
2015/02/05 14:46:20
Do / work on windows?
ricow1
2015/02/05 15:08:34
apparently so
| |
| 17 final String packageRoot = Platform.packageRoot; | 18 final String packageRoot = Platform.packageRoot; |
| 18 final List dartBaseArgs = ['--package-root=${packageRoot}', '--checked',]; | 19 final List dartBaseArgs = ['--package-root=${packageRoot}', '--checked',]; |
| 19 | 20 |
| 20 // With line numbers starting at 0, the list of hits can be understood as | 21 // With line numbers starting at 0, the list of hits can be understood as |
| 21 // follows: | 22 // follows: |
| 22 // * -1: No coverage data on this line. | 23 // * -1: No coverage data on this line. |
| 23 // * 0: No hits on this line. | 24 // * 0: No hits on this line. |
| 24 // * 1: ``Some'' hits on this line. | 25 // * 1: ``Some'' hits on this line. |
| 25 final coverageTests = [ | 26 final coverageTests = [ |
| 26 { | 27 { |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 String programPath = path.join(programDir, "${cTest['name']}.dart"); | 223 String programPath = path.join(programDir, "${cTest['name']}.dart"); |
| 223 testCoverage(programDir, programPath, | 224 testCoverage(programDir, programPath, |
| 224 new LcovDescriptor(programPath), | 225 new LcovDescriptor(programPath), |
| 225 new List.from(cTest['expectedHits'])); | 226 new List.from(cTest['expectedHits'])); |
| 226 testCoverage(programDir, programPath, | 227 testCoverage(programDir, programPath, |
| 227 new PrettyPrintDescriptor(programPath), | 228 new PrettyPrintDescriptor(programPath), |
| 228 new List.from(cTest['expectedHits'])); | 229 new List.from(cTest['expectedHits'])); |
| 229 }); | 230 }); |
| 230 }); | 231 }); |
| 231 } | 232 } |
| OLD | NEW |