diff options
author | Max Reitz <mreitz@redhat.com> | 2014-05-24 23:24:55 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-06-27 20:00:00 +0200 |
commit | e8f8624d3b920de968c56e76691f419b16d1ee4a (patch) | |
tree | d40969767d80552df97ef222ace32f3e1f1df5d5 /tests/qemu-iotests/common | |
parent | 6b8aeca574a15668c47296d8e0c4f96c72e63c36 (diff) | |
download | qemu-e8f8624d3b920de968c56e76691f419b16d1ee4a.zip qemu-e8f8624d3b920de968c56e76691f419b16d1ee4a.tar.gz qemu-e8f8624d3b920de968c56e76691f419b16d1ee4a.tar.bz2 |
iotests: Allow out-of-tree run
As out-of-tree builds are preferred for qemu, running the qemu-iotests
in that out-of-tree build should be supported as well. To do so, a
symbolic link has to be created pointing to the check script in the
source directory. That script will check whether it has been run through
a symlink, and if so, will assume it is run in the build tree. All
output and temporary operations performed by iotests are then redirected
here and, unless specified otherwise by the user, QEMU_PROG etc. will be
set to paths appropriate for the build tree.
Also, drop making every test case executable if it is not yet, as this
would modify the source tree which is not desired for out-of-tree runs
and should be fixed in the repository anyway.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/common')
-rw-r--r-- | tests/qemu-iotests/common | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 0aaf84d..e4083f4 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -25,8 +25,7 @@ _setenvironment() export MSGVERB } -here=`pwd` -rm -f $here/$iam.out +rm -f "$OUTPUT_DIR/$iam.out" _setenvironment check=${check-true} @@ -59,7 +58,7 @@ do if $group then # arg after -g - group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{ + group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{ s/ .*//p }'` if [ -z "$group_list" ] @@ -84,7 +83,7 @@ s/ .*//p then # arg after -x [ ! -s $tmp.list ] && ls [0-9][0-9][0-9] [0-9][0-9][0-9][0-9] >$tmp.list 2>/dev/null - group_list=`sed -n <group -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{ + group_list=`sed -n <"$source_iotests/group" -e 's/$/ /' -e "/^[0-9][0-9][0-9].* $r /"'{ s/ .*//p }'` if [ -z "$group_list" ] @@ -366,7 +365,7 @@ testlist options BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \ | while read id do - if grep -s "^$id " group >/dev/null + if grep -s "^$id " "$source_iotests/group" >/dev/null then # in group file ... OK echo $id >>$tmp.list @@ -402,7 +401,7 @@ else touch $tmp.list else # no test numbers, do everything from group file - sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <group >$tmp.list + sed -n -e '/^[0-9][0-9][0-9]*/s/[ ].*//p' <"$source_iotests/group" >$tmp.list fi fi |