I want to use a shell script to make sure that my unit tests pass and that my code has sufficient test coverage. I only want to run my test code once.
I was hoping that I could run my tests via the coverage tool and that from that single run:
- If one or more tests failed, the 'coverage run' command would fail, which would communicate to my shell script that something went wrong.
- Or if the coverage was insufficient, the 'coverage run' command would fail (using --fail-under).
How would you do that without redirecting command output and searching for key words (e.g. fail)?