File: common_catch_main.cc

package info (click to toggle)
purify 5.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 186,836 kB
  • sloc: cpp: 17,731; python: 510; xml: 182; makefile: 7; sh: 6
file content (22 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define CATCH_CONFIG_RUNNER

#include "purify/config.h"
#include <sopt/config.h>
#include <memory>
#include <random>
#include <catch2/catch_all.hpp>
#include "purify/logging.h"
#include <sopt/logging.h>

std::unique_ptr<std::mt19937_64> mersenne(new std::mt19937_64(0));

int main(int argc, char **argv) {
  Catch::Session session;  // There must be exactly once instance

  int returnCode = session.applyCommandLine(argc, const_cast<char **>(argv));
  if (returnCode != 0)  // Indicates a command line error
    return returnCode;
  mersenne.reset(new std::mt19937_64(session.configData().rngSeed));

  return session.run();
}