Re: [kvm-unit-tests PATCH] scripts: Colorize only when possible

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

 



Hello!

On Wed, 10 Apr 2019 at 04:34, Andrew Jones <drjones@xxxxxxxxxx> wrote:
> On Tue, Apr 09, 2019 at 01:11:11PM -0500, Daniel Díaz wrote:
> > Instead of colorizing the output of PASS/SKIP/FAIL all the
> > time, do it only when the terminal supports colors and stdout
> > is opened on a terminal.
>
> I'm guessing the motivation for this is because you're redirecting the
> output of run_tests.sh or the standalone scripts and getting something
> like
>
> ^[[32mPASS^[[0m selftest-vectors-kernel (2 tests)
>
> in the output, which doesn't look nice nor lend itself well to parsing.

That's the case, yes [1]. We [2] come from the context of parsing the
logs and extracting the test results, and, while doable [3], color
sequences generally get in the way of easily parsing the output.

> Because otherwise you must be using a pretty old vt100 :) If I'm right
> about the motivation then we mostly care about the '[ -t 1]' part and
> we can drop the 'tput' stuff in order to avoid the ncurses dependency.
> Also that motivation should be added to the commit message.
[...]
> Some bash style nits:
>
>  - Please use $() instead of ``
>  - Please use if [ cond1 ] && [ cond2 ] && ... instead of '-a'
>  - This file uses four spaces for indentation.

Great! Thanks for the review. I'll send V2 briefly.

Greetings!

Daniel Díaz
daniel.diaz@xxxxxxxxxx

[1] https://lkft.validation.linaro.org/scheduler/job/673625#L1462
[2] https://lkft.linaro.org/
[3] https://lkft.validation.linaro.org/results/673625/1_kvm-unit-tests




[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