mmurdoch / arduinounit

ArduinoUnit is a unit testing framework for Arduino libraries
MIT License
394 stars 51 forks source link

Unattended testing, light a led if all tests passed. #28

Closed husio-org closed 11 years ago

husio-org commented 11 years ago

Hi!

I would like to test arduino shields as I make them.

I will use an arduino board with several unit tests in it, and I will connect shields and run tests on them.

arduino unit is just fine for the purpose.

I am not interested in the test log in most cases: when all the test pass, I just would like to light a green LED at the end of the testing if everything went OK.

I am following your API, but I cannot see a clear hook to check the results after all the tests have been run.

How would you implement it?

Thanks!

wmacevoy commented 11 years ago
testing(lastly)
{
  // wait until last...
  if (Test::getCurrentSkipped()+Test::getCurrentPassed()+Test::getCurrentFailed\
()+1 == Test::getCurrentCount()) {
    if (Test::getCurrentFailed() == 0) {
       // Turn on LED()
       pass();
    } else {
       // Do something else (flash LED?)
       fail();
    }
}