3

While trying to add Unit Tests to my current project I ran into the Google Test Runner plugin for Visual Studio 2012 and 2013. When I however try to run tests using this I run into the following error:

------ Run test started ------
Found 2 tests, resolving symbols
Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe
Retrieving the COM class factory for component with CLSID {BCE36434-2C24-499E-BF49-8BD99B0EEB68} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Running: C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe --gtest_output=xml:C:\Users\MYUSER\AppData\Local\Temp\tmpB2DE.tmp 
Opened results from C:\Users\MYUSER\AppData\Local\Temp\tmpB2DE.tmp
Could not load file or assembly 'FSharp.Core, Version=4.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
   at FSharp.Data.RuntimeImplementation.XmlOperations.GetChildrenArray(XmlElement value, String nameWithNS)
   at FSharp.Data.RuntimeImplementation.XmlOperations.ConvertArray[R](XmlElement xml, String nameWithNS, Func`2 f)
   at GoogleTestRunner.ResultParser.getResults(IMessageLogger logger, String outputPath, IEnumerable`1 testCases)
   at GoogleTestRunner.GoogleTestExecutor.runOnce(IFrameworkHandle framework, Boolean debug, FSharpList`1 cases, String executable, Boolean runAll)
   at GoogleTestRunner.GoogleTestExecutor.runTests(IEnumerable`1 tests, IRunContext runContext, IFrameworkHandle framework, Boolean runAll)
No test is available in C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\tests.exe. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
========== Run test finished: 0 run (0:00:04.7380291) ==========

I'm not known with F# and don't see what problem is causing this or how to solve it, the page says it's compatible with Visual Studio 2013. The tests are correctly discovered and viewable in the text explorer but don't run.

Edit: Sometimes after a build I get this:

------ Discover test started ------
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\MY PROJECT.exe match [Tt]est[s]{0,1}.exe: false
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\Tests.exe match [Tt]est[s]{0,1}.exe: true
Found 2 tests, resolving symbols
Loading symbols from C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\Tests.exe
Retrieving the COM class factory for component with CLSID {BCE36434-2C24-499E-BF49-8BD99B0EEB68} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
GoogleTest: Does C:\Users\MYUSER\Documents\Visual Studio 2013\Projects\MY PROJECT\Debug\WorldServer.exe match [Tt]est[s]{0,1}.exe: false
========== Discover test finished: 2 found (0:00:00.2372256) ==========
Layl Conway
  • 385
  • 9
  • 17
  • Do you have F# installed? I am not sure if it is installed by default in VS 2012. Although I think it is in VS 2013 – John Palmer Aug 27 '13 at 09:57
  • In the new project window it shows that I can create a F# project so I assume it's installed. – Layl Conway Aug 27 '13 at 10:14
  • F# has been included by default since VS 2010, in the "Professional" and higher SKUs. – latkin Aug 27 '13 at 17:43
  • @LaylConway if either of us answered your question it's customary to mark an answer as "accepted" for the reference of others who may find the question and answers later. If neither of us answered your question perhaps you can provide some additional information? – Onorio Catenacci Sep 03 '13 at 17:13
  • Neither answered the question, as I said in a comment under Richard's answer, I'm not trying to build a project containing F# code. I'm trying to use a visual studio plugin written in F#. – Layl Conway Sep 04 '13 at 01:54
  • Found the solution, I indeed was missing the F# 3.0 runtime... which doesn't exist standalone, whoops! Installing [this toolset](http://www.microsoft.com/en-us/download/details.aspx?id=34675) fixed my problems though, if you could append that link to your question I'll mark it as an answer. – Layl Conway Sep 04 '13 at 02:02

2 Answers2

3

Try installing this NuGet package:

http://www.nuget.org/packages/FSharp.Core.3/

I think you just need the F# runtime.

EDIT: Per Layl Conway, this is what was actually needed to allow the Google Test Runner to run:

F# Tools for Visual Studio Express 2012 for Web

EDIT2: For sake of completeness there's also this blog post (from the answer to another SO question):

http://www.heartysoft.com/build-fsharp-3-on-build-server-without-vs

For the impatient:

Clicking the Direct Download Link ( http://go.microsoft.com/fwlink/?LinkId=261286 if you’re too busy) downloads VWD_FSharp.msi which is only 7.55MB, doesn’t include Azure tools, VS and all the other stuff. Builds work, the universe is right again.

Community
  • 1
  • 1
Onorio Catenacci
  • 14,928
  • 14
  • 81
  • 132
0

FSharp.Core, Version=4.3.0.0

That's the version included with VS2012 and F# 3.0. VS2013 with F# 3.1 has FSharp.Core V4.3.1.0.

Ensure your project settings for the F# project(s) are set to use the right—and consistent—version of the F# runtime.

Richard
  • 106,783
  • 21
  • 203
  • 265
  • 1
    It's not my project, I'm trying to run the Google Test Runner plugin on a native C++ project that includes google test unit tests. – Layl Conway Aug 29 '13 at 22:37