exposed only for tests
348115
void apply() {
        final FlushLog log = new FlushLog();
        store.logOperations(txn, log);
        final BlobVault blobVault = store.getBlobVault();
        if (blobVault.requiresTxn()) {
            try {
                blobVault.flushBlobs(blobStreams, blobFiles, deferredBlobsToDelete, txn);
            } catch (Exception e) {
                // out of disk space not expected there
                throw ExodusException.toEntityStoreException(e);
            }
        }
        txn.setCommitHook(new Runnable() {
            @Override
            public void run() {
                log.flushed();
                final EntityIterableCacheAdapterMutable cache = PersistentStoreTransaction.this.mutableCache;
                if (cache != null) { // mutableCache can be null if only blobs are modified
                    applyAtomicCaches(cache);
                }
            }
        });
    }
1213848
def main():
    """"""
    source_files = (
        ('integration', r'results/results.xml'),
        ('unittests', r'results/unittests.xml'),
        ('coverage', r'results/coverage.xml')
    )

    parsed = {k: ElementTree.parse(v).getroot().attrib for k, v in source_files}

    with open(r'results/summary.json', 'w') as fh:
        json.dump(parsed, fh)
1284332
def addUnexpectedSuccess(self, test):
        
        super().addUnexpectedSuccess(test)
        self.test_info(test)
        self._call_test_results('addUnexpectedSuccess', test)
160756
def main():
  
  parser = argparse.ArgumentParser(description='A distributed test framework')
  parser.add_argument('testfile',
      help='The file that is used to determine the test suite run')
  parser.add_argument('--test-only',
      nargs='*',
      dest='test_list',
      help='run only the named tests to help debug broken tests')
  parser.add_argument('--machine-list',
      nargs='*',
      dest='machine_list',
      help='''mapping of logical host names to physical names allowing the same
              test suite to run on different hardware, each argument is a pair
              of logical name and physical name separated by a =''')
  parser.add_argument('--config-overrides',
      nargs='*',
      dest='config_overrides',
      help='''config overrides at execution time, each argument is a config with
              its value separated by a =. This has the highest priority of all
              configs''')
  parser.add_argument('-d', '--output-dir',
      dest='output_dir',
      help='''Directory to write output files and logs. Defaults to the current
              directory.''')
  parser.add_argument("--log-level", dest="log_level", help="Log level (default INFO)", default="INFO")
  parser.add_argument("--console-log-level", dest="console_level", help="Console Log level (default ERROR)",
                      default="ERROR")
  parser.add_argument("--nopassword", action='store_true', dest="nopassword", help="Disable password prompt")
  parser.add_argument("--user", dest="user", help="user to run the test as (defaults to current user)")
  args = parser.parse_args()
  try:
    call_main(args)
  except ValueError:
    #We only sys.exit here, as call_main is used as part of a unit test
    #and should not exit the system
    sys.exit(1)
806674
function( name, testEnvironment ) {
		var currentModule = {
			name: name,
			testEnvironment: testEnvironment,
			tests: []
		};

		// DEPRECATED: handles setup/teardown functions,
		// beforeEach and afterEach should be used instead
		if ( testEnvironment && testEnvironment.setup ) {
			testEnvironment.beforeEach = testEnvironment.setup;
			delete testEnvironment.setup;
		}
		if ( testEnvironment && testEnvironment.teardown ) {
			testEnvironment.afterEach = testEnvironment.teardown;
			delete testEnvironment.teardown;
		}

		config.modules.push( currentModule );
		config.currentModule = currentModule;
	}
419619
function coverage() {
  var jscoverage = spawn(bin('jscoverage'), ['lib', 'lib-cov']);

  jscoverage.on('error', function(err) {
    console.error(err);
    process.exit(1);
  });

  jscoverage.stderr.setEncoding('utf8');
  jscoverage.stderr.on('data', function(err) {
    console.error(err);
    process.exit(1);
  });

  jscoverage.on('close', suite);
}
376207
function (node) {

                //get relevant information
                var testName = node.testObject,
                    testCase = node.parent.testObject,
                    test = testCase[testName],

                    //get the "should" test cases
                    shouldIgnore = testName.indexOf("ignore:") === 0 ||
                                    !inGroups(testCase.groups, this._groups) ||
                                    (testCase._should.ignore || {})[testName];   //deprecated

                //figure out if the test should be ignored or not
                if (shouldIgnore){

                    //update results
                    node.parent.results[testName] = {
                        result: "ignore",
                        message: "Test ignored",
                        type: "test",
                        name: testName.indexOf("ignore:") === 0 ? testName.substring(7) : testName
                    };

                    node.parent.results.ignored++;
                    node.parent.results.total++;

                    this.fire({ type: this.TEST_IGNORE_EVENT,  testCase: testCase, testName: testName });

                    //some environments don't support setTimeout
                    if (typeof setTimeout != "undefined"){
                        setTimeout(function(){
                            YUITest.TestRunner._run();
                        }, 0);
                    } else {
                        this._run();
                    }

                } else {

                    //mark the start time
                    node._start = new Date();

                    //run the setup
                    this._execNonTestMethod(node.parent, "setUp", false);

                    //now call the body of the test
                    this._resumeTest(test);
                }

            }
