[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v1 22/23] tests/qemu-iotests: re-form
From: |
Eric Blake |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH v1 22/23] tests/qemu-iotests: re-format output to for make check-block |
Date: |
Thu, 9 May 2019 15:45:57 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 5/9/19 3:38 PM, Alex Bennée wrote:
>> Hm, this makes every iotest print two lines:
>>
>> $ ./check -T -qcow2
>> [...]
>> 001 [20:06:27] -> [20:06:27]
>> 001 0s (last 1s)
>
> Yes - it was a compromise to ensure we printed a start and end
> timestamp but I guess we can fix it up with a bit more shell ugliness:
>
> --8<---------------cut here---------------start------------->8---
>
> Subject: [PATCH] fixup! tests/qemu-iotests: re-format output to for make
> check-block
>
> ---
> tests/qemu-iotests/check | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index fb239967a32..9f083f06b46 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -726,7 +726,11 @@ _report_test_result()
> if $pretty; then
> echo " TEST iotest: $1 $2"
> else
> - echo "$1 $2"
> + if $timestamp; then
> + echo " $2"
> + else
> + echo "$1 $2"
> + fi
Why not just make $1 '' in the case where you've already printed a
timestamp, so that this code is still unconditionally echo "$1 $2"?
> fi
> }
>
> @@ -793,7 +797,7 @@ do
> $run_command >$tmp.out 2>&1)
> fi
> sts=$?
> - $timestamp && echo " [$(date "+%T")]"
> + $timestamp && echo -n " [$(date "+%T")]"
'echo -n' is not portable (even in bash, since you can compile a
different default for shopt xpg_echo). Better is to use 'printf %s', as
is already done in _timestamp().
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-arm] [PATCH v1 12/23] .travis.yml: enable aarch64-softmmu and alpha-softmmu tcg tests, (continued)
- [Qemu-arm] [PATCH v1 12/23] .travis.yml: enable aarch64-softmmu and alpha-softmmu tcg tests, Alex Bennée, 2019/05/09
- [Qemu-arm] [PATCH v1 19/23] cirrus / travis: Add gnu-sed and bash for macOS and FreeBSD, Alex Bennée, 2019/05/09
- [Qemu-arm] [PATCH v1 21/23] tests/qemu-iotests/group: Re-use the "auto" group for tests that can always run, Alex Bennée, 2019/05/09
- [Qemu-arm] [PATCH v1 18/23] tests/qemu-iotests: Do not hard-code the path to bash, Alex Bennée, 2019/05/09
- [Qemu-arm] [PATCH v1 16/23] tests/qemu-iotests/005: Add a sanity check for large sparse file support, Alex Bennée, 2019/05/09
- [Qemu-arm] [PATCH v1 22/23] tests/qemu-iotests: re-format output to for make check-block, Alex Bennée, 2019/05/09
- Re: [Qemu-arm] [Qemu-devel] [PATCH v1 22/23] tests/qemu-iotests: re-format output to for make check-block, Thomas Huth, 2019/05/10
- [Qemu-arm] [PATCH v1 23/23] tests: Run the iotests during "make check" again, Alex Bennée, 2019/05/09
- [Qemu-arm] [PATCH v1 20/23] tests/qemu-iotests: Remove the "_supported_os Linux" line from many tests, Alex Bennée, 2019/05/09