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
d131a8df
Commit
d131a8df
authored
Jun 24, 2017
by
Ian Hickson
Committed by
GitHub
Jun 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix --keep-app-running default and make devicelab verboser (#10957)
parent
845c1b7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
12 deletions
+36
-12
adb.dart
dev/devicelab/lib/framework/adb.dart
+2
-1
utils.dart
dev/devicelab/lib/framework/utils.dart
+33
-11
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+1
-0
No files found.
dev/devicelab/lib/framework/adb.dart
View file @
d131a8df
...
...
@@ -152,7 +152,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
results
.
add
(
deviceID
);
}
}
else
{
throw
'Failed to parse device from adb output:
$line
'
;
throw
'Failed to parse device from adb output:
"
$line
"
'
;
}
}
...
...
@@ -259,6 +259,7 @@ class AndroidDevice implements Device {
Future
<
Map
<
String
,
dynamic
>>
getMemoryStats
(
String
packageName
)
async
{
final
String
meminfo
=
await
shellEval
(
'dumpsys'
,
<
String
>[
'meminfo'
,
packageName
]);
final
Match
match
=
new
RegExp
(
r'TOTAL\s+(\d+)'
).
firstMatch
(
meminfo
);
assert
(
match
!=
null
,
'could not parse dumpsys meminfo output'
);
return
<
String
,
dynamic
>{
'total_kb'
:
int
.
parse
(
match
.
group
(
1
)),
};
...
...
dev/devicelab/lib/framework/utils.dart
View file @
d131a8df
...
...
@@ -173,7 +173,7 @@ Future<Process> startProcess(
String
workingDirectory
,
})
async
{
final
String
command
=
'
$executable
${arguments?.join(" ") ?? ""}
'
;
print
(
'Executing:
$command
'
);
print
(
'
\n
Executing:
$command
'
);
environment
??=
<
String
,
String
>{};
environment
[
'BOT'
]
=
'true'
;
final
Process
process
=
await
_processManager
.
start
(
...
...
@@ -184,8 +184,8 @@ Future<Process> startProcess(
final
ProcessInfo
processInfo
=
new
ProcessInfo
(
command
,
process
);
_runningProcesses
.
add
(
processInfo
);
process
.
exitCode
.
whenComplete
((
)
{
print
(
'
\n
'
);
// separate the output of this script from subsequent output to make logs easier to read
process
.
exitCode
.
then
((
int
exitCode
)
{
print
(
'
exitcode:
$exitCode
'
);
_runningProcesses
.
remove
(
processInfo
);
});
...
...
@@ -218,15 +218,22 @@ Future<int> exec(
})
async
{
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
);
final
Completer
<
Null
>
stdoutDone
=
new
Completer
<
Null
>();
final
Completer
<
Null
>
stderrDone
=
new
Completer
<
Null
>();
process
.
stdout
.
transform
(
UTF8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
listen
(
print
);
.
listen
((
String
line
)
{
print
(
'stdout:
$line
'
);
},
onDone:
()
{
stdoutDone
.
complete
();
});
process
.
stderr
.
transform
(
UTF8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
listen
(
stderr
.
writeln
);
.
listen
((
String
line
)
{
print
(
'stderr:
$line
'
);
},
onDone:
()
{
stderrDone
.
complete
();
});
await
Future
.
wait
<
Null
>(<
Future
<
Null
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
&&
!
canFail
)
...
...
@@ -237,7 +244,7 @@ Future<int> exec(
/// Executes a command and returns its standard output as a String.
///
///
Standard error is redirected to the current process' standard error stream
.
///
For logging purposes, the command's output is also printed out
.
Future
<
String
>
eval
(
String
executable
,
List
<
String
>
arguments
,
{
...
...
@@ -245,16 +252,31 @@ Future<String> eval(
bool
canFail:
false
,
})
async
{
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
);
process
.
stderr
.
listen
((
List
<
int
>
data
)
{
stderr
.
add
(
data
);
});
final
String
output
=
await
UTF8
.
decodeStream
(
process
.
stdout
);
final
StringBuffer
output
=
new
StringBuffer
();
final
Completer
<
Null
>
stdoutDone
=
new
Completer
<
Null
>();
final
Completer
<
Null
>
stderrDone
=
new
Completer
<
Null
>();
process
.
stdout
.
transform
(
UTF8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
listen
((
String
line
)
{
print
(
'stdout:
$line
'
);
output
.
writeln
(
line
);
},
onDone:
()
{
stdoutDone
.
complete
();
});
process
.
stderr
.
transform
(
UTF8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
listen
((
String
line
)
{
print
(
'stderr:
$line
'
);
},
onDone:
()
{
stderrDone
.
complete
();
});
await
Future
.
wait
<
Null
>(<
Future
<
Null
>>[
stdoutDone
.
future
,
stderrDone
.
future
]);
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
&&
!
canFail
)
fail
(
'Executable failed with exit code
$exitCode
.'
);
return
output
.
trimRight
();
return
output
.
t
oString
().
t
rimRight
();
}
Future
<
int
>
flutter
(
String
command
,
{
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
d131a8df
...
...
@@ -41,6 +41,7 @@ class DriveCommand extends RunCommandBase {
DriveCommand
()
{
argParser
.
addFlag
(
'keep-app-running'
,
defaultsTo:
null
,
negatable:
true
,
help:
'Will keep the Flutter application running when done testing.
\n
'
...
...
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