780860
def leaveoneout(self):
        """"""
        traintestfile = self.fileprefix + '.train'
        options = "-F " + self.format + " " +  self.timbloptions + " -t leave_one_out"
        if sys.version < '3':
            self.api = timblapi.TimblAPI(b(options), b"")
        else:
            self.api = timblapi.TimblAPI(options, "")
        if self.debug:
            print("Enabling debug for timblapi",file=stderr)
            self.api.enableDebug()
        print("Calling Timbl API : " + options,file=stderr)
        if sys.version < '3':
            self.api.learn(b(traintestfile))
            self.api.test(b(traintestfile), b(self.fileprefix + '.out'),b'')
        else:
            self.api.learn(u(traintestfile))
            self.api.test(u(traintestfile), u(self.fileprefix + '.out'),'')
        return self.api.getAccuracy()
258831
public function showABDefinitions()
		{
			$xml = $this->call('show_abdefinitions');

			$ab_tests = array();

			foreach ($xml->Data as $ab_test_item) {
				$ab_test = new ABTest;

				$is_testing_subject = $ab_test_item->test_subject == '1' ? TRUE : FALSE;
				$is_testing_from_address = $ab_test_item->test_from_address == '1' ? TRUE : FALSE;
				$is_testing_content = $ab_test_item->test_content == '1' ? TRUE : FALSE;
				$ab_test
					->setId((int)$ab_test_item->id)
					->setName((string)$ab_test_item->name)
					->setDescription((string)$ab_test_item->description)
					->setListId((int)$ab_test_item->list_id)
					->setListName((string)$ab_test_item->list_name)
					->setSegmentationRuleId((int)$ab_test_item->segmentation_rule_id)
					->setSuppressionList((string)$ab_test_item->suppression_list)
					->setMaxTime((int)$ab_test_item->max_time)
					->setMeasuring((string)$ab_test_item->measuring)
					->setNumSamples((int)$ab_test_item->num_samples)
					->setSampleSize((int)$ab_test_item->sample_size)
					->setSampleType((string)$ab_test_item->sample_type)
					->setTestSubject((boolean)$is_testing_subject)
					->setTestFromAddress((boolean)$is_testing_from_address)
					->setTestContent((boolean)$is_testing_content)
					->setTestEndsWhen((string)$ab_test_item->test_ends_when)
					->setThreshold((int)$ab_test_item->threshold)
					->setPostTestAction((string)$ab_test_item->post_test_action);
				$ab_tests[] = $ab_test;
			}

			return $ab_tests;
		}
1074169
private void cleanData(List<GalenTestInfo> testInfos) {
        for (GalenTestInfo testInfo : testInfos) {
            if (testInfo.getReport() != null) {
                try {
                    FileTempStorage storage = testInfo.getReport().getFileStorage();
                    if (storage != null) {
                        storage.cleanup();
                    }
                } catch (Exception e) {
                    LOG.error("Unkown error during report cleaning", e);
                }
            }
        }
    }
99684
function (test) {
        var baseline = !(test.selector && test.selector.name !== "*");
        if (!logHolder) {
            return; // logging was not enabled
        }

        var remaining = test.cfg.allSelectors.length;
        var heading = 'Testing <strong>' + (baseline ? test.name : test.selector.name) + '</strong>';
        var message = '<br />' + (baseline ? 'baseline' : test.selector.location);
        var footer = '<br />' + remaining + ' remaining test' + (remaining === 1 ? '' : 's');

        logHolder.innerHTML = heading + message + footer;
    }
339032
def _deps_only_toggled(self, widget, data=None):
        
        active = widget.get_active()
        self.dir_name.set_sensitive(not active)
        self.entry_project_name.set_sensitive(not active)
        self.dir_name_browse_btn.set_sensitive(not active)
        self.run_btn.set_sensitive(active or not self.project_name_shown or self.entry_project_name.get_text() != "")
1291743
def may_fire?(obj, to_state=::AASM::NO_VALUE, *args)
      _fire(obj, {:test_only => true}, to_state, *args) # true indicates test firing
    end
180270
def filter_out?(line)
      # "./lib" in project dir, or "/usr/local/blahblah" if installed
      assert_lib_path    = File.expand_path("../..", __FILE__)
      assert_macros_path = File.join(assert_lib_path, "assert/macros")
      assert_bin_regex = /bin\/assert\:/
      ( line.rindex(assert_lib_path, 0) &&
        !line.rindex(assert_macros_path, 0)
      ) ||
      line =~ assert_bin_regex
    end
366325
function (testObj) {
        var duration = PFT.convertMsToHumanReadable(new Date().getTime() - testObj.startTime);
        testObj.duration = duration;
        var suite = "";
        if (testObj.suite) {
            if (testObj.suite.name) {
                suite = testObj.suite.name + " - ";
            }
        }
        var msg = "Completed: '" + suite + testObj.name + "' in " + duration + " with " + testObj.passes + " passes, " +
            testObj.failures.length + " failures, " + testObj.errors.length + " errors.";
        PFT.logger.log(PFT.logger.TEST, msg);
        PFT.tester.onTestCompleted({ test: testObj });
        try {
            testObj.page.close();
        } catch (e) {
            PFT.warn(e);
        }
        PFT.tester.remainingCount--;
        PFT.tester.exitIfDoneTesting();
    }
778855
function(mocha, test) {
        test.parent._onlyTests = test.parent._onlyTests.concat(test);
        mocha.options.hasOnly = true;
        return test;
      }
764132
def show_active_only(self, state):
        
        query = self._copy()
        query.active_only = state
        return query