Goby v2
test.cpp
1 // Copyright 2009-2018 Toby Schneider (http://gobysoft.org/index.wt/people/toby)
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 //
5 //
6 // This file is part of the Goby Underwater Autonomy Project Binaries
7 // ("The Goby Binaries").
8 //
9 // The Goby Binaries are free software: you can redistribute them and/or modify
10 // them under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // The Goby Binaries are distributed in the hope that they will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
21 
22 #include <cassert>
23 #include <cstdio>
24 
25 #include "goby/common/logger.h"
26 
27 using goby::glog;
28 
29 int main(int argc, char* argv[])
30 {
31  goby::glog.add_stream(goby::common::logger::DEBUG3, &std::cerr);
32  goby::glog.set_name(argv[0]);
33 
34  std::string sys_cmd("LD_LIBRARY_PATH=" GOBY_LIB_DIR
35  ":$LD_LIBRARY_PATH GOBY_HDF5_PLUGIN=libgoby_hdf5test.so goby_hdf5 "
36  "--output_file /tmp/test.h5 --include_string_fields=true");
37  std::cout << "Running: [" << sys_cmd << "]" << std::endl;
38  int rc = system(sys_cmd.c_str());
39 
40  if (rc == 0)
41  {
42  std::cout << "All tests passed." << std::endl;
43  }
44 
45  return rc;
46 }
void set_name(const std::string &s)
Set the name of the application that the logger is serving.
Definition: flex_ostream.h:67
common::FlexOstream glog
Access the Goby logger through this object.
void add_stream(logger::Verbosity verbosity=logger::VERBOSE, std::ostream *os=0)
Attach a stream object (e.g. std::cout, std::ofstream, ...) to the logger with desired verbosity...
Definition: flex_ostream.h:96