Re: [kvm-unit-tests PATCH v4 08/13] scripts/runtime: consolidate summary tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2016-05-17 14:22+0200, Paolo Bonzini:
> On 11/05/2016 18:12, Radim Krčmář wrote:
>> Turn skip into yellow SKIP and add reusable definitions of all tags.
>> 
>> Reviewed-by: Andrew Jones <drjones@xxxxxxxxxx>
>> Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
>> ---
>>  scripts/runtime.bash | 16 ++++++++++------
>>  1 file changed, 10 insertions(+), 6 deletions(-)
>> 
>> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
>> index ed073721216c..8d374103a71c 100644
>> --- a/scripts/runtime.bash
>> +++ b/scripts/runtime.bash
>> @@ -2,6 +2,10 @@
>>  : ${MAX_SMP:=$(getconf _NPROCESSORS_CONF)}
>>  : ${TIMEOUT:=90s}
>>  
>> +PASS() { echo -ne "\e[32mPASS\e[0m"; }
>> +SKIP() { echo -ne "\e[33mSKIP\e[0m"; }
>> +FAIL() { echo -ne "\e[31mFAIL\e[0m"; }
> 
> If you use for example $'\e[32mPASS\e[0m', then you can use variables
> instead of functions.

Great, thanks.  A fixup is below

---8<---
diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 39a9072ed103..2bbdb864c889 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -2,9 +2,9 @@
 : ${MAX_SMP:=$(getconf _NPROCESSORS_CONF)}
 : ${TIMEOUT:=90s}
 
-PASS() { echo -ne "\e[32mPASS\e[0m"; }
-SKIP() { echo -ne "\e[33mSKIP\e[0m"; }
-FAIL() { echo -ne "\e[31mFAIL\e[0m"; }
+PASS=$'\e[32mPASS\e[0m'
+SKIP=$'\e[33mSKIP\e[0m'
+FAIL=$'\e[31mFAIL\e[0m'
 
 extract_summary()
 {
@@ -53,18 +53,18 @@ function run()
     fi
 
     if [ -n "$arch" ] && [ "$arch" != "$ARCH" ]; then
-        echo "`SKIP` $1 ($arch only)"
+        echo "$SKIP $1 ($arch only)"
         return 2
     fi
 
     eval $check || {
         echo "skipped $testname (\`$check\` returned $?)" | RUNTIME_log_stderr
-        echo "`SKIP` $testname (check failed)"
+        echo "$SKIP $testname (check failed)"
         return 77
     }
 
     last_line=$(premature_failure) && {
-        echo "`SKIP` $1 ($last_line)"
+        echo "$SKIP $1 ($last_line)"
         return 77
     }
 
@@ -80,13 +80,13 @@ function run()
     ret=$?
 
     if [ $ret -eq 0 ]; then
-        echo "`PASS` $1 $summary"
+        echo "$PASS $1 $summary"
     elif [ $ret -eq 77 ]; then
-        echo "`SKIP` $1 $summary"
+        echo "$SKIP $1 $summary"
     elif [ $ret -eq 124 ]; then
-        echo "`FAIL` $1 (timeout; duration=$timeout)"
+        echo "$FAIL $1 (timeout; duration=$timeout)"
     else
-        echo "`FAIL` $1 $summary"
+        echo "$FAIL $1 $summary"
     fi
 
     return $ret
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux