Can Visual Studio 2010 do Code Coverage analysis on F# modules? - visual-studio-2010

Though I ask it to, Visual Studio 2010 does not appear to generate code coverage statistics for my F# modules. The unit tests are Ms Tests written in C#, so are run natively by Visual Studio, and execute cleanly. But there does not appear to be any coverage information created for the F# library being tested. The C# libraries involved are analyzed just fine.
Am I missing something?

This link describes using the VS testing system with F#. You do it pretty much the same way as with C#.
The downside is that apparently the VS IDE won't automatically pick it up -- I believe you need to run from the command line using mstest.exe.
Edit: Oh, another cool thing with F#, is FsCheck, an automatic testing tool for F#, is basically a port of Haskell's QuickCheck. It allows you to provide a specification of the program, in the form of properties that the functions or methods should satisfy, and FsCheck tests that the properties hold in a large number of randomly generated cases.
also fsunit and fstest

Related

In Visual Studio 2013 how do I limit code analysis to my code and not to referenced assemblies?

I have a solution in Visual Studio 2013 (c# code) that has a reference to a third-party assembly that I added with NuGet (ICSharpCode.SharpZipLib). When I run the "Code Analysis" on the solution I get lots of warnings coming from the third-party assembly. How do I tell VS that I only want code analysis advice from my code?
I'm pretty sure the errors are coming from the library itself and not my usage of it. There are a total of 32 issues e.g.
CA2237: Mark ISerializable types with SerializableAttribute.
I am using ILMerge to bundle into a single executable do you think that has confused the code analysis?
There is no way to tell FxCop to ignore namespaces or types in your code if it lives in the same binaries. When using ILMerge, the SharpZipLib essentially becomes part of your code, as it's merged into your assembly.
To get proper results, run FxCop on the assembly that's generated before the merge.
Other solutions will mention to put a [GeneratedCode] attribute on classes you want excluded, but IlMerge has no option to to that while merging, so that won't help you out.
In Visual Studio 2015 Code Analysis works on the source code using the new Roslyn Engine, which will solve the issue probably, as it does the analysis even before compilation and as such will not be impacted by your use of IlMerge.

android c++ unit testing in visual studio 2015

I've been creating a native android c++ library for audio processing using Visual Studio 2015 and the Android NDK. It works well but what I would really love to be able to do is to write unit tests as well; and as far as I can work out there is no support for unit testing in this case. Does anyone know a way of doing this? (preferably with some reasonably detailed instructions, given my relative lack of experience with C++ and VS). I'd rather do this in Visual Studio rather than using the approach that I've seen mentioned of using JUnit and JNI from another IDE.
I doubt you'll find anything with fancy IDE integration, but for the NDK in general you can use gtest for unit testing.
This answer shows how to do this from within the NDK, but I don't know what extra steps you'll need to make this work within VS.

How to integrate a custom antlr4-based language into Visual Studio

I'd like to integrate my own custom language in Visual Studio.
I'd like to have:
Syntax highlighting
invoke a custom compiler, producing source files in another compilable language. These shall be compiled in a second phase.
some simple tools like rename (not text based, so that a local variable is only renamed within scope), find code lines that reference this function/variable etc.
Intellisense (code completion, suggest members, types etc.)
Is there a way to achieve this without too much effort?
I already discovered Xtext (limited to a subset of antlr3) for eclipse, but need a similar tool based on antlr4 for visual studio?
Check out the Extending Visual Studio chapters in MSDN, especially
Language Services
Projects and Solutions
Editors
There are a few other blogs and tutorials on these topics as well:
CodeProject
ANTLR and MyC
And a few language services are open source and provide a great example:
IronPython
IronRuby
ASP.NET Web Stack

Can VS2010 generate NunitTest cases?

There is option of Create Unit Tests in VS2010.
It creates a separate test project and uses MS test frame work. Is it possible for configure VS to use Nunit framework to create unit test cases?
From what i know Visual Studio generates only MSTests. But there are many commercial tools (You can always evaluate :)) which are quite helpful.
For example:
Other topic
Parasoft dotTEST
Probably by your own You will find few more.

Using MSTest in an open source project

A colleague and I are writing an application that we intend to go Open Source with and are trying to decide on a testing framework. Without integration of NUnit (one of us has resharper while the other does not) we are leaning toward MSTest. However, if the majority of people that work on opensource .net applications only have the express edition of Visual Studio, we may have to change our mind on that.
What version of VS do you use and would MSTest turn you off to an Open Source Project?
Personally, I'm using VS:TS, so no, test units in MSTest wouldn't turn anything off for me ;), on the other hand, most probably, you will receive different answers from the majority of people, that are not professional programmers as well (working for money doesn't mean you can not work with / on OS projects) (the question is, how many you will find here).
However, if I understand you correctly, you don't want to use nUnit, because you it's not integrated with VS08, you might then check out these projects:
1. http://sourceforge.net/projects/visualnunit/
2. http://sourceforge.net/projects/nunitaddin/
Integrating NUnit with VS08 doesn't seem to the biggest problem, on the other hand, getting VS with built in testing framework might be a bit harder, at least for some people.
If I truly felt strongly enough to participate in the Open Source project, MSTest alone wouldn't be enough to turn me away. I'd be willing to adapt to whatever the development tools/environment was.
...and for what it's worth, I use the full version of Visual Studio with Resharper.
Frankly I never heared of anyone using the Express editions. everybody I know or I talked with either use the fully fledged Visual Studio environment, or they use the compiler/libraries from the free SDK and some editor on top of it (CodeWarrior, CodeInsight etc) and rely on some variant of make to build.
As for the test framework, is a double edged sword. I'd recommend NUnit, but then... remember what happened with NDoc?
I use MonoDevelop and NUnit.
I use VS 2k8 pro & MSTest as much as possible.
Even Microsoft's open source code (Prism/Composite Wpf) doesn't use MSTest. They use NUnit for that project, I believe.
You may be able to use visual nunit to add an nunit test runner in VS. link I've never used it but it may be worth a shot.
If your problem is integration with Visual Studio, try Gallio. It includes MbUnit, but its runner can run tests from other frameworks, like NUnit, xUnit, etc.
It would turn me off. See MSBuild, NAnt, NUnit, MSTest, and frustration (not written by me!) - I suspect a number of people feel that way. MSBuild seems like a poorly-done copy of NAnt (we use both), and MSTest likewise looks like Microsoft's usual "not invented here" answer to open source. While I realize that there are good business reasons for Microsoft to develop their own tools, those reasons don't apply to their customers.
There are plug-ins to use NUnit inside Visual Studio without ReSharper, or you can always configure it to run from the Tools menu.
If you don't like NUnit, please consider one of the other open source testing alternatives. See NUnit vs. MbUnit vs. MSTest vs. xUnit.net
I think that people who don't use windows will be knocked out of the project by the choice to use MSTest. Most other c# testing libraries are available in mono, which is what mac and linux users would be using.
I don't know how many cross-platform developers you are trying to attract, but if it's an issue then you need to consider Linux/Mac devs.

Resources