add not hit files to coverage percentage

This commit is contained in:
Vadim 2023-10-07 00:11:39 +02:00
parent fce20c7154
commit 069a07214c
2 changed files with 8 additions and 0 deletions

1
.gitignore vendored
View file

@ -60,4 +60,5 @@ ios/Runner/GoogleService-Info.plist
/lib/firebase_options.dart /lib/firebase_options.dart
coverage/ coverage/
test/coverage_helper_test.dart
screenshots/ screenshots/

View file

@ -1,4 +1,11 @@
flutter test --coverage flutter test --coverage
file=test/coverage_helper_test.dart
echo "// Helper file to make coverage work for all dart files\n" > $file
echo "// ignore_for_file: unused_import, directives_ordering" >> $file
find lib '!' -path '*generated*/*' '!' -name '*.g.dart' '!' -name '*.part.dart' -name '*.dart' | cut -c4- | awk -v package=$1 '{printf "import '\''package:lightmeter%s%s'\'';\n", package, $1}' >> $file
echo "void main() {}" >> $file
lcov --remove coverage/lcov.info 'lib/generated/*' 'lib/l10n/*' -o coverage/new_lcov.info lcov --remove coverage/lcov.info 'lib/generated/*' 'lib/l10n/*' -o coverage/new_lcov.info
genhtml coverage/new_lcov.info -o coverage/html genhtml coverage/new_lcov.info -o coverage/html
open coverage/html/index.html open coverage/html/index.html