diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2021-12-29 19:54:11 +0100 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2021-12-29 20:01:38 +0100 |
commit | 381c519c65c9c05a2c6245c6c507830c4414da82 (patch) | |
tree | 06e8d66236e69f1c676f4800b2892cb792eecebb | |
parent | fdbffae92a7213e9ca8c5cfbb538b2d1dd2b897a (diff) | |
download | klibc-maint-381c519c65c9c05a2c6245c6c507830c4414da82.tar.gz |
test-many-klibcs: Make sure shell runs external commands with local QEMU
Due to bugs in QEMU user-mode emulation, I want to be able to run all
klibc tests with a locally built QEMU in a chroot or container, and
not whatever version the host may have registered with binfmt_misc.
Currently run_built explicitly invokes QEMU, but the shell test
invoking an external command does not. Fix that.
-rwxr-xr-x | test-many-klibcs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test-many-klibcs b/test-many-klibcs index 3f33e0b..827bc66 100755 --- a/test-many-klibcs +++ b/test-many-klibcs @@ -65,18 +65,21 @@ clean() { rm -rf "build/$tools-$toolsarch" } -run_built() { +qemu_prefix() { # XXX We assume build architecture is x86_64 case "$arch" in i386 | x86_64) - "$@" ;; *) - "qemu-$qemuarch-static" -- "$@" + echo "qemu-$qemuarch-static --" ;; esac } +run_built() { + $(qemu_prefix) "$@" +} + patch_interp() { # Patching in a longer interpreter name can break things, so # use a short-ish relative filename @@ -180,12 +183,12 @@ run_tests() { run_tests_flavour static || err=1 run_shell_static "exit" || err=1 - run_shell_static "build/$tools-$toolsarch/usr/utils/static/true; exit" || err=1 + run_shell_static "$(qemu_prefix) build/$tools-$toolsarch/usr/utils/static/true; exit" || err=1 run_tests_flavour shared || err=1 run_shell_shared "exit" || err=1 patch_interp "build/$tools-$toolsarch/usr/utils/shared/true" - run_shell_shared "build/$tools-$toolsarch/usr/utils/shared/true; exit" || err=1 + run_shell_shared "$(qemu_prefix) build/$tools-$toolsarch/usr/utils/shared/true; exit" || err=1 return $err } |