Perl-Toolchain-Gang / Test-Harness

Run Perl standard test scripts with statistics
http://testanything.org/
29 stars 65 forks source link

Color the "ok"s as well. #86

Closed shlomif closed 1 year ago

shlomif commented 5 years ago

Using the SUCCESS color.

By inspiration from https://metacpan.org/release/Test-Run-Plugin-ColorFileVerdicts and ultimately from https://wiki.python.org/moin/TestOob .

See http://www.shlomifish.org/Files/files/images/tap-harness-color-ok-traces.png for a screenshot.

I hereby disclaim any implicit or explicit ownership of my changes in this changeset, and put them under a multiple licence consisting of your choice of one of more of:

Crediting me will be nice, but not mandatory, and you can change the licence of the project without needing my permission.

Leont commented 5 years ago

If the ok's should be green, shouldn't the fails be red?

(I'm not sure what I think of this in general, I think I'd like to hear some other people's opinions on this)

karenetheridge commented 5 years ago

If the ok's should be green, shouldn't the fails be red?

Agreed - it would look really snazzy if 'not ok' was red, and 'skipped' was yellow!

shlomif commented 5 years ago

@Leont @karenetheridge : I am already seeing the "Dubious" messages on test scripts failures in red, even without my changes.

shlomif commented 5 years ago

@Leont @karenetheridge : ping.

shlomif commented 5 years ago

Ping.

andk commented 5 years ago

How about thinking of the background? How does the output look like on a non-black terminal?

shlomif commented 5 years ago

@andk : the colours are configurable using env vars and can be completely disabled, so it should not be an issue.

andk commented 5 years ago

Configurability is one thing, good defaults is another to generate a useable interface. The poor user that experiences green on green has to debug the situation and find the culprit. He has a huge disadvantage compared to the author of the interface.

shlomif commented 5 years ago

@andk: I've checked now and apparently prove does colour the output by default (even without this pullreq) and so will be affected by the issue you brought. Perhaps a separate PR is in order to add "on_black" to the default colours - see https://metacpan.org/pod/Term::ANSIColor .

shlomif commented 4 years ago

@Leont @karenetheridge : ping.

shlomif commented 3 years ago

Ping again. it has been 2 years.

Leont commented 3 years ago

Ping again. it has been 2 years.

I think this has suffered from PTS being cancelled two years in a row. I would really love some more opinions from fellow toolchainers on what behavior we want here.

scottchiefbaker commented 1 year ago

I just came here to say that improved colorized output in prove would be fantastic.

Leont commented 1 year ago

Sorry I let this slack so long. Can you rebase on top of master (so it at least has a CI run), then I'll merge it.

scottchiefbaker commented 1 year ago

FWIW I have a highlight script that I use with great success with prove, and anything else I want to colorize.

prove -vl t/01-general.t | highlight -f 'green,^ok|pass' -f 'red,(faile?d?|^not ok)' -f '75,all tests.*'

I use that for anything that doesn't have good coloring built in. Having prove do it's own coloring would be ideal.

shlomif commented 1 year ago

Sorry I let this slack so long. Can you rebase on top of master (so it at least has a CI run), then I'll merge it.

done. thanks!