Return failure code on failure; DM-1027
Fix implementation so that all tests are run, not just the first one.

N.b. this patch backs out the original implementation and replaces it with
a check for TEST.failed files.
Make sure that tests check runs iff the tests are run
Added a test that we check the error code of tests
Use shell, not python, for testing so we can use @
Merge remote-tracking branch 'origin/tickets/DM-1027' #close DM-1027