summaryrefslogtreecommitdiff
path: root/ci/test-runner-linux
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2019-01-31 22:34:17 -0700
committerAlan Somers <asomers@gmail.com>2019-02-05 08:26:17 -0700
commit38cf5b15c61b6c4f76b30da34b7c70b8ee5ff6de (patch)
tree250f97c288a9fb8bd6130a938ad36ef39d8ff453 /ci/test-runner-linux
parenteddc8d342b6371b55cb8910fc8365ce0a3880f50 (diff)
downloadrust-libc-38cf5b15c61b6c4f76b30da34b7c70b8ee5ff6de.tar.gz
Add an integration test for the cmsg(3) functions.
Since these are defined in C as macros, they must be reimplemented in libc as Rust functions. They're hard to get exactly right, and they vary from platform to platform. The test builds custom C code that uses the real macros, and compares its output to the Rust versions' output for various inputs. Skip the CMSG_NXTHDR test on sparc64 linux because it hits a Bus Error. Issue #1239 Skip the entire cmsg test program on s390x because it dumps core seemingly before the kernel finishes booting. Issue #1240
Diffstat (limited to 'ci/test-runner-linux')
-rwxr-xr-xci/test-runner-linux15
1 files changed, 13 insertions, 2 deletions
diff --git a/ci/test-runner-linux b/ci/test-runner-linux
index 5f1fb237c2..569fa00770 100755
--- a/ci/test-runner-linux
+++ b/ci/test-runner-linux
@@ -5,7 +5,18 @@ set -e
arch=$1
prog=$2
+# Skip cmsg test on linux-s390x
+# https://github.com/rust-lang/libc/issues/1240
+if [ "$arch" = "s390x" ]; then
+ progbasename=`basename $prog`
+ if [ "${progbasename%%-*}" = "cmsg" ]; then
+ exit 0
+ fi
+fi
+
cd /qemu/init
+echo "#!/bin/sh\n/prog --color=never" > run_prog.sh
+chmod +x run_prog.sh
cp -f $2 prog
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
cd ..
@@ -15,9 +26,9 @@ timeout 30s qemu-system-$arch \
-nographic \
-kernel kernel \
-initrd initrd.gz \
- -append init=/prog > output || true
+ -append init=/run_prog.sh > output || true
# remove kernel messages
tr -d '\r' < output | egrep -v '^\['
-grep PASSED output > /dev/null
+egrep "(PASSED)|(test result: ok)" output > /dev/null