Skip to content

Commit 2df3125

Browse files
committed
Fixed missing STDOUT in Echo test
Fixed missing opening and closing brackets in {{start}}
1 parent 61b1d75 commit 2df3125

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

libraries/tests/mbed/echo/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ int main() {
2222

2323
Serial pc(TXPIN, RXPIN);
2424
pc.baud(115200);
25+
26+
pc.puts("{{");
2527
pc.puts(TEST_ENV_START); // Host test is expecting preamble
28+
pc.puts("}}");
2629

2730
while (1) {
2831
pc.gets(buf, 256);
29-
3032
pc.printf("%s", buf);
3133
}
3234
}

workspace_tools/host_tests/echo.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
limitations under the License.
1616
"""
1717
import uuid
18+
from sys import stdout
1819
from host_test import Test
1920

2021

@@ -28,12 +29,18 @@ def test(self):
2829
# Let's wait for Mbed to print its readiness, usually "{{start}}"
2930
if self.mbed.serial_timeout(None) is None:
3031
self.print_result("ioerr_serial")
31-
return
32+
return
3233

3334
c = self.mbed.serial_read(len('{{start}}'))
3435
if c is None:
3536
self.print_result("ioerr_serial")
3637
return
38+
print c
39+
stdout.flush()
40+
41+
if self.mbed.serial_timeout(1) is None:
42+
self.print_result("ioerr_serial")
43+
return
3744

3845
self.mbed.flush()
3946
self.notify("Starting the ECHO test")

workspace_tools/host_tests/stdio_auto.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ def run(self):
3737
if c is None:
3838
self.print_result("ioerr_serial")
3939
return
40+
print c
41+
stdout.flush()
42+
43+
if self.mbed.serial_timeout(1) is None:
44+
self.print_result("ioerr_serial")
45+
return
4046

4147
for i in range(1, 5):
4248
random_integer = random.randint(-99999, 99999)
@@ -64,7 +70,7 @@ def run(self):
6470
stdout.flush()
6571
break
6672
else:
67-
print "Error: No IP and port information sent from server"
73+
print "Error: No data from MUT sent"
6874
self.print_result('error')
6975
exit(-2)
7076

0 commit comments

Comments
 (0)