What are some good Automated Unit And System Test Tools for Android?
So I give in. I approached this problem as an oh hey that's not too bad, I can write a bunch of unit tests, and I have been keeping my suite green. However as things get more involved continuous integration and testing is a great great thing to have. And then I saw oh Android has emma integration as well awesome ... and then that's where it get's iffy.
So I setup Hudson and have it call the coverage target开发者_如何学编程 of the ant build.xml that the android executable in the sdk can generate. And then it hits me.
adb -s <emulator> shell am instrument -w ...
will never return a result code that is not 0 ... because adb technically exited cleanly and usually will regardless of how the shell command that executed did.
So again I say, Oh that's not too bad, I can just wrap adb with a parser that parses output for errors and return a non 0 resultcode to fail my build if a test fails. Problem is then I also want to see what tests fail. I know eclipse is doing something smarter so I dig deeper and find the extra switches you can pass am instrument including the -r flag.
adb -s <emulator> shell am instrument -r -w ...
Now this is starting to get complicated as the output gets more complex and this originally thought simple task is getting more intense. As this SDK is maturing more I have to think, someone has endured this pain. However I have only been able to find blackbox testing frameworks and not anything along the lines of regression test suite automation of the whitebox sort.
Any suggestions welcome.
精彩评论