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
3146e134
Commit
3146e134
authored
Mar 10, 2017
by
Yegor
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
print less in flutter_tool tests (fixes #8641) (#8699)
parent
d09591bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
+26
-14
executable.dart
packages/flutter_tools/lib/executable.dart
+24
-14
crash_reporting_test.dart
packages/flutter_tools/test/crash_reporting_test.dart
+2
-0
No files found.
packages/flutter_tools/lib/executable.dart
View file @
3146e134
...
...
@@ -149,6 +149,16 @@ Future<int> run(List<String> args, List<FlutterCommand> subCommands, {
});
}
/// Writes the [string] to one of the standard output streams.
@visibleForTesting
typedef
void
WriteCallback
(
[
String
string
]);
/// Writes a line to STDERR.
///
/// Overwrite this in tests to avoid spurious test output.
@visibleForTesting
WriteCallback
writelnStderr
=
stderr
.
writeln
;
Future
<
int
>
_handleToolError
(
dynamic
error
,
Chain
chain
,
...
...
@@ -158,9 +168,9 @@ Future<int> _handleToolError(
String
getFlutterVersion
(),
)
async
{
if
(
error
is
UsageException
)
{
stderr
.
writeln
(
error
.
message
);
stderr
.
writeln
();
stderr
.
writeln
(
writelnStderr
(
error
.
message
);
writelnStderr
();
writelnStderr
(
"Run 'flutter -h' (or 'flutter <command> -h') for available "
"flutter commands and options."
);
...
...
@@ -168,11 +178,11 @@ Future<int> _handleToolError(
return
_exit
(
64
);
}
else
if
(
error
is
ToolExit
)
{
if
(
error
.
message
!=
null
)
stderr
.
writeln
(
error
.
message
);
writelnStderr
(
error
.
message
);
if
(
verbose
)
{
stderr
.
writeln
();
stderr
.
writeln
(
chain
.
terse
.
toString
());
stderr
.
writeln
();
writelnStderr
();
writelnStderr
(
chain
.
terse
.
toString
());
writelnStderr
();
}
return
_exit
(
error
.
exitCode
??
1
);
}
else
if
(
error
is
ProcessExit
)
{
...
...
@@ -185,20 +195,20 @@ Future<int> _handleToolError(
}
}
else
{
// We've crashed; emit a log report.
stderr
.
writeln
();
writelnStderr
();
if
(!
reportCrashes
)
{
// Print the stack trace on the bots - don't write a crash report.
stderr
.
writeln
(
'
$error
'
);
stderr
.
writeln
(
chain
.
terse
.
toString
());
writelnStderr
(
'
$error
'
);
writelnStderr
(
chain
.
terse
.
toString
());
return
_exit
(
1
);
}
else
{
flutterUsage
.
sendException
(
error
,
chain
);
if
(
error
is
String
)
stderr
.
writeln
(
'Oops; flutter has exited unexpectedly: "
$error
".'
);
writelnStderr
(
'Oops; flutter has exited unexpectedly: "
$error
".'
);
else
stderr
.
writeln
(
'Oops; flutter has exited unexpectedly.'
);
writelnStderr
(
'Oops; flutter has exited unexpectedly.'
);
await
CrashReportSender
.
instance
.
sendReport
(
error:
error
,
...
...
@@ -207,13 +217,13 @@ Future<int> _handleToolError(
);
try
{
final
File
file
=
await
_createLocalCrashReport
(
args
,
error
,
chain
);
stderr
.
writeln
(
writelnStderr
(
'Crash report written to
${file.path}
;
\n
'
'please let us know at https://github.com/flutter/flutter/issues.'
,
);
return
_exit
(
1
);
}
catch
(
error
)
{
stderr
.
writeln
(
writelnStderr
(
'Unable to generate crash report due to secondary error:
$error
\n
'
'please let us know at https://github.com/flutter/flutter/issues.'
,
);
...
...
packages/flutter_tools/test/crash_reporting_test.dart
View file @
3146e134
...
...
@@ -23,12 +23,14 @@ void main() {
group
(
'crash reporting'
,
()
{
setUp
(()
async
{
tools
.
crashFileSystem
=
new
MemoryFileSystem
();
tools
.
writelnStderr
=
([
_
])
{
};
setExitFunctionForTests
((
_
)
{
});
enterTestingMode
();
});
tearDown
(()
{
tools
.
crashFileSystem
=
const
LocalFileSystem
();
tools
.
writelnStderr
=
stderr
.
writeln
;
restoreExitFunction
();
exitTestingMode
();
});
...
...
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