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 "config.pb.h"
23 #include "goby/moos/goby_moos_app.h"
24 
26 {
27  public:
28  static GobyMOOSAppTest* get_instance();
29 
30  private:
32  {
33  assert(!cfg.has_submessage());
34  RequestQuit();
35  std::cout << "All tests passed. " << std::endl;
36  }
37 
38  ~GobyMOOSAppTest() {}
39  void loop() {}
40  static GobyMOOSAppTest* inst_;
41 };
42 
43 boost::shared_ptr<AppConfig> master_config;
44 GobyMOOSAppTest* GobyMOOSAppTest::inst_ = 0;
45 
46 GobyMOOSAppTest* GobyMOOSAppTest::get_instance()
47 {
48  if (!inst_)
49  {
50  master_config.reset(new AppConfig);
51  inst_ = new GobyMOOSAppTest(*master_config);
52  }
53  return inst_;
54 }
55 
56 int main(int argc, char* argv[]) { return goby::moos::run<GobyMOOSAppTest>(argc, argv); }