we want to output the suite results in the order they were given to us, so as suties finish we buffer them, and then output them in the right order when we can
358111
function suiteFinished(suite, status, results) {
    suite.finished = true;
    suite.status = status;
    suite.duration = new Date() - suite.startTime;
    suite.results = results;
    delete suite.startTime;

    if (suite.index == finishedIndex) {
      for (var i = finishedIndex; i < suites.length; i++) {
        if (suites[i].finished) {
          while(suites[i].queuedTestResults.length) {
            output.testDone(suites[i], suites[i].queuedTestResults.shift());
          }
          output.suiteDone(suites[i]);
        }
        else {
          break;
        }
      }
      finishedIndex = i;
    }

    if (finishedIndex >= suites.length) {
      output.allDone();
    }

    startNextSuite();
  }
1126264
def scrub_output_pre_save(model, **kwargs):
    """"""
    # only run on notebooks
    if model['type'] != 'notebook':
        return
    # only run on nbformat v4
    if model['content']['nbformat'] != 4:
        return

    for cell in model['content']['cells']:
        if cell['cell_type'] != 'code':
            continue
        cell['outputs'] = []
        cell['execution_count'] = None
132364
def _handle_results(options):
    """"""
    results_processor = options.get('_process_results')
    if not results_processor:
        results_processor = _process_results

    processor_result = results_processor()
    if isinstance(processor_result, (Async, Context)):
        processor_result.start()
21826
function reportStatus(status, outputFile) {
  let log = [''];
  log.push('Suites passed:');
  status.passed.forEach(function (val) {
    log.push('  ' + val);
  });

  if (status.failed.length == 0) {
    log.push('All tests passed');
  } else {
    log.push('Suites failed:');
    status.failed.forEach(function (val) {
      log.push('  ' + val);
    });
  }
  log.push('\nElapsed time: ' + status.elapsedTime + ' seconds');
  log = log.join('\n');
  console.log(log);
  fs.appendFileSync(outputFile, log);
}
324771
def finish_suite(suite)
      total      = suite.count_tests
      passes     = suite.count_passes
      assertions = suite.count_assertions
      failures   = suite.count_failures
      errors     = suite.count_errors
      skips      = suite.count_skips

      bar = '=' * 78
      # @FIXME: Remove this, since Colorize already take care of colorize?
      if colorize?
        bar = if pass == total then Colorize.green(bar)
              else Colorize.red(bar) end
      end

      # @FIXME: Should we add suite.runtime, instead if this lame time calculations?
      tally = [total, assertions, (Time.new - @time)]

      io.puts bar
      io.puts "  pass: %d,  fail: %d,  error: %d, skip: %d" % [passes, failures, errors, skips]
      io.puts "  total: %d tests with %d assertions in %f seconds" % tally
      io.puts bar
    end
835034
function output() {
        var sortByKey = options.sortByKey;
        if (sortByKey) {
          var keys = Object.keys(json),
            i, k, len = keys.length,
            tmp = {};
          keys.sort();
          for (i = 0; i < len; i++) {
            k = keys[i];
            tmp[k] = json[k];
          }
          json = tmp;
          tmp = null;
        }
        grunt.file.write(outputFile, JSON.stringify(json, null, 4));
        done();
      }
400560
def process_results(self, paragraph):
        """"""
        if 'editorMode' in paragraph['config']:
            mode = paragraph['config']['editorMode'].split('/')[-1]
            if 'results' in paragraph and paragraph['results']['msg']:
                msg = paragraph['results']['msg'][0]
                if mode not in ('text', 'markdown'):
                    self.output_options[msg['type']](msg['data'])
829684
public function flushOutput()
    {
        switch ($this->_sOutputFormat) {
            case self::OUTPUT_FORMAT_JSON:
                echo getStr()->jsonEncode($this->_aBuffer);
                break;
            case self::OUTPUT_FORMAT_HTML:
            default:
                break;
        }
    }
902055
def insert_seperator_results(results):
    """"""
    sepbench = BenchmarkResult(*[' ' * w for w in COLUMN_WIDTHS])
    last_bm = None
    for r in results:
        if last_bm is None:
            last_bm = r.benchmark
        elif last_bm != r.benchmark:
            yield sepbench
            last_bm = r.benchmark
        yield r
