-
-
Notifications
You must be signed in to change notification settings - Fork 3
5. FAQ
You have to create a .runsettings file in your solution with this inside:
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<!-- set default session timeout to 5m -->
<TestSessionTimeout>500000</TestSessionTimeout>
<TreatNoTestsAsError>true</TreatNoTestsAsError>
</RunConfiguration>
<Doctest>
<GeneralSettings>
<CommandArguments>--headless --test</CommandArguments>
</GeneralSettings>
<DiscoverySettings>
<SearchDirectories>
<string>modules</string>
<string>tests</string>
</SearchDirectories>
</DiscoverySettings>
</Doctest>
</RunSettings> Then go to Test -> Configure Run Settings -> Select Solution Wide runsettings File and select the new .runsettings file you just created. The main setting that you must have is: <CommandArguments>--headless --test</CommandArguments>, the other settings are optional but it's what I'd recommend at least.
This can happen sometimes because of the way visual studio updates it's test containers. You can force visual studio to manually update test containers by either doing a full rebuild of your solution or by closing visual studio, navigating to your solution folder and deleting the .vs folder and then opening the visual studio solution back up. Note, you have to enable showing hidden items in windows explorer to see the .vs folder: View -> Show -> Hidden Items.
This should cause the test discovery to kick in again. If you've tried this and it still doesn't discover tests then please open a bug.
Why has the test adapter discovered X amount of tests but I only see Y amount of tests in the test explorer?
This might happen when there are TEST_CASEs with identical names in the same file, namespace and class. The test explorer can't parse the difference between them so it will end up displaying whatever the last identical TEST_CASE is. If this happens, it would be worth double checking for any identical TEST_CASEs and seeing if they should have the exact same names.

Why is the Tests window printing "[Warning] No test is available in [filename].dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again." when I have doctest unit tests in [filename].dll?
If you are loading this .dll file in an .exe in your project somewhere, then please ignore this warning for now - it shouldn't have any impact on the functionality of this test adapter working for your project. This can print to the Tests window because even though this test adapter supports doctest unit tests in dlls it only discovers .exe files so the .dll file will remain undiscovered. Any .exe files that load your .dll file will have your .dll doctest unit tests in them in the test explorer window. For example, in the DoctestTestAdapter.Examples solution, all of the doctest unit tests from DLL.dll will appear under ExecutableUsingDLL.