AlexeyDmitriev / JHelper

GNU Lesser General Public License v3.0
119 stars 31 forks source link

Colorful test results #95

Closed emli closed 5 years ago

emli commented 5 years ago

It would be nice output colorful result. For example wrong answer will be colorized to red, accepted test will colorize to green. Quick searching gives there no cross-platform way to this. There some libraries todo it. So need to add that library to jhelper code. Is it solution or there better solutions?

emli commented 5 years ago

https://agauniyal.github.io/rang/ https://termcolor.readthedocs.io/

AlexeyDmitriev commented 5 years ago

Hi, @emli.

I do not want to require any dependencies by default, but everybody can achieve what you want by modifying run.template in root of your project.

https://github.com/AlexeyDmitriev/JHelper/blob/master/resources/name/admitriev/jhelper/templates/run.template Here's default template. In line 60 you have boolean variable result(true for OK, false for WA) and you can print anything depending on it.

Please let me know if that helps

emli commented 5 years ago

Hi @AlexeyDmitriev!

Nice. I wanted to add colors by default and help community :)

I thought it's good idea. if it's good idea I will try implement

AlexeyDmitriev commented 5 years ago

Well, I personally wouldn't like that in my template (one of the reasons is that color is already used for stderr)

So, I suggest you implement that for yourself and you can also share template separately with th ecommunity and if we see that it is used a lot, we can add it to upstream