let the build fail if there are unit test failures

Usually I run all the test from the command line during release testing. I had several occasions, where I saw tests fail in the UI testrunner, but the test run has been reported as success.

This PR will examine the unit test result file and inspects all testsuites for failures and accumulates the number of failed tests. If there are any errors, then the number of failed tests will be reported and the build fails accordingly.