test_doc
config.cpp
浏览该文件的文档.
1 /*
2  * config.cpp
3  *
4  * Created on: 2011-2-20
5  * Author: fasiondog
6  */
7 
8 #include "config.h"
9 #include <iostream>
10 #include <boost/filesystem.hpp>
11 
12 using namespace boost::filesystem;
13 
15  start_time = std::chrono::system_clock::now();
16 
17  path current = current_path();
18  if ( current.stem() == path("test") ) {
19  current /= path("data");
20  } else {
21  current /= "test_data";
22  }
23 
24  std::cout << "current path : " << current << std::endl;
25 #if defined(BOOST_WINDOWS)
26  std::cout << "configure file: " << current.string() << "\\hikyuu_win.ini" << std::endl;
27  hikyuu_init(current.string() + "\\hikyuu_win.ini");
28 #else
29  std::cout << "configure file: " << current.string() << "/hikyuu_linux.ini" << std::endl;
30  hikyuu_init(current.string() + "/hikyuu_linux.ini");
31 #endif
32 
33  path tmp_dir = current;
34  tmp_dir /= "tmp";
35  if (!exists(tmp_dir)) {
36  create_directory(tmp_dir);
37  }
38 }
39 
41  std::chrono::duration<double> sec = std::chrono::system_clock::now() - start_time;
42  std::cout << "All test spend time: " << sec.count() << "s" << std::endl;
43 }
44 
全局夹具,初始化
Definition: config.h:22
~GConfig()
Definition: config.cpp:40
BOOST_GLOBAL_FIXTURE(GConfig)
GConfig()
Definition: config.cpp:14