2013-08-27 63 views
3

尝试将单元测试添加到当前项目时,我遇到了用于Visual Studio 2012和2013的Google Test Runner插件。但是,当我尝试使用此操作运行测试时我遇到了以下错误:Visual Studio 2013 Preview,Google Test Runner无法加载文件或程序集F#

------ 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) ========== 

我不跟F#已知的,看不出什么问题导致这或如何解决它,网页说,这是与Visual Studio 2013测试兼容在文本浏览器中正确发现和查看,但不运行。

编辑: 有时编译后,我得到这个:

------ 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) ========== 
+0

您是否安装了F#?我不确定它是否在VS 2012中默认安装。尽管我认为它在VS 2013中 –

+0

在新项目窗口中,它显示我可以创建一个F#项目,因此我假设它已安装。 –

+0

自2010年以来,F#默认包含在“Professional”和更高的SKU中。 – latkin

回答

2

尝试安装这个NuGet包:

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

我想你只需要在F#运行时。

编辑:每层1康威,这是实际需要,以允许谷歌测试运行运行:

F# Tools for Visual Studio Express 2012 for Web

EDIT2:为了完整起见,这里还有这个博客帖子(从答案another SO question):

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

对于不耐烦:

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.

0

FSharp.Core, Version=4.3.0.0

这是版本包含在VS2012和F#3.0。具有F#3.1的VS2013具有FSharp.Core V4.3.1.0。

确保您将F#项目的项目设置设置为使用正确的和一致的 -version的F#运行时。

+1

这不是我的项目,我试图在包含谷歌测试单元测试的本地C++项目上运行Google Test Runner插件。 –

相关问题