fix(tftf): Prevent UART from exiting early
Ensured all calls to exit_uart in 'expect' wait for the string
"Exiting tests." to prevent the uart from being closed before all of the
test result information has been written.
Signed-off-by: Nathan Dunne <Nathan.Dunne@arm.com>
Change-Id: I4793be8fd5a2bbf3e2a3a72e14b0d702d52e05e4
diff --git a/expect/tftf-aarch32.exp b/expect/tftf-aarch32.exp
index 2ac07c3..0b197b0 100644
--- a/expect/tftf-aarch32.exp
+++ b/expect/tftf-aarch32.exp
@@ -15,15 +15,15 @@
expect {
"Tests Failed : 0" {
- puts "<<TFTF Success>>"
+ expect_string "Exiting tests." "<<TFTF Success>>"
exit_uart 0
}
"Tests Passed : 0" {
- puts "<<TFTF no tests passed>>"
+ expect_string "Exiting tests." "<<TFTF no tests passed>>"
exit_uart -1
}
-re "Tests Failed : \[^0]" {
- puts "<<TFTF Fail>>"
+ expect_string "Exiting tests." "<<TFTF Fail>>"
exit_uart -1
}
timeout {
diff --git a/expect/tftf.exp b/expect/tftf.exp
index bcc04fc..87a5f33 100644
--- a/expect/tftf.exp
+++ b/expect/tftf.exp
@@ -19,11 +19,11 @@
exit_uart 0
}
"Tests Passed : 0" {
- puts "<<TFTF no tests passed>>"
+ expect_string "Exiting tests." "<<TFTF no tests passed>>"
exit_uart -1
}
-re "Tests Failed : \[^0]" {
- puts "<<TFTF Fail>>"
+ expect_string "Exiting tests." "<<TFTF Fail>>"
exit_uart -1
}
timeout {
diff --git a/lava-expect/tftf-aarch32.exp b/lava-expect/tftf-aarch32.exp
index 94d0259..9d6f628 100644
--- a/lava-expect/tftf-aarch32.exp
+++ b/lava-expect/tftf-aarch32.exp
@@ -15,5 +15,8 @@
expect_string+=("i;${prompt}")
prompt='Tests Failed : 0'
+expect_string+=("i;${prompt}")
+
+prompt='Exiting tests.'
failures='Tests Passed : 0'
expect_string+=("i;${prompt};;${failures}")