diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2019-01-18 17:26:04 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-01-20 01:31:03 +0000 |
commit | add9336aefdf13579de65116b957fb1a7720e75e (patch) | |
tree | 2ddb84dd642f81b55ab7a3937a724b60286b6ff8 | |
parent | d67871786829bb27df798d4207aaacbd90e893b5 (diff) | |
download | klibc-maint-add9336aefdf13579de65116b957fb1a7720e75e.tar.gz |
test-many-klibcs: Make per-arch variables global rather than local
It's getting tedious to repeat the same assignments in multiple
functions.
-rwxr-xr-x | test-many-klibcs | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/test-many-klibcs b/test-many-klibcs index d1c6b22..633e254 100755 --- a/test-many-klibcs +++ b/test-many-klibcs @@ -1,13 +1,6 @@ #!/bin/bash -eu build() { - local arch kernelarch gnuarch makeflags - - arch="$1" - kernelarch="$2" - gnuarch="$3" - makeflags="${5:-}" - echo "I: Using $("$gnuarch-gcc" --version | head -1)" echo "I: Using $("$gnuarch-ld" --version | head -1)" @@ -20,15 +13,11 @@ build() { } clean() { - local arch="$1" - echo "I: Cleaning" make -C ../klibc clean "ARCH=$arch" } run_tests() { - local qemuarch="$4" - echo "I: Testing statically linked shell running builtin command" "qemu-$qemuarch-static" ../klibc/usr/dash/sh -c "exit" || return echo "I: Testing statically linked shell running external command" @@ -37,17 +26,19 @@ run_tests() { } process() { - local arch - - arch="$1/$3" # klibc/GNU arch + arch="$1" + kernelarch="$2" + gnuarch="$3" + qemuarch="$4" + makeflags="${5:-}" - echo "I: Architecture $arch: begin" - if clean "$@" && build "$@" && run_tests "$@"; then - echo "I: Architecture $arch: pass" + echo "I: Architecture $arch/$gnuarch: begin" + if clean && build && run_tests; then + echo "I: Architecture $arch/$gnuarch: pass" else - echo "E: Architecture $arch: fail" + echo "E: Architecture $arch/$gnuarch: fail" fi - clean "$@" || true + clean || true } echo "I: $0 started at $(date)" |