Last active
October 1, 2018 10:26
-
-
Save apaatsio/eed9ada2c0a17a614190b04938312faf to your computer and use it in GitHub Desktop.
lcov report shows coverage only for some asserts in Flutter 0.8.2; https://github.com/flutter/flutter/issues/22508
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void successfulAsserts(int x) { | |
assert(true); | |
assert(x != null); | |
assert(x == 1); | |
int foo = 1; | |
assert(foo == 1); | |
} | |
void failingAssert() { | |
assert(false); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:test/test.dart'; | |
import 'package:flutter_assert_test_coverage/assert.dart'; | |
void main() { | |
test('successful asserts', () { | |
successfulAsserts(1); | |
}); | |
test('failing assert', () { | |
failingAssert(); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ flutter analyze | |
Analyzing flutter_assert_test_coverage... | |
No issues found! (ran in 0.9s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ flutter doctor --verbose | |
[✓] Flutter (Channel beta, v0.8.2, on Linux, locale en_US.UTF-8) | |
• Flutter version 0.8.2 at /home/antti/tools/flutter | |
• Framework revision 5ab9e70727 (3 weeks ago), 2018-09-07 12:33:05 -0700 | |
• Engine revision 58a1894a1c | |
• Dart version 2.1.0-dev.3.1.flutter-760a9690c2 | |
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.2) | |
• Android SDK at /home/antti/Android/Sdk | |
• Android NDK location not configured (optional; useful for native profiling support) | |
• Platform android-28, build-tools 28.0.2 | |
• Java binary at: /snap/android-studio/53/android-studio/jre/bin/java | |
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) | |
• All Android licenses accepted. | |
[✓] Android Studio (version 3.1) | |
• Android Studio at /snap/android-studio/53/android-studio | |
✗ Flutter plugin not installed; this adds Flutter specific functionality. | |
✗ Dart plugin not installed; this adds Dart specific functionality. | |
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01) | |
[✓] VS Code (version 1.27.2) | |
• VS Code at /usr/share/code | |
• Flutter extension version 2.18.0 | |
[!] Connected devices | |
! No devices available | |
! Doctor found issues in 1 category. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❯ flutter test --coverage --verbose | |
[ +74 ms] executing: [/home/antti/tools/flutter/] git rev-parse --abbrev-ref --symbolic @{u} | |
[ +83 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} | |
[ ] origin/beta | |
[ ] executing: [/home/antti/tools/flutter/] git rev-parse --abbrev-ref HEAD | |
[ +24 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD | |
[ ] beta | |
[ ] executing: [/home/antti/tools/flutter/] git ls-remote --get-url origin | |
[ +28 ms] Exit code 0 from: git ls-remote --get-url origin | |
[ ] https://github.com/flutter/flutter.git | |
[ ] executing: [/home/antti/tools/flutter/] git log -n 1 --pretty=format:%H | |
[ +24 ms] Exit code 0 from: git log -n 1 --pretty=format:%H | |
[ ] 5ab9e70727d858def3a586db7fb98ee580352957 | |
[ ] executing: [/home/antti/tools/flutter/] git log -n 1 --pretty=format:%ar | |
[ +31 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar | |
[ +1 ms] 3 weeks ago | |
[ +2 ms] executing: [/home/antti/tools/flutter/] git describe --match v*.*.* --first-parent --long --tags | |
[ +27 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags | |
[ +4 ms] v0.8.2-0-g5ab9e70 | |
[ +888 ms] switching to directory LocalDirectory: 'test' to run tests | |
[ +2 ms] running test package with arguments: [-r, compact, --concurrency=1, --, /home/antti/projects/flutter_assert_test_coverage/test/assert_test.dart] | |
00:00 +0: loading /home/antti/projects/flutter_assert_test_coverage/test/assert_test.dart [ +331 ms] test 0: starting test /home/antti/projects/flutter_assert_test_coverage/test/assert_test.dart | |
[ +49 ms] test 0: starting shell process | |
[ +7 ms] Stopping scan for flutter_test_config.dart; found project root at /home/antti/projects/flutter_assert_test_coverage | |
[ +5 ms] Compiler will use the following file as its incremental dill file: /tmp/flutter_test_compiler.LVHLNL/output.dill | |
[ ] Listening to compiler controller... | |
[ +7 ms] Compiling /tmp/flutter_test_listener.EVYRWM/listener.dart | |
[ +16 ms] /home/antti/tools/flutter/bin/cache/dart-sdk/bin/dart /home/antti/tools/flutter/bin/cache/artifacts/engine/linux-x64/frontend_server.dart.snapshot --sdk-root /home/antti/tools/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --incremental --strong --target=flutter --output-dill /tmp/flutter_test_compiler.LVHLNL/output.dill --packages /home/antti/projects/flutter_assert_test_coverage/.packages --initialize-from-dill /home/antti/projects/flutter_assert_test_coverage/build/testfile.dill | |
00:04 +0: loading /home/antti/projects/flutter_assert_test_coverage/test/assert_test.dart [+4323 ms] Compiling /tmp/flutter_test_listener.EVYRWM/listener.dart took 4340ms | |
[ +3 ms] Copying platform_strong.dill file from /home/antti/tools/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill | |
[ +11 ms] /home/antti/tools/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester --flutter-assets-dir=/tmp/flutter_test_bundle.BDLEHS --enable-checked-mode --enable-software-rendering --skia-deterministic-rendering --enable-dart-profiling --non-interactive --use-test-fonts --packages=/home/antti/projects/flutter_assert_test_coverage/.packages /tmp/flutter_test_listener.EVYRWM/listener.dart.dill | |
[ +2 ms] Using this directory for fonts configuration: /tmp/flutter_test_fonts.YTUKYY | |
[ +36 ms] test 0: awaiting initial result for pid 11928 | |
[ +291 ms] Shell: Observatory listening on http://127.0.0.1:41857/ | |
[ +1 ms] test 0: using observatory uri http://127.0.0.1:41857/ from pid 11928 | |
00:05 +0: loading /home/antti/projects/flutter_assert_test_coverage/test/assert_test.dart [ +752 ms] test 0: process with pid 11928 connected to test harness | |
[ +2 ms] test 0: awaiting test result for pid 11928 | |
00:06 +1 -1: failing assert [E] | |
'package:flutter_assert_test_coverage/assert.dart': Failed assertion: line 10 pos 10: 'false': is not true. | |
dart:core _AssertionError._throwNew | |
package:flutter_assert_test_coverage/assert.dart 10:10 failingAssert | |
assert_test.dart 9:5 main.<fn> | |
[ +483 ms] test 0: process with pid 11928 no longer needed by test harness | |
[ +1 ms] test 0: collecting coverage | |
[ +2 ms] pid 11928: collecting coverage data from http://127.0.0.1:41857/... | |
[+20605 ms] pid 11928 (http://127.0.0.1:41857/): collected coverage data; merging... | |
[ +111 ms] pid 11928 (http://127.0.0.1:41857/): done merging coverage data into global coverage map. | |
[ ] test 0: cleaning up... | |
[ +1 ms] test 0: ensuring end-of-process for shell | |
[ +38 ms] test 0: deleting temporary bundle directory | |
[ +5 ms] test 0: deleting temporary directory | |
[ +6 ms] test 0: shutting down test harness socket server | |
[ +5 ms] test 0: finished | |
00:26 +1 -1: Some tests failed. | |
[ +76 ms] Deleting /tmp/flutter_test_compiler.LVHLNL... | |
[ +4 ms] Deleting /tmp/flutter_test_fonts.YTUKYY... | |
[ ] test package returned with exit code 1 | |
[ +3 ms] Collecting coverage information... | |
[ +2 ms] formating coverage data | |
[ +67 ms] Collecting coverage information... (completed) | |
[ ] coverage information collection complete | |
[ +4 ms] wrote coverage data to coverage/lcov.info (size=83) | |
[ +36 ms] "flutter test" took 28,037ms. | |
#0 throwToolExit (package:flutter_tools/src/base/common.dart:26:3) | |
#1 TestCommand.runCommand (package:flutter_tools/src/commands/test.dart:182:7) | |
<asynchronous suspension> | |
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18) | |
#3 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64) | |
#4 _rootRunUnary (dart:async/zone.dart:1132:38) | |
#5 _CustomZone.runUnary (dart:async/zone.dart:1029:19) | |
#6 _FutureListener.handleValue (dart:async/future_impl.dart:129:18) | |
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45) | |
#8 Future._propagateToListeners (dart:async/future_impl.dart:671:32) | |
#9 Future._complete (dart:async/future_impl.dart:476:7) | |
#10 _SyncCompleter.complete (dart:async/future_impl.dart:51:12) | |
#11 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20) | |
#12 _rootRun (dart:async/zone.dart:1124:13) | |
#13 _CustomZone.run (dart:async/zone.dart:1021:19) | |
#14 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23) | |
#15 _microtaskLoop (dart:async/schedule_microtask.dart:41:21) | |
#16 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5) | |
#17 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13) | |
#18 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SF:lib/assert.dart | |
DA:1,1 | |
DA:2,0 | |
DA:3,0 | |
DA:4,1 | |
DA:6,1 | |
DA:9,1 | |
DA:10,1 | |
end_of_record |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment