2 This file is part of GNUnet.
3 Copyright (C) 2009 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU 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.
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.
16 * @file util/test_program.c
17 * @brief tests for program.c
20 #include "gnunet_util_lib.h"
29 * Main function that will be run.
35 const struct GNUNET_CONFIGURATION_Handle *cfg)
39 GNUNET_assert (setme1 == 1);
40 GNUNET_assert (0 == strcmp (args[0], "extra"));
41 GNUNET_assert (args[1] == NULL);
42 GNUNET_assert (NULL != strstr (cfgfile, "/test_program_data.conf"));
48 main (int argc, char *argv[])
51 char *const argvx[] = {
54 "test_program_data.conf",
61 struct GNUNET_GETOPT_CommandLineOption options1[] = {
62 GNUNET_GETOPT_option_flag ('n',
66 GNUNET_GETOPT_OPTION_END
68 struct GNUNET_GETOPT_CommandLineOption options2[] = {
69 GNUNET_GETOPT_option_flag ('n',
73 GNUNET_GETOPT_option_flag ('N',
77 GNUNET_GETOPT_OPTION_END
79 struct GNUNET_GETOPT_CommandLineOption options3[] = {
80 GNUNET_GETOPT_option_flag ('N',
84 GNUNET_GETOPT_option_flag ('n',
88 GNUNET_GETOPT_OPTION_END
90 struct GNUNET_GETOPT_CommandLineOption options4[] = {
91 GNUNET_GETOPT_option_flag ('n',
95 GNUNET_GETOPT_option_flag ('n',
99 GNUNET_GETOPT_OPTION_END
103 GNUNET_log_setup ("test_program",
106 GNUNET_assert (GNUNET_OK ==
107 GNUNET_PROGRAM_run (7, argvx,
113 GNUNET_assert (GNUNET_OK ==
114 GNUNET_PROGRAM_run (7, argvx,
115 "test_program", "A test",
118 GNUNET_assert (GNUNET_OK ==
119 GNUNET_PROGRAM_run (7, argvx,
120 "test_program", "A test",
123 GNUNET_assert (GNUNET_OK ==
124 GNUNET_PROGRAM_run (7, argvx,
125 "test_program", "A test",
132 /* end of test_program.c */