paragraph for gnunet devs that don't know how to use the web
[oweals/gnunet.git] / src / testing / test_testing_servicestartup.c
1 /*
2       This file is part of GNUnet
3       Copyright (C) 2008, 2009, 2012 GNUnet e.V.
4
5       GNUnet is free software: you can redistribute it and/or modify it
6       under the terms of the GNU Affero General Public License as published
7       by the Free Software Foundation, either version 3 of the License,
8       or (at your option) any later version.
9
10       GNUnet is distributed in the hope that it will be useful, but
11       WITHOUT ANY WARRANTY; without even the implied warranty of
12       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13       Affero General Public License for more details.
14      
15       You should have received a copy of the GNU Affero General Public License
16       along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 /**
20  * @file testing/test_testing_new_servicestartup.c
21  * @brief test case for testing service startup using new testing API
22  * @author Sree Harsha Totakura
23  */
24 #include "platform.h"
25 #include "gnunet_util_lib.h"
26 #include "gnunet_testing_lib.h"
27
28
29 #define LOG(kind,...)                           \
30   GNUNET_log (kind, __VA_ARGS__)
31
32
33 /**
34  * Global test status
35  */
36 static int test_success;
37
38
39 /**
40  * The testing callback function
41  *
42  * @param cls NULL
43  * @param cfg the configuration with which the current testing service is run
44  */
45 static void
46 test_run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg,
47           struct GNUNET_TESTING_Peer *peer)
48 {
49   GNUNET_assert (NULL == cls);
50   GNUNET_assert (NULL != cfg);
51   LOG (GNUNET_ERROR_TYPE_DEBUG, "Service arm started successfully\n");
52   test_success = GNUNET_YES;
53   GNUNET_SCHEDULER_shutdown ();
54 }
55
56
57 /**
58  * The main point of execution
59  */
60 int main (int argc, char *argv[])
61 {
62   test_success = GNUNET_NO;
63   GNUNET_assert (0 == GNUNET_TESTING_service_run ("test-testing-servicestartup",
64                                                   "arm",
65                                                   "test_testing_defaults.conf",
66                                                   &test_run,
67                                                   NULL));
68   return (GNUNET_YES == test_success) ? 0 : 1;
69 }
70
71 /* end of test_testing_servicestartup.c */
72