5

Is there any support for unit testing Connect IQ applications? I could not find anything on the documentation.

Ideally, the solution should have integration with the Eclipse SDK.

Sebastian Kreft
  • 7,819
  • 3
  • 24
  • 41

2 Answers2

2

Support is added in Connect IQ SDK 2.1, where you need to compile with --unit-test flag and run with /t flag

You must annotate your methods with (:test) and return a boolean, which would mean whether a test passed or not (true for pass).

I'm keeping this answer short at the moment. See more: http://developer.garmin.com/blog/post/connect-iq-2-run-no-evil

Madis
  • 411
  • 5
  • 7
  • There is a good article here on setting up unit tests with your Connect IQ projects: http://starttorun.info/tutorial-create-connect-iq-unit-tests/ – douglasr Dec 20 '16 at 19:08
2

The documentation in the Connect IQ SDK as suggested in the other answer is not very elaborate and does not explain in detail how to do proper unit testing, it's just some simple hello world examples...

I wrote a small tutorial that explains how to write unit tests, it's a process that consists of 3 parts:

  1. create test project: http://starttorun.info/tutorial-how-to-create-connect-iq-unit-test-project/
  2. create run configuration: http://starttorun.info/tutorial-run-connect-iq-unit-tests/
  3. create unit tests (mock/isolate/...): starttorun.info/tutorial-create-connect-iq-unit-tests/