Ejemplo n.º 1
0
        async Task <bool> RunRemoteSession(TestServer server, CancellationToken cancellationToken)
        {
            session = server.Session;
            if (OnSessionCreated(session))
            {
                await session.UpdateSettings(cancellationToken);
            }

            var test = session.RootTestCase;

            cancellationToken.ThrowIfCancellationRequested();

            Debug("Got test: {0}", test);
            startTime = DateTime.Now;
            result    = await session.Run(test, cancellationToken);

            endTime = DateTime.Now;
            cancellationToken.ThrowIfCancellationRequested();
            Debug("Got result: {0}", result);

            SaveResult();

            await server.Stop(cancellationToken);

            return(IsSuccessResult);
        }
Ejemplo n.º 2
0
        async Task <bool> ConnectToServer(CancellationToken cancellationToken)
        {
            var endpoint = GetPortableEndPoint(EndPoint);
            var server   = await TestServer.ConnectToServer(this, endpoint, cancellationToken);

            cancellationToken.ThrowIfCancellationRequested();

            session = server.Session;
            if (OnSessionCreated(session))
            {
                await session.UpdateSettings(cancellationToken);
            }

            var test = session.RootTestCase;

            cancellationToken.ThrowIfCancellationRequested();

            Debug("Got test: {0}", test);
            startTime = DateTime.Now;
            result    = await session.Run(test, cancellationToken);

            endTime = DateTime.Now;
            cancellationToken.ThrowIfCancellationRequested();
            Debug("Got result: {0}", result);

            SaveResult();

            await server.Stop(cancellationToken);

            return(IsSuccessResult);
        }
Ejemplo n.º 3
0
        async Task <int> RunRemoteSession(TestServer server, CancellationToken cancellationToken)
        {
            session = server.Session;
            if (Options.UpdateConfiguration(session))
            {
                await session.UpdateSettings(cancellationToken);
            }

            PrintSummary();

            var test = session.RootTestCase;

            cancellationToken.ThrowIfCancellationRequested();

            Debug("Got test: {0}", test.Path.FullName);
            startTime = DateTime.Now;
            result    = await session.Run(test, cancellationToken);

            endTime = DateTime.Now;
            cancellationToken.ThrowIfCancellationRequested();
            Debug("Got result: {0} {1}", result.Status, result.Path.FullName);

            SaveResult();

            await server.Stop(cancellationToken);

            return(ExitCodeForResult);
        }
Ejemplo n.º 4
0
        async Task <int> ConnectToServer(CancellationToken cancellationToken)
        {
            var endpoint = GetPortableEndPoint(Options.EndPoint);
            var server   = await TestServer.ConnectToServer(this, endpoint, cancellationToken);

            cancellationToken.ThrowIfCancellationRequested();

            session = server.Session;
            if (Options.UpdateConfiguration(session))
            {
                await session.UpdateSettings(cancellationToken);
            }

            PrintSummary();

            var test = session.RootTestCase;

            cancellationToken.ThrowIfCancellationRequested();

            Debug("Got test: {0}", test.Path.FullName);
            startTime = DateTime.Now;
            result    = await session.Run(test, cancellationToken);

            endTime = DateTime.Now;
            cancellationToken.ThrowIfCancellationRequested();
            Debug("Got result: {0} {1}", result.Status, test.Path.FullName);

            SaveResult();

            await server.Stop(cancellationToken);

            return(ExitCodeForResult);
        }
Ejemplo n.º 5
0
        async Task <bool> RunLocal(CancellationToken cancellationToken)
        {
            var framework = TestFramework.GetLocalFramework(Assembly, dependencyAssemblies);

            cancellationToken.ThrowIfCancellationRequested();
            session = TestSession.CreateLocal(this, framework);
            OnSessionCreated(session);

            var test = session.RootTestCase;

            Debug("Got test: {0}", test);
            startTime = DateTime.Now;
            result    = await session.Run(test, cancellationToken);

            endTime = DateTime.Now;
            Debug("Got result: {0}", result);

            SaveResult();

            return(IsSuccessResult);
        }
Ejemplo n.º 6
0
        async Task <int> RunLocal(CancellationToken cancellationToken)
        {
            var framework = TestFramework.GetLocalFramework(PackageName, Assembly, Options.Dependencies);

            cancellationToken.ThrowIfCancellationRequested();
            session = TestSession.CreateLocal(this, framework);
            Options.UpdateConfiguration(session);

            var test = session.RootTestCase;

            Debug("Got test: {0}", test.Path.FullName);
            startTime = DateTime.Now;
            result    = await session.Run(test, cancellationToken);

            endTime = DateTime.Now;
            Debug("Got result: {0} {1}", result.Status, test.Path.FullName);

            SaveResult();

            return(ExitCodeForResult);
        }
Ejemplo n.º 7
0
        async Task RunLocal()
        {
            session = TestSession.CreateLocal(this, framework);
            var test = await session.GetRootTestCase(CancellationToken.None);

            Debug("Got test: {0}", test);
            var result = await session.Run(test, CancellationToken.None);

            Debug("Got result: {0}", result);

            Debug("{0} tests, {1} passed, {2} errors, {3} ignored.", countTests, countSuccess, countErrors, countIgnored);

            if (!NoXml)
            {
                var serialized = TestSerializer.WriteTestResult(result);
                var settings   = new XmlWriterSettings();
                settings.Indent = true;
                using (var writer = XmlTextWriter.Create(XmlOutputFileName, settings))
                    serialized.WriteTo(writer);
                Debug("Result writting to {0}.", XmlOutputFileName);
            }
        }