Example #1
0
void run_test_files(
  const std::string &suite_name, const std::vector<std::string> &files,
  mettle::log::test_logger &logger, const test_compiler &compiler,
  const mettle::filter_set &filter
) {
  const std::vector<std::string> test_suite = {suite_name};

  logger.started_run();
  logger.started_suite(test_suite);

  for(const auto &file : files)
    run_test_file(test_suite, file, logger, compiler, filter);

  logger.ended_suite(test_suite);
  logger.ended_run();
}
Example #2
0
inline file_result
run_test_file(std::vector<std::string> args, log::pipe &&logger) {
    return run_test_file(std::move(args), logger);
}
int main(int argc, const char* argv[])
{
  PgOptions* opts;
  int num_run=0;

  // quick enough to run each time.
  run_test_consts();

  //
  affx::File5_open();

  // throw our errors for testing.
  Err::setThrowStatus(true);

  // Create our option parser, define the options and parse.
  opts = new PgOptions;
  define_testfile5_options(opts);
  opts->parseArgv(argv);

  // Print our help message if necessary.
  if (opts->getBool("help")) {
    opts->usage();
    return 0;
  }

  //
  run_test_list_names("test-list-names.file5");

  ////
  if (opts->getInt("benchmark")!=0) {
    run_test_benchmark_write(opts->get("output"),opts->getInt("benchmark"));
    return 0;
  }
  if (opts->getBool("test-big-vectors")) {
    run_test_big_vectors("test-big-vectors.file5");
    return 0;
  }
  if (opts->getBool("test-text-tsv")) {
    run_test_text_tsv();
    return 0;
  }

  /////
  if (opts->getBool("test-file")) {
    num_run++;
    run_test_file("test-file5-file.file5");
  }
  //
  if (opts->getBool("test-matrix")) {
    num_run++;
    run_test_matrix("test-file5-matrix.file5");
  }
  //
  if (opts->getBool("test-vector")) {
    num_run++;
    run_test_vector_1("test-file5-vector.file5");
    run_test_vector_2("test-file5-vector.file5");
    run_test_vector_3("test-file5-vector-3.file5");
    //
    run_test_vector_string_size("test-file5-vectorstring-z.file5",20,5);
    run_test_vector_string_size("test-file5-vectorstring-nz.file5",20,0);
  }
  //
  if (opts->getBool("test-user-meta")) {
    run_test_usermeta("test-file5-usermeta.file5");
    run_test_usermeta_big("test-file5-usermeta-big.file5");
  }

  if (opts->getBool("test-open-many")) {
    run_test_open_many();
  }

  // 
  if (opts->getBool("test-tsv")) {
    num_run++;
    std::string file_name="test-file5-tsv.file5";
    run_test_tsv_write(file_name);
    run_test_tsv_write(file_name);
    run_test_twoleveltsv("test-file5-twolevel.file5");
    //
    run_test_tsv_delete("test-file5-tsv-delete.file5");
  }

  if (opts->getBool("test-vec-strlen")) {
    run_test_vec_strlen("test-vec-strlen");
    num_run++;
  }

  //
  if (num_run==0) {
    opts->usage();
  }

  //
  delete opts;

  // to test what happens without the close.
  // _exit(0);

  //
  affx::File5_close();

  return 0;
}