Sebastian Kreft
Sebastian Kreft

Reputation: 8199

How to unit test Connect IQ?

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.

Upvotes: 5

Views: 841

Answers (2)

Peter De Decker
Peter De Decker

Reputation: 31

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/

Upvotes: 2

Madis
Madis

Reputation: 421

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

Upvotes: 2

Related Questions