Beispiel #1
0
static void __run_bq(void *_job) {
	bq_job_base_t *job = (bq_job_base_t *)_job;

	log::handler_default_t log_handler(job->name, &job->log_backend);

	safe_run(*job, &bq_job_base_t::_run);

	delete job;
}
Beispiel #2
0
static void *__run_thr(void *_job) {
	bq_job_base_t *job = (bq_job_base_t *)_job;

	MKCSTR(_name, job->name);

	prctl(PR_SET_NAME, _name);

	log::handler_default_t log_handler(job->name, &job->log_backend);

	safe_run(*job, &bq_job_base_t::_run);

	delete job;

	return NULL;
}
Beispiel #3
0
static bool safe_run_suite(suite_info_t *suite) {
  int success, i = 0, failed = 0, passed = 0;
  const char* segfault_msg = " (segfaulted) ";
  printf("Starting Test Suite %s\n", suite->description);
  suites_run++;
  while (!IS_NULL_TEST_INFO(suite->funcs[i])) {
    if ((success = safe_run(suite->funcs[i].func, suite->init, suite->clean)) == FAIL
        || success == SEGFAULT) {
      printf("Test %s - %sFAILED%s%s\n", suite->funcs[i].description, KRED,
             (success == SEGFAULT) ? segfault_msg : "", KNRM);
      failed++;
      tests_failed++;
    } else {
      printf("Test %s  - %sPASSED%s\n", suite->funcs[i].description, KGRN,KNRM);
      passed++;
      tests_passed++;
    }
    i++;
  }
  printf("\nTest Suite %s: %d passed, %d failed\n\n", suite->description,
      passed, failed);
  return failed == 0;
}
Beispiel #4
0
bq_out_t::~bq_out_t() throw() {
    safe_run(*this, &bq_out_t::flush_all);
}