简体   繁体   English

可以静默隐藏或运行nunit-agent吗?

[英]Possible to hide or run the the nunit-agent silently?

I currently have an application that run unit tests and recently I decided to move from my "hack" implementation with NUnit 2.6.4 to 3.2 and the new test engine api. 我目前有一个运行单元测试的应用程序,最近我决定从使用NUnit 2.6.4的“ hack”实现过渡到3.2和新的测试引擎api。 Works really well and this is how I currently run the test: 效果很好,这就是我目前运行测试的方式:

        using (ITestEngine engine = TestEngineActivator.CreateInstance())
        {
            engine.WorkDirectory = Path.GetDirectoryName(dllPath);
            var emptyFilter = GetFilter(engine);
            using (ITestRunner runner = engine.GetRunner(package))
            {      
                XmlNode result = runner.Run(null, emptyFilter);
                runner.Unload();
                return new NUnitTestSuiteResult(result);
            }
        }

But as expected the nunit-agent.exe show up when I run the tests and sadly it look a bit ugly. 但是正如预期的那样,当我运行测试时会显示nunit-agent.exe,可悲的是它看起来有点丑陋。 Instead I would like to hide it or that it run silently. 相反,我想隐藏它或使其静默运行。 I have checked throuh NUnits settings but can't really find something. 我已经检查了NUnits设置,但找不到真正的东西。

So maybe I missed something or do anyone know if it's possible? 所以也许我错过了一些东西,或者没有人知道这是否可能吗? I'm okay with the current solution of open and then closing it but it would look even better if it didn't show up at all. 我对打开然后关闭它的当前解决方案还可以,但是如果它根本不显示的话,看起来会更好。

We are actually having the same problem with the NUnit gui and have an issue on it. 我们实际上在NUnit gui上也遇到了同样的问题,并且有一个问题。 It seems like it happens only when we are running from a program that is not a console program. 似乎只有当我们从不是控制台程序的程序运行时,它才会发生。 I think we need to have some other process settings inside the engine when we launch the agent - and in fact we probably can find the right ones by looking back at NUnit 2.x. 我认为,启动代理时,我们需要在引擎内部具有其他一些进程设置-实际上,通过回顾一下NUnit 2.x,我们可能可以找到正确的设置。

All that said, there's nothing you can do about it unless you modify the engine. 综上所述,除非您修改引擎,否则您将无能为力。 It's a good reminder for us, since we are about to do a new release. 这对我们来说是个很好的提醒,因为我们将要发布一个新版本。 Maybe I'll squeeze a fix in. 也许我会解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM