Open GoogleCodeExporter opened 9 years ago
After debugging the Gallio code I figured out it's not as simple as running the
latest MSTest.exe. The UnitTestFramework assembly is on version 10.0 for VS
2010, 2012 and 2013 so you need to use a bit of extra magic to determine the
actual file version not the assembly version to load up the correct test runner.
The second show stopper is that MSTest.exe is not capable of running tests that
make use of Fakes:
http://msdn.microsoft.com/en-us/library/vstudio/ms253138.aspx#Runner_VS
You need to use the VS test runner console
(http://blogs.msdn.com/b/bhuvaneshwari/archive/2012/06/16/vstest-console-exe-com
mandline-test-runner.aspx) to execute these tests in isolation. The commands
are very similar to MSTest and you can also use /logger:trx to get the same
consumable results files that Gallio understands.
After some horrible hacking and hard-coding I got things to run in Icarus. When
I get some time to cleanup I'll submit a patch and hopefully it can make it
into an official build one day..
Original comment by werne...@gmail.com
on 7 Jul 2013 at 6:47
Any news on a fix for this issue? were you able to create a patch?
Original comment by zacharia...@gmail.com
on 31 Dec 2013 at 3:27
I have abandoned a fix for this :(
A proper solution is to create a new test extension in Gallio for VSTest. The
code for the MSTest extension is pretty complex and I found it difficult to
test writing a new extension.
In the end we just refactored things to use an adapter pattern for statics and
create a test adapter that replaces the real static calls for unit tests. This
was easier to maintain and since moving away from Fakes (shims specifically) we
can still use MSTest (and in turn Gallio) to run the tests successfully.
Only static shims don't work in MSTest, you can use other Fakes such as stubs.
For anything else you need VSTest.
Perhaps one day I will pick this up again, but there doesn't seem to be a great
demand for this feature. The driving force for us was using Sonar which uses
Gallio to run you unit tests, refactoring the code to use adapters was easier
and IMHO the cleaner approach.
Original comment by werne...@gmail.com
on 10 Jan 2014 at 6:43
Original issue reported on code.google.com by
werne...@gmail.com
on 7 Jul 2013 at 4:34Attachments: