I have added a Unit Test App(Universal Windows) Project in Visual Studio 2015. It discovers and runs all test cases in Test Explorer in IDE correctly. But when running MSTest.exe from command line, it gives the message "No tests to execute". Command executed is
MSTest.exe /testcontainer:"F:\Projects\MyUnitTests\bin\Release\MyUnitTests.exe" /resultsfile:F:\testResults.trx
Same result when used 'vstest.console.exe' as suggested here.
Also, most of the examples online provide a dll to mstest. But there is no dll created in outputs in vs2015. Need this to be executed by script in jenkins. Has anyone else faced this issue?
When you run against the exe, you should get a warning similar to this that gives you some hints:
In order to use the universal test project, you need to create an app bundle and then run the tests against that. To create the bundle, right click on your project and select
Store=>Create App Packages.You will create a local app package, so you can select
Nofor the prompt to upload to the windows store.Next you will be prompted to fill out the output location, version, ...
On this screen, make sure you select
Neverfor theGenerate app bundleoption.After clicking create, open the command line to the location where the app bundles were created. You will also have to install the certificate. You can do this from the command line using
certutil:Finally, now you can run your tests using the
vstest.console.execommand line against the app package:This blog post from Microsoft has more information and some other troubleshooting tips. Even though the blog post is marked for the beta of VS11, it seems that most of it still applies.