1

大きなビルド ファイル内に、次の NAnt ターゲットがあります。

<target name="load-gallio">
  <loadtasks assembly="lib/Gallio.NAntTasks.dll" />
</target>

<target name="test" depends="load-gallio">
    <gallio failonerror="true">
       <files>
          <include name="target/tests.dll" />
       </files>
   </gallio>
</target>

tests.dll は、Gallio コマンド ライン ランナーと Icarus で問題なく動作します。「nant test」を実行すると、次の結果が得られます。

load-gallio:

test:

   [gallio] Gallio NAnt Task - Version 3.4 build 12
   [gallio] Start time: 11:12
   [gallio] Stop time: 11:12 (Total execution time: 0.881 seconds)

BUILD FAILED

INTERNAL ERROR

Gallio.Runtime.RuntimeException: Could not resolve component for service type 'Gallio.Runner.Projects.ITestProjectM
anager' because there do not appear to be any components registered and enabled for that service type.
   at Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveNonDisabledDescriptor(Type serviceType)
   at Gallio.Runtime.Extensibility.RegistryServiceLocator.Resolve[TService]()
   at Gallio.Runner.TestLauncher.RunWithRuntime()
   at Gallio.Runner.TestLauncher.Run()
   at Gallio.NAntTasks.GallioTask.RunLauncher(TestLauncher launcher)
   at Gallio.NAntTasks.GallioTask.InternalExecute()
   at Gallio.NAntTasks.GallioTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Target.Execute()
   at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
   at NAnt.Core.Project.Execute()
   at NAnt.Core.Project.Run()

なぜこれが起こるのですか?ある種のランタイム セットアップ/サービス登録手順が不足していますか? これはバグですか?お時間とご協力いただきありがとうございます。

4

1 に答える 1

2

通常はより柔軟で、nant とユーティリティの間の依存関係が取り除かれるため、私はランナーを直接呼び出す傾向があります。それがあなたにとっての選択肢かどうかはわかりませんが、例である場合は次のようになります。

<exec program="gallio.echo.exe" basedir="Utilities" verbose="true">
    <arg line="target/tests.dll"/>
    <arg value="/rt:XML"/>
    <arg value="/rd:Reports"/>
    <arg value="/no-echo-results"/>
    <arg value="/f:exclude Category:RunManually"/>
</exec> 

コマンド ライン パラメータの完全なドキュメントは、ここにあります。

于 2013-01-29T03:33:59.697 に答える