Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
7f400af3
Unverified
Commit
7f400af3
authored
May 12, 2020
by
Jonah Williams
Committed by
GitHub
May 12, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] expand Regexp log match to include more AndroidRuntime failures (#56943)
parent
7ed0950e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+2
-0
adb_log_reader_test.dart
...tools/test/general.shard/android/adb_log_reader_test.dart
+39
-0
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
7f400af3
...
...
@@ -986,6 +986,7 @@ class AdbLogReader extends DeviceLogReader {
RegExp
(
r'^[VDIWEF]\/flutter[^:]*:\s+'
,
caseSensitive:
false
),
RegExp
(
r'^[IE]\/DartVM[^:]*:\s+'
),
RegExp
(
r'^[WEF]\/AndroidRuntime:\s+'
),
RegExp
(
r'^[WEF]\/AndroidRuntime\([0-9]+\):\s+'
),
RegExp
(
r'^[WEF]\/ActivityManager:\s+.*(\bflutter\b|\bdomokit\b|\bsky\b)'
),
RegExp
(
r'^[WEF]\/System\.err:\s+'
),
RegExp
(
r'^[F]\/[\S^:]+:\s+'
),
...
...
@@ -1019,6 +1020,7 @@ class AdbLogReader extends DeviceLogReader {
}
final
Match
timeMatch
=
AndroidDevice
.
_timeRegExp
.
firstMatch
(
line
);
if
(
timeMatch
==
null
||
line
.
length
==
timeMatch
.
end
)
{
_acceptedLastLine
=
false
;
return
;
}
// Chop off the time.
...
...
packages/flutter_tools/test/general.shard/android/adb_log_reader_test.dart
View file @
7f400af3
...
...
@@ -13,6 +13,11 @@ import '../../src/context.dart';
const
int
kLollipopVersionCode
=
21
;
const
String
kLastLogcatTimestamp
=
'11-27 15:39:04.506'
;
/// By default the android log reader accepts lines that match no patterns
/// if the previous line was a match. Include an intentionally non-matching
/// line as the first input to disable this behavior.
const
String
kDummyLine
=
'Contents are not important
\n
'
;
void
main
(
)
{
testWithoutContext
(
'AdbLogReader calls adb logcat with expected flags apiVersion 21'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
...
...
@@ -128,6 +133,40 @@ void main() {
logReader
.
dispose
();
await
onDone
.
future
;
});
testWithoutContext
(
'AdbLogReader does not filter output from AndroidRuntime crashes'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
FakeCommand
(
command:
const
<
String
>[
'adb'
,
'-s'
,
'1234'
,
'logcat'
,
'-v'
,
'time'
,
],
completer:
Completer
<
void
>.
sync
(),
// Example stack trace from an incorrectly named application:name in the AndroidManfiest.xml
stdout:
kDummyLine
+
'05-11 12:54:46.665 E/AndroidRuntime(11787): FATAL EXCEPTION: main
\n
'
'05-11 12:54:46.665 E/AndroidRuntime(11787): Process: com.example.foobar, PID: 11787
\n
'
'05-11 12:54:46.665 java.lang.RuntimeException: Unable to instantiate application '
'io.flutter.app.FlutterApplication2: java.lang.ClassNotFoundException:
\n
'
,
)
]);
final
AdbLogReader
logReader
=
await
AdbLogReader
.
createLogReader
(
createMockDevice
(
null
),
processManager
,
);
await
expectLater
(
logReader
.
logLines
,
emitsInOrder
(<
String
>[
'E/AndroidRuntime(11787): FATAL EXCEPTION: main'
,
'E/AndroidRuntime(11787): Process: com.example.foobar, PID: 11787'
,
'java.lang.RuntimeException: Unable to instantiate application io.flutter.app.FlutterApplication2: java.lang.ClassNotFoundException:'
,
]));
logReader
.
dispose
();
});
}
MockAndroidDevice
createMockDevice
(
int
sdkLevel
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment