Initialize a new `List` test reporter.

@param {Runner} runner
@api public
355962
function List(runner) {
  Base.call(this, runner);

  var self = this;
  var stats = this.stats;
  var total = runner.total;

  runner.on('start', function(){
    // console.log(JSON.stringify( ['start', { total: total }] ));
  });

  runner.on('suite', function(suite){
    if (suite.id != undefined) {
      // console.log(JSON.stringify( ['suite', suite_info(suite)] ));
      console.log(suite.title + ':')
    }
  });

  runner.on('test', function(test){
    // console.log(JSON.stringify( ['test', info(test)] ));
  });

  runner.on('pass', function(test){
    //console.log(JSON.stringify( ['pass', pass(test)] ));
    console.log(':-) ' + test.title)
    //process.stdout.write('.')
  });

  runner.on('fail', function(test, err){
    
    //test = fail(test, err);
    //console.log(JSON.stringify( ['fail', test] ));
    console.log(':-( ' + test.title)
    console.log('\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv FAIL vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n');
    console.log('Title: ' + test.title + '\n');
    console.log(err.stack);
    console.log('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAIL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n');  
    
  });

  runner.on('test end', function(test){
    //console.log(JSON.stringify( ['test end', {id: test.id}] ));
  });

  runner.on('suite end', function(suite){
    if (suite.id != undefined) {
      //console.log(JSON.stringify( ['suite end', {id: suite.id}] ));
    }
  });

  runner.on('end', function(){
    //console.log(JSON.stringify( ['end', self.stats] ));
    console.log('\nSummary:')
    pluralized = '';
    if (self.stats.passes != 1) {
      pluralized = 'es';
    }  
    console.log(self.stats.passes + ' pass' + pluralized)
    
    pluralized = '';
    if (self.stats.failures != 1) {
      pluralized = 's';
    }      
    console.log(self.stats.failures + ' failure' + pluralized) 
    console.log('--------------------------')    

    pluralized = '';
    if (self.stats.tests != 1) {
      pluralized = 's';
    }
    console.log(self.stats.tests + ' test' + pluralized + ' (' + self.stats.duration + 'ms)\n')
    
  });
}
347598
function(listType,args,done) {

    var endpoint = 'athlete/'
        , qs = util.getQS(_qsAllowedProps,args);

    endpoint += listType + '?' + qs;
    util.getEndpoint(endpoint,args,done);
}
1334454
def run
      require_dependencies
      require_frameworks
      init_reporters

      suite_passed = true

      Spinach.hooks.run_before_run

      features_to_run.each do |feature|
        feature_passed = FeatureRunner.new(feature, orderer: orderer).run
        suite_passed &&= feature_passed

        break if fail_fast? && !feature_passed
      end

      Spinach.hooks.run_after_run(suite_passed)

      suite_passed
    end
357716
function _initial_runner(response, manager){
	    // I can't just remove the callback from the register
	    // after the first run because it would be reconstituted
	    // every time it was reset (established).
	    if( anchor.initial_reset_p ){
		anchor.initial_reset_p = false;
		anchor.initial_reset_callback(response, manager);
		//ll('unregister: ' + anchor.unregister('reset', 'first_run'));
	    }
	}
381174
function Gas (runner, options) {

  if (!(web3.currentProvider.connection || web3.currentProvider.host)) {
    console.log('the provider use for the test does not support synchronous call but eth-gas-reporter requires it \n falling back on the Spec reporter');
    mocha.reporters.Spec.call(this, runner);
    return;
  }
  Base.call(this, runner);

  const self = this
  let indents = 0
  let n = 0
  let failed = false;
  let startBlock
  let deployStartBlock
  let methodMap
  let deployMap
  let contractNameFromCodeHash;

  // Load config / keep .ethgas.js for backward compatibility
  let config;
  if (options && options.reporterOptions){
    config = options.reporterOptions
  } else {
    config = reqCwd.silent('./.ethgas.js') || {}
  }

  config.src = config.src || 'contracts'; // default contracts folder
  // TODO grab the contract srcpath from truffle / truffle config ?

  // Start getting this data when the reporter loads.
  stats.getGasAndPriceRates(config);

  // ------------------------------------  Helpers -------------------------------------------------
  const indent = () => Array(indents).join('  ')

  const methodAnalytics = (methodMap) => {
    let gasUsed = 0
    const endBlock = sync.blockNumber();

    while (startBlock <= endBlock) {
      let block = sync.getBlockByNumber(startBlock);

      if (block) {
        // Add to running tally for this test
        gasUsed += parseInt(block.gasUsed, 16);

        // Compile per method stats
        methodMap && block.transactions.forEach(tx => {
          const transaction = sync.getTransactionByHash(tx);
          const receipt = sync.getTransactionReceipt(tx);

          // Don't count methods that throw
          const threw = parseInt(receipt.status) === 0 || receipt.status === false;
          if (threw) return

          const code = sync.getCode(transaction.to);
          const hash = sha1(code);
          let contractName = contractNameFromCodeHash[hash];

          // Handle cases where we don't have a deployment record for the contract
          // or where we *do* (from migrations) but tx actually interacts with a
          // proxy / something doesn't match.
          let isProxied = false;

          if (contractName) {
            let candidateId = stats.getMethodID(contractName, transaction.input)
            isProxied = !methodMap[candidateId]
          }

          // If unfound, search by fnHash alone instead of contract_fnHash
          if (!contractName || isProxied ) {
            let key = transaction.input.slice(2, 10);
            let matches = Object.values(methodMap).filter(el => el.key === key);

            if (matches.length >= 1) {
              contractName = matches[0].contract;
            }
          }

          const id = stats.getMethodID(contractName, transaction.input)

          if (methodMap[id]) {
            methodMap[id].gasData.push(parseInt(receipt.gasUsed, 16))
            methodMap[id].numberOfCalls++
          }
        })
      }
      startBlock++
    }
    return gasUsed
  }

  const deployAnalytics = (deployMap) => {
    const endBlock = sync.blockNumber();

    while (deployStartBlock <= endBlock) {
      let block = sync.getBlockByNumber(deployStartBlock);

      block && block.transactions.forEach(tx => {
        const receipt = sync.getTransactionReceipt(tx);
        const threw = parseInt(receipt.status) === 0 || receipt.status === false;

        if (receipt.contractAddress && !threw) {
          const transaction = sync.getTransactionByHash(tx)

          const matches = deployMap.filter(contract => {
            return stats.matchBinaries(transaction.input, contract.binary);
          })

          if(matches && matches.length){
            const match = matches.find(item => item.binary !== '0x');

            if (match) {
              // We have to get code that might be linked here in
              // in order to match correctly at the method ids
              const code = sync.getCode(receipt.contractAddress);
              const hash = sha1(code);

              match.gasData.push(parseInt(receipt.gasUsed, 16));
              contractNameFromCodeHash[hash] = match.name;
            }
          }
        }
      })
      deployStartBlock++
    }
  }

  // ------------------------------------  Runners -------------------------------------------------
  runner.on('start', () => {
    ({ methodMap, deployMap, contractNameFromCodeHash } = stats.mapMethodsToContracts(artifacts, config.src))
  })

  runner.on('suite', suite => {
    ++indents
    log(color('suite', '%s%s'), indent(), suite.title)
  })

  runner.on('suite end', () => {
    --indents
    if (indents === 1) {
      log()
    }
  })

  runner.on('pending', test => {
    let fmt = indent() + color('pending', '  - %s')
    log(fmt, test.title)
  })

  runner.on('test', () => { deployStartBlock = sync.blockNumber() })

  runner.on('hook end', () => { startBlock = sync.blockNumber() + 1 })

  runner.on('pass', test => {
    let fmt
    let fmtArgs
    let gasUsedString
    deployAnalytics(deployMap)
    let gasUsed = methodAnalytics(methodMap)
    let showTimeSpent = config.showTimeSpent || false
    let timeSpentString = color(test.speed, '%dms')
    let consumptionString
    if (gasUsed) {
      gasUsedString = color('checkmark', '%d gas')

      if (showTimeSpent) {
        consumptionString = ' (' + timeSpentString + ', ' + gasUsedString + ')'
        fmtArgs = [test.title, test.duration, gasUsed]
      } else {
        consumptionString = ' (' + gasUsedString + ')'
        fmtArgs = [test.title, gasUsed]
      }

      fmt = indent() +
      color('checkmark', '  ' + Base.symbols.ok) +
      color('pass', ' %s') +
      consumptionString
    } else {
      if (showTimeSpent) {
        consumptionString = ' (' + timeSpentString + ')'
        fmtArgs = [test.title, test.duration]
      } else {
        consumptionString = ''
        fmtArgs = [test.title]
      }

      fmt = indent() +
        color('checkmark', '  ' + Base.symbols.ok) +
        color('pass', ' %s') +
        consumptionString
    }
    log.apply(null, [fmt, ...fmtArgs])
  })

  runner.on('fail', test => {
    failed = true;
    let fmt = indent() + color('fail', '  %d) %s')
    log()
    log(fmt, ++n, test.title)
  })

  runner.on('end', () => {
    stats.generateGasStatsReport(methodMap, deployMap, contractNameFromCodeHash)
    self.epilogue()
  });
}
560099
private void init_freelists(boolean create)
    {
        int qlist_num;

        if (create == true) {
            init_storage_parameters();
        };
        for (qlist_num = 0; qlist_num <= last_ql_index;
            qlist_num++) {
            if (create == true) {
                ql_heads[qlist_num] =  new Listhead();
            }
            ql_heads[qlist_num].length = 0;
            ql_heads[qlist_num].first_block = null;
        };
        nonempty_lists = 0;
    }
