3

現在のプロジェクトに単体テストを追加しようとしているときに、Visual Studio 2012 および 2013 のGoogle Test Runnerプラグインに遭遇しました。ただし、これを使用してテストを実行しようとすると、次のエラーが発生します。

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

2 に答える 2

3

この NuGet パッケージをインストールしてみてください。

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

F# ランタイムだけが必要だと思います。

編集: Layl Conway によると、Google テスト ランナーを実行できるようにするために実際に必要だったのは次のとおりです。

Visual Studio Express 2012 for Web の F# ツール

EDIT2:完全を期すために、このブログ投稿もあります(別のSO質問への回答から):

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

せっかちな人のために:

直接ダウンロード リンク ( 忙しい場合はhttp://go.microsoft.com/fwlink/?LinkId=261286 ) をクリックすると、わずか 7.55 MB の VWD_FSharp.msi がダウンロードされ、Azure ツール、VS、およびすべての他のもの。仕事を構築し、宇宙は再び正しいです。

于 2013-08-30T14:29:04.953 に答える
0

FSharp.Core、バージョン = 4.3.0.0

これは、VS2012 と F# 3.0 に含まれているバージョンです。F# 3.1 の VS2013 には FSharp.Core V4.3.1.0 があります。

F# プロジェクトのプロジェクト設定が、適切で一貫性のある F# ランタイムのバージョンを使用するように設定されていることを確認します。

于 2013-08-28T19:41:44.980 に答える