From 666d349a517d0f58196d517126737919833b7adf Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sat, 4 Jan 2020 00:37:57 +0100 Subject: [PATCH] Fix runner.rb not propagating QEMU exit status --- 13_integrated_testing/README.md | 3 ++- 13_integrated_testing/tests/runner.rb | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/13_integrated_testing/README.md b/13_integrated_testing/README.md index ca419c0c..6215ef0d 100644 --- a/13_integrated_testing/README.md +++ b/13_integrated_testing/README.md @@ -389,7 +389,8 @@ def exec begin @output << io.read_nonblock(1024) rescue EOFError - error = false + io.close + error = $CHILD_STATUS.to_i != 0 break end end diff --git a/13_integrated_testing/tests/runner.rb b/13_integrated_testing/tests/runner.rb index 34c875bf..157f2514 100755 --- a/13_integrated_testing/tests/runner.rb +++ b/13_integrated_testing/tests/runner.rb @@ -5,6 +5,7 @@ # # Copyright (c) 2019-2020 Andre Richter +require 'English' require 'pty' # Test base class. @@ -109,7 +110,8 @@ class RawTest < Test begin @output << io.read_nonblock(1024) rescue EOFError - error = false + io.close + error = $CHILD_STATUS.to_i != 0 break end end