mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 00:50:42 -05:00
06eb27d503
This commit makes it possible to run test executables in a test environment constructed of a virtual machine running the Linux kernel with the virtual KMS driver enabled, and a mocked system environment using meta-dbus-runner.py/python-dbusmock. The qemu machine is configured to use 256M of memory, as the default 128M was not enough for the tests to pass. Using qemu is also only made possible on x86_64; more changes are needed for it to be runnable on aarch64, so add a warning if it was enabled on any other architecture. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>
26 lines
547 B
Bash
Executable File
26 lines
547 B
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
set -e
|
|
|
|
DIRNAME="$(dirname "$0")"
|
|
IMAGE="$1"
|
|
WRAPPER="$2"
|
|
WRAPPER_ARGS="$3"
|
|
TEST_EXECUTABLE="$4"
|
|
TEST_BUILD_DIR="$5"
|
|
|
|
TEST_RESULT_FILE=$(mktemp -p "$TEST_BUILD_DIR" -t test-result-XXXXXX)
|
|
echo 1 > "$TEST_RESULT_FILE"
|
|
|
|
virtme-run \
|
|
--memory=256M \
|
|
--rw \
|
|
--pwd \
|
|
--kimg "$IMAGE" \
|
|
--script-sh "sh -c \"env HOME=$HOME $DIRNAME/run-kvm-test.sh \\\"$WRAPPER\\\" \\\"$WRAPPER_ARGS\\\" \\\"$TEST_EXECUTABLE\\\" \\\"$TEST_RESULT_FILE\\\"\""
|
|
|
|
TEST_RESULT="$(cat "$TEST_RESULT_FILE")"
|
|
rm "$TEST_RESULT_FILE"
|
|
|
|
exit "$TEST_RESULT"
|