How to write Connect IQ unit tests

A how-to on creating Connect IQ unit tests in MonkeyC

Hope you find it usefull. Let me know what you think! :cool:
  • What becomes a bit of an issue if you're adding more and more tests is that you have to scroll up higher and higher in your dos box window to see why the test is failing...

    It would be an enhancement if the development team could add an option to only show the failing tests (and their output)... (Save the output of each test in some sort of cache and only write to the output window for the ones that are failing).
  • I really like your tutorial. I also hope it will inspire other developers!

    I develop my Connect IQ widget mostly in TDD mode. What I learned from your tutorial is how to easily separate the tests in another project. Right now, my tests are in the same, but I am going to change that.

    One more thing that I do in addition: I have setup a "builder" in Eclipse that runs the tests whenever I save my production code. You can do this in the project properties (right-click on your project). Here, I registered my script that runs the tests and that is similar to yours. On the "Build Options" tab, you can select which files the builder should monitor so that it does not run too often.

    And last but really not least, I fully agree with your finding that the test results show a big log that forces you to scroll up in to find your failing tests. I hope someone from Garmin reads this so that they can add this as a feature request. Maybe adding a flag that only shows failing tests. Or, even better, provide a special view in Eclipse to show the test results that allows filtering on such things (like e. g. for JUnit). Since I apply TDD, it is very normal for me to have failing tests and the scrolling really bothers me.

    Regards,
    Florian
  • Is there still a link to this somewhere?

    Thanks