aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/hello_world/run_mambo_hello_world.sh16
-rwxr-xr-xtest/hello_world/run_qemu_hello_world.sh16
-rwxr-xr-xtest/run.sh16
-rwxr-xr-xtest/run_mambo_boot_test.sh18
4 files changed, 62 insertions, 4 deletions
diff --git a/test/hello_world/run_mambo_hello_world.sh b/test/hello_world/run_mambo_hello_world.sh
index ba28a21..1589bd0 100755
--- a/test/hello_world/run_mambo_hello_world.sh
+++ b/test/hello_world/run_mambo_hello_world.sh
@@ -31,6 +31,10 @@ export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel
OLD_ULIMIT_C=`ulimit -c`
ulimit -c 0
+t=$(tempfile) || exit 1
+
+trap "rm -f -- '$t'" EXIT
+
( cd external/mambo;
cat <<EOF | expect
set timeout 30
@@ -43,7 +47,17 @@ eof { send_user "\nUnexpected EOF\n;" exit 1 }
wait
exit 0
EOF
-)
+) 2>&1 > $t
+
+r=$?
+if [ $r != 0 ]; then
+ cat $t
+ exit $r
+fi
+
ulimit -c $OLD_ULIMIT_C
+
echo
+rm -f -- "$t"
+trap - EXIT
exit 0;
diff --git a/test/hello_world/run_qemu_hello_world.sh b/test/hello_world/run_qemu_hello_world.sh
index 3292178..9a85b3d 100755
--- a/test/hello_world/run_qemu_hello_world.sh
+++ b/test/hello_world/run_qemu_hello_world.sh
@@ -27,6 +27,9 @@ fi
export SKIBOOT_ZIMAGE=`pwd`/test/hello_world/hello_kernel/hello_kernel
+t=$(tempfile) || exit 1
+
+trap "rm -f -- '$t'" EXIT
(
cat <<EOF | expect
@@ -41,5 +44,16 @@ close
wait
exit 0
EOF
-)
+) 2>&1 > $t
+
+r=$?
+if [ $r != 0 ]; then
+ cat $t
+ exit $r
+fi
+
+echo
+rm -f -- "$t"
+trap - EXIT
+
exit 0;
diff --git a/test/run.sh b/test/run.sh
new file mode 100755
index 0000000..5185f5a
--- /dev/null
+++ b/test/run.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+t=$(tempfile) || exit 1
+
+trap "rm -f -- '$t'" EXIT
+
+$* 2>&1 > $t
+r=$?
+if [ $r != 0 ]; then
+ cat $t
+ exit $r
+fi
+
+rm -f -- "$t"
+trap - EXIT
+exit 0
diff --git a/test/run_mambo_boot_test.sh b/test/run_mambo_boot_test.sh
index 8ae7fda..f398477 100755
--- a/test/run_mambo_boot_test.sh
+++ b/test/run_mambo_boot_test.sh
@@ -41,6 +41,10 @@ fi
OLD_ULIMIT_C=`ulimit -c`
ulimit -c 0
+t=$(tempfile) || exit 1
+
+trap "rm -f -- '$t'" EXIT
+
( cd external/mambo;
cat <<EOF | expect
set timeout 600
@@ -53,7 +57,17 @@ eof { send_user "\nUnexpected EOF\n;" exit 1 }
wait
exit 0
EOF
-)
+) 2>&1 > $t
+
+r=$?
+if [ $r != 0 ]; then
+ cat $t
+ exit $r
+fi
+
ulimit -c $OLD_ULIMIT_C
+
echo
-exit 0;
+rm -f -- "$t"
+trap - EXIT
+exit 0