Fixed missing STDOUT in Echo test

Fixed missing opening and closing brackets in {{start}}
pull/477/head
Przemek Wirkus 2014-09-03 15:01:19 +01:00
parent 61b1d75032
commit 2df3125ca4
3 changed files with 18 additions and 3 deletions

View File

@ -22,11 +22,13 @@ int main() {
Serial pc(TXPIN, RXPIN);
pc.baud(115200);
pc.puts("{{");
pc.puts(TEST_ENV_START); // Host test is expecting preamble
pc.puts("}}");
while (1) {
pc.gets(buf, 256);
pc.printf("%s", buf);
}
}

View File

@ -15,6 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
"""
import uuid
from sys import stdout
from host_test import Test
@ -28,12 +29,18 @@ class EchoTest(Test):
# Let's wait for Mbed to print its readiness, usually "{{start}}"
if self.mbed.serial_timeout(None) is None:
self.print_result("ioerr_serial")
return
return
c = self.mbed.serial_read(len('{{start}}'))
if c is None:
self.print_result("ioerr_serial")
return
print c
stdout.flush()
if self.mbed.serial_timeout(1) is None:
self.print_result("ioerr_serial")
return
self.mbed.flush()
self.notify("Starting the ECHO test")

View File

@ -37,6 +37,12 @@ class StdioTest(DefaultTest):
if c is None:
self.print_result("ioerr_serial")
return
print c
stdout.flush()
if self.mbed.serial_timeout(1) is None:
self.print_result("ioerr_serial")
return
for i in range(1, 5):
random_integer = random.randint(-99999, 99999)
@ -64,7 +70,7 @@ class StdioTest(DefaultTest):
stdout.flush()
break
else:
print "Error: No IP and port information sent from server"
print "Error: No data from MUT sent"
self.print_result('error')
exit(-2)