49953
function() {
			this._.output = [];
			this._.indent = 0;
			this._.indentation = '';
			this._.afterCloser = 0;
			this._.inPre = 0;
		}
327823
def _organize_output(output, combine_map, file_key, combine_arg_keys):
    
    out_map = collections.defaultdict(list)
    extra_args = collections.defaultdict(list)
    final_args = collections.OrderedDict()
    extras = []
    for data in output:
        cur_file = data.get(file_key)
        if not cur_file:
            extras.append([data])
        else:
            cur_out = combine_map[cur_file]
            out_map[cur_out].append(cur_file)
            extra_args[cur_out].append([data[x] for x in combine_arg_keys])
            data[file_key] = cur_out
            if cur_out not in final_args:
                final_args[cur_out] = [data]
            else:
                extras.append([data])
    combine_args = [[v, k] + _get_extra_args(extra_args[k], combine_arg_keys)
                    for (k, v) in out_map.items()]
    return combine_args, list(final_args.values()) + extras
568874
def process_results(self, paragraph):
        """"""
        if 'result' in paragraph and paragraph['result']['msg']:
            msg = paragraph['result']['msg']
            self.output_options[paragraph['result']['type']](msg)
904144
def _generate_out_list(results):
    '''
    
    '''
    passed = 0
    failed = 0
    skipped = 0
    missing_tests = 0
    total_time = 0.0
    for state in results:
        if not results[state].items():
            missing_tests = missing_tests + 1
        else:
            for dummy, val in results[state].items():
                log.info("dummy=%s, val=%s", dummy, val)
                if val['status'].startswith('Pass'):
                    passed = passed + 1
                if val['status'].startswith('Fail'):
                    failed = failed + 1
                if val['status'].startswith('Skip'):
                    skipped = skipped + 1
                total_time = total_time + float(val['duration'])
    out_list = []
    for key, value in results.items():
        out_list.append({key: value})
    out_list.sort()
    out_list.append({'TEST RESULTS': {'Execution Time': round(total_time, 4),
                                      'Passed': passed, 'Failed': failed, 'Skipped': skipped,
                                      'Missing Tests': missing_tests}})
    return out_list
90645
def get_file_results(self):
        """"""
        self._deferred_print.sort()
        for line_number, offset, code, text, doc in self._deferred_print:
            print(self._fmt % {
                'path': self.filename,
                'row': self.line_offset + line_number, 'col': offset + 1,
                'code': code, 'text': text,
            })
            if self._show_source:
                if line_number > len(self.lines):
                    line = ''
                else:
                    line = self.lines[line_number - 1]
                print(line.rstrip())
                print(re.sub(r'\S', ' ', line[:offset]) + '^')
            if self._show_pep8 and doc:
                print('    ' + doc.strip())

            # stdout is block buffered when not stdout.isatty().
            # line can be broken where buffer boundary since other processes
            # write to same file.
            # flush() after print() to avoid buffer boundary.
            # Typical buffer size is 8192. line written safely when
            # len(line) < 8192.
            sys.stdout.flush()
        return self.file_errors
1357137
def finalize(self, result):
        
        runtime = int(time.time() * 1000) - self.execution_start_time
        self.testcase_manager.update_execution_data(self.execution_guid,
                                                    runtime)
230385
def set_outputs(self, *outputs):
        
        self._outputs = OrderedDict()
        for output in outputs:
            out_name = None
            type_or_serialize = None
            if isinstance((list, tuple), output):
                if len(output) == 1:
                    out_name = output[0]
                elif len(output) == 2:
                    out_name = output[0]
                    type_or_serialize = output[1]
                else:
                    raise ValueError("invalid output format")
            else:
                out_name = output
            self.add_output(out_name, type_or_serialize)
358213
function suiteStarted() {
		// Have all suites started?
		if(hasPendingSuites()) {
			return;
		}
		// All suites have started, send the total to karma
		let [total, finished] = countTests();
		if(isDebug) {
			console.debug(`All ${Object.keys(suites).length} suites have started, expecting ${total} tests (of which ${finished} have already finished)`);
		}
		karma.info({total});
		// Send the pending results
		pendingResults.forEach(sendResult);
		pendingResults = [];
	}