hubFS: THE place for F#

. . . are you on The Hub?
Welcome to hubFS: THE place for F# Sign in | Join | Help
in Search

MSTest with F# projects (yes, again :)

Last post 09-16-2009, 2:47 by catalin.hritcu. 4 replies.
Sort Posts: Previous Next
  •  11-12-2008, 0:03 7699

    MSTest with F# projects (yes, again :)

    Hi,

    I'd like to use the Visual Studio test runner for a unit test project written in F# (i.e. use an F# test project) I know this has been discussed several times before, and the consensus seemed to be:

    - use xUnit or NUnit, not MSTest
    - Visual studio does not "see" the tests because of the older format of project files

    Since the CTP, the second problem has been solved: as far as I can see, F# project use standard msbuild project files.

    I tried making a normal F# class library and adding some magic Guids (1) to the project file, but that gives an error when reloading the project (Method is not supported or some such). This does work for C# library projects.

    The reason is not that I like MSTest so much, but that I'd like to use the excellent Gallio (2) test runner. (For people like me who don't _want_ to choose between all the whateverUnit frameworks)

    Has anyone gotten this to work, or has an idea what the problem can be? Maybe specific build targets that are missing?

    (1) http://blogs.infosupport.com/raimondb/archive/2005/05/03/Converting-a-NUnit-project-to-Microsoft-UnitTest-project.aspx
    (2) http://www.gallio.org/
    http://fortysix-and-two.blogspot.com/
  •  11-29-2008, 13:35 8018 in reply to 7699

    Re: MSTest with F# projects (yes, again :)

    I have not been able to find a great solution for this; however, I just posted a blog about a possible cause of the problem.



    Daniel Mohl
    Blog: http://bloggemdano.blogspot.com/
    Twitter: @dmohl
  •  04-12-2009, 1:27 9900 in reply to 7699

    Re: MSTest with F# projects (yes, again :)

    Did you make any more progress here? Or is it "wait for the Beta and hope everything is perfect"?

  •  04-12-2009, 5:55 9903 in reply to 9900

    Re: MSTest with F# projects (yes, again :)

    No progress unfortunately. Gallio's extension to the mstest runner also doesn't pick up F# tests, and according to some people on the Gallio mailing list, that is "surprising". However they told me they were working on their own independent visual studio integrated test runner.

    Despite some insistent questions the F# team has been uncharacteristically quiet about this whole thing, so yeah, hope for the best.

    Try using testdriven.net, which should work great with F#.

    Kurt


    http://fortysix-and-two.blogspot.com/
  •  09-16-2009, 2:47 11841 in reply to 9903

    Re: MSTest with F# projects (yes, again :)

    I tried using MSTest with tests written in F# with a hand-hacked project file, and standard testrunconfig and vsmdi files. I managed to make the tests run when called from the command line (MSTest.exe /testcontainer: ... .dll). However, my tests are not found when running Test->Run->All Tests in Solution from Visual Studio, nor do they appear in the Test List Editor. I tried to manually add the names of the tests to the (otherwise empty) vsmdi file, but that didn't work either.

    Did anyone manage to make something like this work?

    I'm using F# 1.9.6.16 and VS 2008 SP1 on Windows 7. (And no, I won't use NUnit or xUnit or Gallio or testdriven.net or whatever! If this doesn't work then is a bug in F# or VS and it should be fixed.)
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems