vendredi 1 mars 2019

Golang: Easily Know if Any Test Fails

I test my code with go test ./... -v -short.

Unfortunately, -v only prints out each test as it happens, but does not leave a summary of the results at the bottom like in Java. This means that if any test failed somewhere at the top, I have to scroll up and look for the word FAIL or search for it in a text editor.

The -failfast flag isn't helping either because some of my tests still get printed after the first test failure for some reason.

I don't really care if tests get run after the initial test failure. I just want to be able to easily tell if any test failed, preferably in just one place (e.g. a summary of how many tests passed or failed, or by seeing a flag if all tests passed or not).

Is there a way to easily tell if there was a test failure because I don't want to accidentally continue coding if I still have test failures.

Aucun commentaire:

Enregistrer un commentaire