951839
function triggerRunnerEvents() {
    var logs = [];
    var _stdoutWrite = process.stdout.write;
    process.stdout.write = function() {
        logs.push(arguments[0]);
    };
    reporter.jasmineStarted();
    for (var i=0; i<env._suites.length; i++) {
        var s = env._suites[i];
        triggerSuiteEvents(s);
    }
    reporter.jasmineDone();
    process.stdout.write = _stdoutWrite;
    return logs;
}
165146
public function init()
    {
        $this->root = Context::getInstance()->getCurrentSuite();

        $this->eventEmitter->on('runner.start', [$this, 'onRunnerStart']);
        $this->eventEmitter->on('suite.start', [$this, 'onSuiteStart']);
        $this->eventEmitter->on('suite.end', [$this, 'onSuiteEnd']);
        $this->eventEmitter->on('test.passed', [$this, 'onTestPassed']);
        $this->eventEmitter->on('test.failed', [$this, 'onTestFailed']);
        $this->eventEmitter->on('test.pending', [$this, 'onTestPending']);
        $this->eventEmitter->on('runner.end', [$this, 'onRunnerEnd']);
    }
1309697
function NyanCat(runner, options) {
  Base.call(this, runner, options);

  var self = this;
  var width = (Base.window.width * 0.75) | 0;
  var nyanCatWidth = (this.nyanCatWidth = 11);

  this.colorIndex = 0;
  this.numberOfLines = 4;
  this.rainbowColors = self.generateColors();
  this.scoreboardWidth = 5;
  this.tick = 0;
  this.trajectories = [[], [], [], []];
  this.trajectoryWidthMax = width - nyanCatWidth;

  runner.on(EVENT_RUN_BEGIN, function() {
    Base.cursor.hide();
    self.draw();
  });

  runner.on(EVENT_TEST_PENDING, function() {
    self.draw();
  });

  runner.on(EVENT_TEST_PASS, function() {
    self.draw();
  });

  runner.on(EVENT_TEST_FAIL, function() {
    self.draw();
  });

  runner.once(EVENT_RUN_END, function() {
    Base.cursor.show();
    for (var i = 0; i < self.numberOfLines; i++) {
      write('\n');
    }
    self.epilogue();
  });
}
1262041
function Pending(runner) {

  runner.on('start', function(){
    console.log('* ')
    console.log('*********************');
    console.log('*** Pending tests ***');
    console.log('*********************');
    console.log('* ')
  });

  var scope = [];

  runner.on('pending', function(test){
    var current = [test]
      , parent = test.parent
    ;
    // stack suites
    while( !!parent ){
      current.unshift(parent)
      parent = parent.parent;
    }
    // print titles
    current.forEach(function(val, key){
      if( val != scope[key] ){
        while( scope.length > key ){
          scope.pop()
        }
        console.log( '* ' + Array(key).join('  ') + val.title );
        scope.push(val);
      }
    })
  })
}
250185
function JSONCov(runner, output) {
  var self = this
    , output = 1 == arguments.length ? true : output;

  Base.call(this, runner);

  var tests = []
    , failures = []
    , passes = [];

  runner.on('test end', function(test){
    tests.push(test);
  });

  runner.on('pass', function(test){
    passes.push(test);
  });

  runner.on('fail', function(test){
    failures.push(test);
  });

  runner.on('end', function(){
    var cov = global._$jscoverage || {};
    var result = self.cov = map(cov);
    result.stats = self.stats;
    result.tests = tests.map(clean);
    result.failures = failures.map(clean);
    result.passes = passes.map(clean);
    if (!output) return;
    process.stdout.write(JSON.stringify(result, null, 2 ));
  });
}
584585
function display(runner) {
  var stats = runner.stats;
  var symbol = {
    cross: '\u274C',
    tick: '\u2705'
  };
  var logo = require('../../package').notifyLogo;
  var _message;
  var message;
  var title;

  if (stats.failures) {
    _message = stats.failures + ' of ' + stats.tests + ' tests failed';
    message = symbol.cross + ' ' + _message;
    title = 'Failed';
  } else {
    _message = stats.passes + ' tests passed in ' + stats.duration + 'ms';
    message = symbol.tick + ' ' + _message;
    title = 'Passed';
  }

  // Send notification
  var options = {
    badge: logo,
    body: message,
    dir: 'ltr',
    icon: logo,
    lang: 'en-US',
    name: 'mocha',
    requireInteraction: false,
    timestamp: Date.now()
  };
  var notification = new Notification(title, options);

  // Autoclose after brief delay (makes various browsers act same)
  var FORCE_DURATION = 4000;
  setTimeout(notification.close.bind(notification), FORCE_DURATION);
}
1021257
function TAP(runner, options) {
  Base.call(this, runner, options);

  var self = this;
  var n = 1;

  var tapVersion = '12';
  if (options && options.reporterOptions) {
    if (options.reporterOptions.tapVersion) {
      tapVersion = options.reporterOptions.tapVersion.toString();
    }
  }

  this._producer = createProducer(tapVersion);

  runner.once(EVENT_RUN_BEGIN, function() {
    var ntests = runner.grepTotal(runner.suite);
    self._producer.writeVersion();
    self._producer.writePlan(ntests);
  });

  runner.on(EVENT_TEST_END, function() {
    ++n;
  });

  runner.on(EVENT_TEST_PENDING, function(test) {
    self._producer.writePending(n, test);
  });

  runner.on(EVENT_TEST_PASS, function(test) {
    self._producer.writePass(n, test);
  });

  runner.on(EVENT_TEST_FAIL, function(test, err) {
    self._producer.writeFail(n, test, err);
  });

  runner.once(EVENT_RUN_END, function() {
    self._producer.writeEpilogue(runner.stats);
  });
}
1228113
public function init()
    {
        $this->eventEmitter->on('test.passed', [$this, 'onTestPassed']);
        $this->eventEmitter->on('test.failed', [$this, 'onTestFailed']);
        $this->eventEmitter->on('test.pending', [$this, 'onTestPending']);
        $this->eventEmitter->on('runner.end', [$this, 'onRunnerEnd']);
    }
1245195
def template_runner(client, parser, args):
    """"""
    if args.builtin_list:
        aomi.template.builtin_list()
    elif args.builtin_info:
        aomi.template.builtin_info(args.builtin_info)
    elif args.template and args.destination and args.vault_paths:
        aomi.render.template(client, args.template,
                             args.destination,
                             args.vault_paths,
                             args)
    else:
        parser.print_usage()
        sys.exit(2)

    sys.exit(0)
597942
private static void init(List<File> list, File dir, Filter filter)
    {
        File[] files = dir.listFiles();
        for (int i = 0; i < files.length; i++)
        {
            if (files[i].isDirectory())
            {
                init(list, files[i], filter);
            }
            else
            {
                if (filter == null || filter.accepts(files[i].getAbsolutePath()))
                {
                    list.add(files[i]);
                }
            }
        }
    }
230161
function createGruntListener(ev, runner) {
    runner.on(ev, function(test, err) {
      var data = {
        err: err
      };

      if (test) {
        data.title = test.title;
        data.fullTitle = test.fullTitle();
        data.state = test.state;
        data.duration = test.duration;
        data.slow = test.slow;
        data.pending = test.isPending();
      }

      sendMessage('mocha.' + ev, data);
    });
  }