简体   繁体   中英

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. 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. Instead I would like to hide it or that it run silently. I have checked throuh NUnits settings but can't really find something.

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. 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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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