Functions
save-restore_t.cc File Reference
#include "cetlib/filepath_maker.h"
#include "fhiclcpp/ParameterSet.h"
#include <cstdlib>
#include <exception>
#include <iostream>
#include <string>

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 13 of file save-restore_t.cc.

14 {
15  if (argc != 2) {
16  std::cerr << "ERROR: expect exactly one filename!\n";
17  exit(1);
18  }
19  ParameterSet pset_ref;
20  cet::filepath_lookup policy(".:");
21  try {
22  pset_ref = ParameterSet::make(argv[1], policy);
23  }
24  catch (std::exception& e) {
25  std::cerr << "ERROR: unable to parse FHiCL file "
26  << "\"" << argv[1] << "\"\n"
27  << e.what();
28  exit(1);
29  }
30 
31  string const pset_string(pset_ref.to_string());
32  auto const pset_test = ParameterSet::make(pset_string);
33 
34  string pset_test_string(pset_test.to_string());
35  if (pset_string != pset_test_string) {
36  std::cerr << "ERROR: \n"
37  << pset_string << "\n"
38  << " !=\n"
39  << pset_test_string << "\n";
40  exit(1);
41  }
42 }
const double e
unique_ptr< InputSource > make(ParameterSet const &conf, InputSourceDescription &desc)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::string to_string() const
Definition: ParameterSet.h:153