/// <summary> /// Executes the task. /// </summary> protected override void ExecuteTask() { DisplayTaskConfiguration(); if (FileSetHelper.Count(Assemblies) == 0) { Log(Level.Warning, "No specification assemblies, aborting task"); return; } List <ISpecificationRunListener> listeners = SetUpListeners(); NAntRunListener nantRunListener = new NAntRunListener(this); listeners.Add(nantRunListener); AggregateRunListener rootListener = new AggregateRunListener(listeners); ISpecificationRunner runner = new AppDomainRunner(rootListener, RunOptions.Default); RunSpecifications(Assemblies, runner); Log(Level.Info, "Finished running specs"); if (nantRunListener.FailureOccurred) { throw new BuildException("There were failing specifications. Please see the build log."); } }
/// <summary> /// Executes the task. /// </summary> protected override void ExecuteTask() { DisplayTaskConfiguration(); if (FileSetHelper.Count(Assemblies) == 0) { Log(Level.Warning, "No test assemblies, aborting task"); return; } ReportResult result = RunTests(Assemblies); GenerateReports(result, ReportTypes); if (result.Counter.FailureCount > 0) { throw new BuildException("There were failing tests. Please see the build log."); } }