2 #define CATCH_CONFIG_RUNNER 3 #include "catch/catch.hpp" 5 #include "cetlib/filepath_maker.h" 21 cout <<
"usage:\n " << processName <<
" [-h]\n";
22 cout <<
" " << processName <<
" <fhicl-config-file> [catch-options]+\n\n";
23 cout <<
"Catch usage:" << endl;
24 session.showHelp(processName +
" <fhicl-config-file>");
31 string processName(argv[0]);
32 auto slashPos = processName.find_last_of(
'/');
33 if (slashPos == string::npos) {
36 if (slashPos > 0ull && slashPos < (processName.size() - 1)) {
37 processName = processName.substr(slashPos + 1);
39 string fhiclConfigFileName;
41 cout <<
"ERROR: expected at least one argument.\n\n";
42 usage(session, processName);
43 }
else if ((strcmp(
"-h", argv[1]) == 0) ||
44 (strncmp(
"--h", argv[1], 3) == 0)) {
45 usage(session, processName);
47 fhiclConfigFileName = argv[1];
52 return fhiclConfigFileName;
56 main(
int argc,
char** argv)
58 Catch::Session catchSession;
59 auto const fhiclConfigFileName =
processOptions(catchSession, argc, argv);
60 int result = catchSession.applyCommandLine(argc, argv);
64 cet::filepath_maker fpm;
67 result = catchSession.run();
69 return (result < 0xff ? result : 0xff);
void SetIteration(string const &val)
static G4UIterminal * session
string processOptions(Catch::Session &session, int &argc, char **&argv)
void make_ParameterSet(intermediate_table const &tbl, ParameterSet &ps)
void StartMessageFacility(fhicl::ParameterSet const &pset, string const &applicationName)
void usage(Catch::Session &session, string processName)
int main(int argc, char **argv)