1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
/* This software was written by Dirk Engling <erdgeist@erdgeist.org>
It is considered beerware. Prost. Skol. Cheers or whatever.
$id$ */
/* System */
#include <string.h>
/* Opentracker */
#include "test.h"
struct module {
const char *name;
void (*run)(void);
};
static const struct module modules[] = {{"scan_urlencoded_query", test_scan_urlencoded_query},
{"ot_iovec", test_iovec},
{"ot_vector", test_vector},
{"ot_random", test_random},
{"ot_hex", test_hex},
{"ot_scan", test_scan},
{"ot_buf", test_buf},
{"ot_ip", test_ip},
{"ot_accesslist", test_accesslist},
{NULL, NULL}};
/* Run every module, or only those whose name contains argv[1] */
int main(int argc, char **argv) {
const struct module *m;
for (m = modules; m->name; ++m) {
if (argc > 1 && !strstr(m->name, argv[1]))
continue;
test_module(m->name);
m->run();
}
return test_summary();
}
|