예제 #1
0
 public BinaryExecutionOperation(string binaryPath,
                                 IProgressRecorder progressRecorder, ICrossDomainLogger crossDomainLogger)
 {
     this.binaryPath        = binaryPath;
     this.progressRecorder  = progressRecorder;
     this.crossDomainLogger = crossDomainLogger;
 }
예제 #2
0
        public int ExecuteAll(string binaryPath, IProgressRecorder progressRecorder,
                              IOutputLogger logger, ICrossDomainLogger crossDomainLogger)
        {
            var executionOperation = new BinaryExecutionOperation(binaryPath,
                                                                  progressRecorder, crossDomainLogger);

            return(RunOperationRemotely("all", executionOperation, binaryPath, logger));
        }
            public void Execute(
                IBinaryTestExecutor binaryTestExecutor,
                IProgressRecorder progressRecorder,
                IOutputLogger outputLogger, ICrossDomainLogger crossDomainLogger)
            {
                // TODO pass canceler to binaryTestExecutor.Execute

                binaryTestExecutor.ExecuteAll(BinaryPath, progressRecorder, outputLogger, crossDomainLogger);
            }
예제 #4
0
        public virtual void before_each()
        {
            autoSubstitute = new AutoSubstitute();

            progressRecorder = autoSubstitute.Resolve <IProgressRecorder>();

            executedExampleMapper = autoSubstitute.Resolve <IExecutedExampleMapper>();

            reporter = autoSubstitute.Resolve <ExecutionReporter>();
        }
            public void Execute(
                IBinaryTestExecutor binaryTestExecutor,
                IProgressRecorder progressRecorder,
                IOutputLogger outputLogger, ICrossDomainLogger crossDomainLogger)
            {
                var testCaseFullNames = testCaseGroup.Select(tc => tc.FullyQualifiedName);

                // TODO pass canceler to binaryTestExecutor.Execute

                binaryTestExecutor.ExecuteSelected(BinaryPath, testCaseFullNames, progressRecorder, outputLogger, crossDomainLogger);
            }
예제 #6
0
        public int ExecuteSelected(string binaryPath, IEnumerable <string> testCaseFullNames,
                                   IProgressRecorder progressRecorder,
                                   IOutputLogger logger, ICrossDomainLogger crossDomainLogger)
        {
            string[] exampleFullNames = testCaseFullNames.ToArray();

            var executionOperation = new SelectionExecutionOperation(binaryPath, exampleFullNames,
                                                                     progressRecorder, crossDomainLogger);

            return(RunOperationRemotely("selected", executionOperation, binaryPath, logger));
        }
예제 #7
0
        public virtual void before_each()
        {
            autoSubstitute = new AutoSubstitute();

            proxyableExecutor = Substitute.For <IProxyableTestExecutor>();

            remoteRunner = autoSubstitute.SubstituteFor <ICrossDomainRunner <IProxyableTestExecutor, int> >();

            progressRecorder = autoSubstitute.Resolve <IProgressRecorder>();

            logger            = autoSubstitute.Resolve <IOutputLogger>();
            crossDomainLogger = autoSubstitute.Resolve <ICrossDomainLogger>();

            executor = autoSubstitute.Resolve <BinaryTestExecutor>();
        }
예제 #8
0
        public virtual void before_each()
        {
            autoSubstitute = new AutoSubstitute();

            frameworkHandle = autoSubstitute.Resolve <IFrameworkHandle>();

            binaryTestExecutor = autoSubstitute.Resolve <IBinaryTestExecutor>();

            progressRecorder        = autoSubstitute.Resolve <IProgressRecorder>();
            progressRecorderFactory = autoSubstitute.Resolve <IProgressRecorderFactory>();
            progressRecorderFactory.Create(frameworkHandle).Returns(progressRecorder);

            settingsRepository = autoSubstitute.Resolve <ISettingsRepository>();

            outputLogger  = autoSubstitute.Resolve <IOutputLogger>();
            loggerFactory = autoSubstitute.Resolve <ILoggerFactory>();
            loggerFactory.CreateOutput(null, null).ReturnsForAnyArgs(outputLogger);

            actualSources = new List <string>();

            progressRecorder.BinaryPath = Arg.Do <string>(path => actualSources.Add(path));
        }
예제 #9
0
        int Execute(string binaryPath, string[] exampleFullNames,
                    IProgressRecorder progressRecorder, ICrossDomainLogger logger)
        {
            string scenario = (exampleFullNames == RunnableContextFinder.RunAll ? "all" : "selected");

            logger.Debug(String.Format("Start executing {0} tests locally in binary '{1}'", scenario, binaryPath));

            int count;

            try
            {
                var runnableContextFinder = new RunnableContextFinder();

                var runnableContexts = runnableContextFinder.Find(binaryPath, exampleFullNames);

                var executedExampleMapper = new ExecutedExampleMapper();

                var executionReporter = new ExecutionReporter(progressRecorder, executedExampleMapper);

                var contextExecutor = new ContextExecutor(executionReporter, logger);

                count = contextExecutor.Execute(runnableContexts);
            }
            catch (Exception ex)
            {
                // report problem and return, without letting exception cross app domain boundary

                count = 0;

                var exInfo  = new ExceptionLogInfo(ex);
                var message = String.Format("Exception thrown while executing tests locally in binary '{0}'", binaryPath);

                logger.Error(exInfo, message);
            }

            logger.Debug(String.Format("Finish executing {0} tests locally in binary '{1}'", count, binaryPath));

            return(count);
        }
예제 #10
0
 public SelectionExecutionOperation(string binaryPath, string[] exampleFullNames,
                                    IProgressRecorder progressRecorder, ICrossDomainLogger crossDomainLogger)
     : base(binaryPath, progressRecorder, crossDomainLogger)
 {
     this.exampleFullNames = exampleFullNames;
 }
예제 #11
0
 public ExecutionReporter(IProgressRecorder progressRecorder, IExecutedExampleMapper executedExampleMapper)
 {
     this.progressRecorder      = progressRecorder;
     this.executedExampleMapper = executedExampleMapper;
 }
예제 #12
0
 public int ExecuteAll(string binaryPath,
                       IProgressRecorder progressRecorder, ICrossDomainLogger logger)
 {
     return(Execute(binaryPath, RunnableContextFinder.RunAll, progressRecorder, logger));
 }
예제 #13
0
 public int ExecuteSelection(string binaryPath, string[] exampleFullNames,
                             IProgressRecorder progressRecorder, ICrossDomainLogger logger)
 {
     return(Execute(binaryPath, exampleFullNames, progressRecorder, logger));
 }