This project is read-only.

How to setup unittesting for my own app

Jun 30, 2014 at 9:09 PM
Hello,

I notice there is some code in the platform.cs about unittesting--when you set the -r flag to be unittesting or an individual developer's name.

I tried to follow UnitTests\Apps\SmartCam as an example to create my unittest environment, however, I not able to start the zwave driver module--using StartModule. (I'm able to auto start my Basis module.)

In addition, I also need to hack some other things to make the unittesting (somehow) work, such as manually setup the baseURL, and uncomment a few lines of code about Setting. I wonder if you could provide a guideline about how to setup unittest for an app that uses zwave device.

Thanks!
Jul 1, 2014 at 4:01 AM

Hi –

You are headed in the right direction with unittesting and –r flag.

There is nothing special about the zwave module, and you should be able to run it just like any other module. I assume that the driver binary exists in the right place (under output/binarie/pipeline/….), and you are using StartModule correctly (no typos in driver or binary name). If all that is good, what error are you getting if any?

Another way to debug this is to step through the StartModule() code. For instance, does the allAddInTokens include the zwave driver?

Btw, why do you need to change the baseUrl?

Another possibility with respect to unittesting is to use the –c flag when starting the Platform. This flag lets you specify the configuration directory to use. So, you could setup the config one time exactly how you want it, and then re-use the config from that directory.

Cheers.