t/helper: merge test-submodule-config into test-tool
[git.git] / t / helper / test-tool.c
blob36b441a113d87878d91f00501c90cce74524f79f
1 #include "git-compat-util.h"
2 #include "test-tool.h"
4 struct test_cmd {
5 const char *name;
6 int (*fn)(int argc, const char **argv);
7 };
9 static struct test_cmd cmds[] = {
10 { "chmtime", cmd__chmtime },
11 { "config", cmd__config },
12 { "ctype", cmd__ctype },
13 { "date", cmd__date },
14 { "delta", cmd__delta },
15 { "drop-caches", cmd__drop_caches },
16 { "dump-cache-tree", cmd__dump_cache_tree },
17 { "dump-split-index", cmd__dump_split_index },
18 { "example-decorate", cmd__example_decorate },
19 { "genrandom", cmd__genrandom },
20 { "hashmap", cmd__hashmap },
21 { "index-version", cmd__index_version },
22 { "lazy-init-name-hash", cmd__lazy_init_name_hash },
23 { "match-trees", cmd__match_trees },
24 { "mergesort", cmd__mergesort },
25 { "mktemp", cmd__mktemp },
26 { "online-cpus", cmd__online_cpus },
27 { "path-utils", cmd__path_utils },
28 { "prio-queue", cmd__prio_queue },
29 { "read-cache", cmd__read_cache },
30 { "ref-store", cmd__ref_store },
31 { "regex", cmd__regex },
32 { "revision-walking", cmd__revision_walking },
33 { "run-command", cmd__run_command },
34 { "scrap-cache-tree", cmd__scrap_cache_tree },
35 { "sha1-array", cmd__sha1_array },
36 { "sha1", cmd__sha1 },
37 { "sigchain", cmd__sigchain },
38 { "strcmp-offset", cmd__strcmp_offset },
39 { "string-list", cmd__string_list },
40 { "submodule-config", cmd__submodule_config },
43 int cmd_main(int argc, const char **argv)
45 int i;
47 if (argc < 2)
48 die("I need a test name!");
50 for (i = 0; i < ARRAY_SIZE(cmds); i++) {
51 if (!strcmp(cmds[i].name, argv[1])) {
52 argv++;
53 argc--;
54 return cmds[i].fn(argc, argv);
57 die("There is no test named '%s'", argv[1]);