]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/sntp/tests_main.cpp
Fix a regression with SA-15:24 patch that prevented NIS from
[FreeBSD/releng/10.2.git] / contrib / ntp / sntp / tests_main.cpp
1 #include "tests_main.h"
2
3 extern "C" {
4 const char * Version = "stub unit test Version string";
5 };
6
7 int main(int argc, char **argv) {
8         ::testing::InitGoogleTest(&argc, argv);
9
10         init_lib();
11         init_auth();
12
13         // Some tests makes use of extra parameters passed to the tests
14         // executable. Save these params as static members of the base class.
15         if (argc > 1) {
16                 ntptest::SetExtraParams(1, argc-1, argv);
17         }
18         
19         return RUN_ALL_TESTS();
20 }
21
22 std::vector<std::string> ntptest::m_params;
23
24 void ntptest::SetExtraParams(int start, int count, char** argv)
25 {
26         for (int i=0; i<count; i++) {
27                 m_params.push_back(argv[i+start]);
28         }
29 }