Skip to content

Instantly share code, notes, and snippets.

@epilys
Created August 8, 2017 10:47
Show Gist options
  • Save epilys/5f8d546e8a4a99adaca37d233100365d to your computer and use it in GitHub Desktop.
Save epilys/5f8d546e8a4a99adaca37d233100365d to your computer and use it in GitHub Desktop.
qemu build and test script
#!/bin/bash
#
# Qemu build and test script
# Check that each commit builds, checks, and passes all qemu-iotests
# usage: git rebase -i --exec build_and_test.sh <starting SHA-1>
ignore_tests="147 162 093"
builddir="bin"
dir=$(git rev-parse --show-toplevel)
disable_test() {
local test=$1
sed -i "s/${test}/\#${test}/g" $dir/tests/qemu-iotests/group
}
enable_test() {
local test=$1
sed -i "s/\#${test}/${test}/g" $dir/tests/qemu-iotests/group
}
finish() {
for t in $ignore_tests; do
enable_test $t
done
}
trap finish EXIT
for t in $ignore_tests; do
enable_test $t
disable_test $t
done
cd $builddir
make -j4 || exit 1
make check -j4 || exit 1
cd tests/qemu-iotests
./check -qcow2 || exit 1
./check -raw || exit 1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment