以编程方式调用 mbunit 测试运行程序
我目前正在使用 mbunit 构建一个测试套件。到目前为止一切顺利,但我不想使用附带的 Icarus GUI,而是想要拥有自己的测试运行器。由于不知道该怎么做,我进入 Gallio 的 Google 群组并复制了用户发布的代码:
http://groups.google.com/group/gallio-user/browse_thread/thread/afab404a14674cd2
我得到了改为以下异常:
Gallio.Runtime.RuntimeException 未处理 Message=无法解析服务类型“Gallio.Runner.Projects.ITestProjectManager”的组件,因为似乎没有为该服务类型注册和启用任何组件。 来源=加里奥 堆栈跟踪: 在 Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveNonDisabledDescriptor(类型 serviceType) 在 Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveImpl(类型 serviceType) 在 Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveTService 在 Gallio.Runner.TestLauncher.RunWithRuntime() 在 Gallio.Runner.TestLauncher.Run() 在 C:\Users\edmondc\Documents\Visual Studio 2010\Projects\AutomatedTestSystem\TestPrograms\ImageComparisonTest\Driver.cs 中的 Dundas.Dashboard.TestSystem.TestPrograms.Driver.RunTests():第 49 行 在 C:\Users\edmondc\Documents\Visual Studio 2010\Projects\AutomatedTestSystem\TestConsole\Program.cs 中的 Dundas.Dashboard.TestSystem.Program.Main(String[] args):第 13 行 在 System.AppDomain._nExecuteAssembly(RuntimeAssembly 程序集,String[] args) 在 System.AppDomain.ExecuteAssembly(字符串 assemblyFile,证据 assemblySecurity,字符串 [] args) 在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 在 System.Threading.ThreadHelper.ThreadStart_Context(对象状态) 在System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallback回调,对象状态,布尔ignoreSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContextexecutionContext,ContextCallback 回调,对象状态) 在 System.Threading.ThreadHelper.ThreadStart() InnerException:
我在那里做错了什么?
I am currently building a test suite using mbunit. So far so good, but instead of using the included Icarus GUI, I want to have my own test runner. Not knowing much about what to do, I go on Gallio's Google group and copied the code posted by a user:
http://groups.google.com/group/gallio-user/browse_thread/thread/afab404a14674cd2
And I got the following exception instead:
Gallio.Runtime.RuntimeException was unhandled
Message=Could not resolve component for service type 'Gallio.Runner.Projects.ITestProjectManager' because there do not appear to be any components registered and enabled for that service type.
Source=Gallio
StackTrace:
at Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveNonDisabledDescriptor(Type serviceType)
at Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveImpl(Type serviceType)
at Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveTService
at Gallio.Runner.TestLauncher.RunWithRuntime()
at Gallio.Runner.TestLauncher.Run()
at Dundas.Dashboard.TestSystem.TestPrograms.Driver.RunTests() in C:\Users\edmondc\Documents\Visual Studio 2010\Projects\AutomatedTestSystem\TestPrograms\ImageComparisonTest\Driver.cs:line 49
at Dundas.Dashboard.TestSystem.Program.Main(String[] args) in C:\Users\edmondc\Documents\Visual Studio 2010\Projects\AutomatedTestSystem\TestConsole\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
What am I doing wrong there?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要使用 Gallio Loader,它可能位于 Gallio 安装目录中的某个位置。该加载程序以几个 C# 源文件的形式提供 您需要将其包含在您的项目中。其目的是简化 Gallio 在自定义应用程序中的集成。
简单的用法如下:
编辑:有关测试启动器的更复杂用法,请查看 Echo 源代码。
You may want to use the Gallio Loader which might be found somewhere in the installation directory of Gallio. The loader is provided as a couple of C# source files that you need to include in your project. Its purpose is to ease the integration of Gallio in custom applications.
A simple usage is the following:
EDIT: For a more complex usage of the test launcher, have a look at the Echo source code.