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
Show 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 {
...
@@ -152,7 +152,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
results
.
add
(
deviceID
);
results
.
add
(
deviceID
);
}
}
}
else
{
}
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 {
...
@@ -259,6 +259,7 @@ class AndroidDevice implements Device {
Future
<
Map
<
String
,
dynamic
>>
getMemoryStats
(
String
packageName
)
async
{
Future
<
Map
<
String
,
dynamic
>>
getMemoryStats
(
String
packageName
)
async
{
final
String
meminfo
=
await
shellEval
(
'dumpsys'
,
<
String
>[
'meminfo'
,
packageName
]);
final
String
meminfo
=
await
shellEval
(
'dumpsys'
,
<
String
>[
'meminfo'
,
packageName
]);
final
Match
match
=
new
RegExp
(
r'TOTAL\s+(\d+)'
).
firstMatch
(
meminfo
);
final
Match
match
=
new
RegExp
(
r'TOTAL\s+(\d+)'
).
firstMatch
(
meminfo
);
assert
(
match
!=
null
,
'could not parse dumpsys meminfo output'
);
return
<
String
,
dynamic
>{
return
<
String
,
dynamic
>{
'total_kb'
:
int
.
parse
(
match
.
group
(
1
)),
'total_kb'
:
int
.
parse
(
match
.
group
(
1
)),
};
};
...
...
dev/devicelab/lib/framework/utils.dart
View file @
d131a8df
...
@@ -173,7 +173,7 @@ Future<Process> startProcess(
...
@@ -173,7 +173,7 @@ Future<Process> startProcess(
String
workingDirectory
,
String
workingDirectory
,
})
async
{
})
async
{
final
String
command
=
'
$executable
${arguments?.join(" ") ?? ""}
'
;
final
String
command
=
'
$executable
${arguments?.join(" ") ?? ""}
'
;
print
(
'Executing:
$command
'
);
print
(
'
\n
Executing:
$command
'
);
environment
??=
<
String
,
String
>{};
environment
??=
<
String
,
String
>{};
environment
[
'BOT'
]
=
'true'
;
environment
[
'BOT'
]
=
'true'
;
final
Process
process
=
await
_processManager
.
start
(
final
Process
process
=
await
_processManager
.
start
(
...
@@ -184,8 +184,8 @@ Future<Process> startProcess(
...
@@ -184,8 +184,8 @@ Future<Process> startProcess(
final
ProcessInfo
processInfo
=
new
ProcessInfo
(
command
,
process
);
final
ProcessInfo
processInfo
=
new
ProcessInfo
(
command
,
process
);
_runningProcesses
.
add
(
processInfo
);
_runningProcesses
.
add
(
processInfo
);
process
.
exitCode
.
whenComplete
((
)
{
process
.
exitCode
.
then
((
int
exitCode
)
{
print
(
'
\n
'
);
// separate the output of this script from subsequent output to make logs easier to read
print
(
'
exitcode:
$exitCode
'
);
_runningProcesses
.
remove
(
processInfo
);
_runningProcesses
.
remove
(
processInfo
);
});
});
...
@@ -218,15 +218,22 @@ Future<int> exec(
...
@@ -218,15 +218,22 @@ Future<int> exec(
})
async
{
})
async
{
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
);
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
process
.
stdout
.
transform
(
UTF8
.
decoder
)
.
transform
(
UTF8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
transform
(
const
LineSplitter
())
.
listen
(
print
);
.
listen
((
String
line
)
{
print
(
'stdout:
$line
'
);
},
onDone:
()
{
stdoutDone
.
complete
();
});
process
.
stderr
process
.
stderr
.
transform
(
UTF8
.
decoder
)
.
transform
(
UTF8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
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
;
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
&&
!
canFail
)
if
(
exitCode
!=
0
&&
!
canFail
)
...
@@ -237,7 +244,7 @@ Future<int> exec(
...
@@ -237,7 +244,7 @@ Future<int> exec(
/// Executes a command and returns its standard output as a String.
/// 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
(
Future
<
String
>
eval
(
String
executable
,
String
executable
,
List
<
String
>
arguments
,
{
List
<
String
>
arguments
,
{
...
@@ -245,16 +252,31 @@ Future<String> eval(
...
@@ -245,16 +252,31 @@ Future<String> eval(
bool
canFail:
false
,
bool
canFail:
false
,
})
async
{
})
async
{
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
);
final
Process
process
=
await
startProcess
(
executable
,
arguments
,
environment:
environment
);
process
.
stderr
.
listen
((
List
<
int
>
data
)
{
stderr
.
add
(
data
);
final
StringBuffer
output
=
new
StringBuffer
();
});
final
Completer
<
Null
>
stdoutDone
=
new
Completer
<
Null
>();
final
String
output
=
await
UTF8
.
decodeStream
(
process
.
stdout
);
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
;
final
int
exitCode
=
await
process
.
exitCode
;
if
(
exitCode
!=
0
&&
!
canFail
)
if
(
exitCode
!=
0
&&
!
canFail
)
fail
(
'Executable failed with exit code
$exitCode
.'
);
fail
(
'Executable failed with exit code
$exitCode
.'
);
return
output
.
trimRight
();
return
output
.
t
oString
().
t
rimRight
();
}
}
Future
<
int
>
flutter
(
String
command
,
{
Future
<
int
>
flutter
(
String
command
,
{
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
d131a8df
...
@@ -41,6 +41,7 @@ class DriveCommand extends RunCommandBase {
...
@@ -41,6 +41,7 @@ class DriveCommand extends RunCommandBase {
DriveCommand
()
{
DriveCommand
()
{
argParser
.
addFlag
(
argParser
.
addFlag
(
'keep-app-running'
,
'keep-app-running'
,
defaultsTo:
null
,
negatable:
true
,
negatable:
true
,
help:
help:
'Will keep the Flutter application running when done testing.
\n
'
'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