Mercurial > hg > freeDiameter
comparison freeDiameter/tests/tests.h @ 480:907b00ae3679
Allow file-based debug in tests
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Mon, 09 Aug 2010 18:20:08 +0900 |
parents | 7bfb1bd84996 |
children | b1e96cfc093a |
comparison
equal
deleted
inserted
replaced
479:a186743b89a3 | 480:907b00ae3679 |
---|---|
124 } | 124 } |
125 | 125 |
126 static inline void parse_cmdline(int argc, char * argv[]) { | 126 static inline void parse_cmdline(int argc, char * argv[]) { |
127 int c; | 127 int c; |
128 int no_timeout = 0; | 128 int no_timeout = 0; |
129 while ((c = getopt (argc, argv, "dqnf:")) != -1) { | 129 while ((c = getopt (argc, argv, "dqnf:F:")) != -1) { |
130 switch (c) { | 130 switch (c) { |
131 case 'd': /* Increase verbosity of debug messages. */ | 131 case 'd': /* Increase verbosity of debug messages. */ |
132 test_verbo++; | 132 test_verbo++; |
133 break; | 133 break; |
134 | 134 |
146 #else /* DEBUG */ | 146 #else /* DEBUG */ |
147 TRACE_DEBUG(INFO, "Error: must compile with DEBUG support to use this feature"); | 147 TRACE_DEBUG(INFO, "Error: must compile with DEBUG support to use this feature"); |
148 #endif /* DEBUG */ | 148 #endif /* DEBUG */ |
149 break; | 149 break; |
150 | 150 |
151 case 'F': /* Full debug for the functions in file with this name. */ | |
152 #ifdef DEBUG | |
153 fd_debug_one_file = optarg; | |
154 #else /* DEBUG */ | |
155 TRACE_DEBUG(INFO, "Error: must compile with DEBUG support to use this feature"); | |
156 #endif /* DEBUG */ | |
157 break; | |
158 | |
151 default: /* bug: option not considered. */ | 159 default: /* bug: option not considered. */ |
152 return; | 160 return; |
153 } | 161 } |
154 } | 162 } |
155 fd_g_debug_lvl = (test_verbo > 0) ? (test_verbo - 1) : 0; | 163 fd_g_debug_lvl = (test_verbo > 0) ? (test_verbo - 1) : 0; |