File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,18 @@ use std::thread::sleep;
4
4
use std:: time:: Duration ;
5
5
6
6
#[ test]
7
- fn flash ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
7
+ fn cli_tests ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
8
8
// board-info
9
9
let mut cmd: Command = Command :: cargo_bin ( "espflash" ) ?;
10
-
11
10
cmd. arg ( "board-info" ) ;
12
- cmd. assert ( ) . success ( ) ;
11
+
12
+ let binding = cmd. assert ( ) . success ( ) ;
13
+ let output = binding. get_output ( ) ;
14
+
15
+ let output_stdout = String :: from_utf8_lossy ( & output. stdout ) . to_string ( ) ;
16
+
17
+ assert ! ( output_stdout. contains( "esp32" ) ) ;
18
+ assert ! ( output_stdout. contains( "revision" ) ) ;
13
19
14
20
// flash
15
21
let image = std:: env:: var ( "ESPFLASH_APP" ) . expect ( "ESPFLASH_APP not set" ) ;
@@ -41,5 +47,6 @@ fn flash() -> Result<(), Box<dyn std::error::Error>> {
41
47
let output = child. wait_with_output ( ) . expect ( "Failed to read stdout" ) ;
42
48
let output = String :: from_utf8_lossy ( & output. stdout ) . to_string ( ) ;
43
49
assert ! ( output. contains( "Hello world!" ) ) ;
50
+
44
51
Ok ( ( ) )
45
52
}
You can’t perform that action at this time.
0 commit comments