File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ fn main() {
22
22
. arg ( & test)
23
23
. arg ( & dst)
24
24
. status ( )
25
- . expect ( "failed to run: adb pushr " ) ;
25
+ . expect ( "failed to run: adb push " ) ;
26
26
assert ! ( status. success( ) ) ;
27
27
28
28
let output = Command :: new ( "adb" )
@@ -33,16 +33,17 @@ fn main() {
33
33
. expect ( "failed to run: adb shell" ) ;
34
34
assert ! ( status. success( ) ) ;
35
35
36
+ let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
37
+ let stderr = String :: from_utf8_lossy ( & output. stderr ) ;
38
+
36
39
println ! ( "status: {}\n stdout ---\n {}\n stderr ---\n {}" ,
37
40
output. status,
38
- String :: from_utf8_lossy ( & output . stdout) ,
39
- String :: from_utf8_lossy ( & output . stderr) ) ;
41
+ stdout,
42
+ stderr) ;
40
43
41
- let stdout = String :: from_utf8_lossy ( & output. stdout ) ;
42
- stdout. lines ( ) . find ( |l|
43
- ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) ||
44
- l. starts_with ( "test result: ok" )
45
- ) . unwrap_or_else ( || {
44
+ if !stderr. lines ( ) . any ( |l| ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) || l. starts_with ( "test result: ok" ) )
45
+ && !stdout. lines ( ) . any ( |l| ( l. starts_with ( "PASSED " ) && l. contains ( " tests" ) ) || l. starts_with ( "test result: ok" ) )
46
+ {
46
47
panic ! ( "failed to find successful test run" ) ;
47
- } ) ;
48
+ } ;
48
49
}
You can’t perform that action at this time.
0 commit comments