11 #ifndef OOPS_RUNS_TEST_H_ 12 #define OOPS_RUNS_TEST_H_ 18 #include <boost/test/unit_test.hpp> 19 #include <boost/tokenizer.hpp> 21 #include "eckit/config/Configuration.h" 23 #include "oops/util/Logger.h" 34 int execute(
const eckit::Configuration & config)
const;
37 virtual std::string
testid()
const = 0;
49 std::string
args = config.getString(
"test_framework_runtime_config");
52 std::vector<std::string> argvec;
53 argvec.push_back(std::string(
"abcd"));
55 typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
56 boost::char_separator<char> sep(
" \n\t");
57 tokenizer tok(
args, sep);
58 for (tokenizer::iterator it = tok.begin(); it != tok.end(); ++it) {
59 argvec.push_back(*it);
63 int argc = argvec.size();
65 for (
int i = 0;
i < argc; ++
i) {
66 argv[
i] =
new char[argvec[
i].size()+1];
67 strcpy(argv[
i], argvec[
i].c_str());
71 Log::trace() <<
"Registering the unit tests" << std::endl;
73 Log::trace() <<
"Running the unit tests" << std::endl;
74 int result = boost::unit_test::unit_test_main(&
init_unit_test, argc, argv);
75 Log::trace() <<
"Finished running the unit tests" << std::endl;
76 Log::error() <<
"Finished running the unit tests, result = " << result << std::endl;
79 for (
int i = 0;
i < argc; ++
i) {
90 #endif // OOPS_RUNS_TEST_H_ static bool init_unit_test()
l_size ! loop over number of fields ke do je do i
static TestEnvironment & getInstance()
virtual void register_tests() const =0
int execute(const eckit::Configuration &config) const
void setup(const eckit::Configuration &conf)
The namespace for the main oops code.
virtual std::string testid() const =0
std::string appname() const