mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
tests/kvm: Allow passing multi argument test cases
This means we can wrap the test case in another executable, or pass arguments to test case executables. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2561>
This commit is contained in:
parent
2df9ccd598
commit
22a46d4f7b
@ -5,7 +5,6 @@ set -e
|
||||
WRAPPER="$1"
|
||||
WRAPPER_ARGS="$2"
|
||||
TEST_RESULT="$3"
|
||||
TEST_EXECUTABLE="$4"
|
||||
|
||||
export XDG_RUNTIME_DIR="/tmp/sub-runtime-dir-$UID"
|
||||
export GSETTINGS_SCHEMA_DIR="$PWD/build/data"
|
||||
@ -18,6 +17,6 @@ mkdir -p -m 700 $XDG_RUNTIME_DIR
|
||||
|
||||
glib-compile-schemas $GSETTINGS_SCHEMA_DIR
|
||||
|
||||
"$WRAPPER" $WRAPPER_ARGS "$TEST_EXECUTABLE"
|
||||
"$WRAPPER" $WRAPPER_ARGS "${@:4}"
|
||||
|
||||
echo $? > $TEST_RESULT
|
||||
|
@ -8,7 +8,6 @@ WRAPPER="$2"
|
||||
WRAPPER_ARGS="$3"
|
||||
TEST_BUILD_DIR="$4"
|
||||
VM_ENV="$5"
|
||||
TEST_EXECUTABLE="$6"
|
||||
|
||||
TEST_RESULT_FILE=$(mktemp -p "$TEST_BUILD_DIR" -t test-result-XXXXXX)
|
||||
echo 1 > "$TEST_RESULT_FILE"
|
||||
@ -30,12 +29,19 @@ if [[ "$(stat -c '%t:%T' -L /proc/$$/fd/0)" == "0:0" ]]; then
|
||||
rm -f $XDG_RUNTIME_DIR/fake-stdin.$$
|
||||
fi
|
||||
|
||||
SCRIPT="\
|
||||
env $VIRTME_ENV $DIRNAME/run-kvm-test.sh \
|
||||
\\\"$WRAPPER\\\" \\\"$WRAPPER_ARGS\\\" \
|
||||
\\\"$TEST_RESULT_FILE\\\" \
|
||||
$(printf "\"%s\" " "${@:6}")\
|
||||
"
|
||||
|
||||
virtme-run \
|
||||
--memory=256M \
|
||||
--rw \
|
||||
--pwd \
|
||||
--kimg "$IMAGE" \
|
||||
--script-sh "sh -c \"env $VIRTME_ENV $DIRNAME/run-kvm-test.sh \\\"$WRAPPER\\\" \\\"$WRAPPER_ARGS\\\" \\\"$TEST_RESULT_FILE\\\" \\\"$TEST_EXECUTABLE\\\"\"" \
|
||||
--script-sh "sh -c \"$SCRIPT\"" \
|
||||
--qemu-opts -cpu host,pdcm=off -smp 2
|
||||
|
||||
TEST_RESULT="$(cat "$TEST_RESULT_FILE")"
|
||||
|
Loading…
Reference in New Issue
Block a user