-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[pigeon] added null safety flag for dart #222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,22 @@ test_pigeon_android() { | |
| rm -rf $temp_dir | ||
| } | ||
|
|
||
| # test_null_safe_dart(<path to pigeon file>) | ||
| # | ||
| # Compiles the pigeon file to a temp directory and attempts to run the dart | ||
| # analyzer on it with null safety turned on. | ||
| test_null_safe_dart() { | ||
| temp_dir=$(mktemp -d -t pigeon) | ||
|
|
||
| pub run pigeon \ | ||
| --input $1 \ | ||
| --dart_null_safety \ | ||
| --dart_out $temp_dir/pigeon.dart | ||
|
|
||
| dartanalyzer $temp_dir/pigeon.dart --fatal-infos --fatal-warnings --packages ./e2e_tests/test_objc/.packages --enable-experiment=non-nullable | ||
|
blasten marked this conversation as resolved.
|
||
| rm -rf $temp_dir | ||
| } | ||
|
|
||
| ############################################################################### | ||
| # Dart unit tests | ||
| ############################################################################### | ||
|
|
@@ -76,7 +92,7 @@ pub run test test/ | |
| ############################################################################### | ||
| # Execute without arguments test | ||
| ############################################################################### | ||
| pub run pigeon | ||
| pub run pigeon 1> /dev/null | ||
|
|
||
| ############################################################################### | ||
| # Compilation tests (Code is generated and compiled) | ||
|
|
@@ -88,6 +104,7 @@ pushd $PWD | |
| cd e2e_tests/test_objc/ | ||
| flutter pub get | ||
| popd | ||
| test_null_safe_dart ./pigeons/message.dart | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it make sense to test the other scenarios?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did it when I was developing but then I realized I don't think any of the other cases are exercising the code differently. The changes were in pieces of code that would have shown up in message.dart. |
||
| test_pigeon_android ./pigeons/voidflutter.dart | ||
| test_pigeon_android ./pigeons/voidhost.dart | ||
| test_pigeon_android ./pigeons/host2flutter.dart | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This is control via the SDK in pubspec.yaml, so there is no need to add
// @dart = 2.10There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need it for the dartanalyzer, maybe there is a command line flag that can replace it?