2018-03-24 08:44:30 +01:00
|
|
|
#include "git-compat-util.h"
|
|
|
|
#include "test-tool.h"
|
|
|
|
|
|
|
|
struct test_cmd {
|
|
|
|
const char *name;
|
|
|
|
int (*fn)(int argc, const char **argv);
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct test_cmd cmds[] = {
|
2018-03-24 08:44:31 +01:00
|
|
|
{ "chmtime", cmd__chmtime },
|
2018-03-24 08:44:34 +01:00
|
|
|
{ "config", cmd__config },
|
2018-03-24 08:44:35 +01:00
|
|
|
{ "ctype", cmd__ctype },
|
2018-03-24 08:44:36 +01:00
|
|
|
{ "date", cmd__date },
|
2018-03-24 08:44:37 +01:00
|
|
|
{ "delta", cmd__delta },
|
2018-03-24 08:44:38 +01:00
|
|
|
{ "drop-caches", cmd__drop_caches },
|
2018-03-24 08:44:39 +01:00
|
|
|
{ "dump-cache-tree", cmd__dump_cache_tree },
|
2018-03-24 08:44:40 +01:00
|
|
|
{ "dump-split-index", cmd__dump_split_index },
|
2018-03-24 08:44:41 +01:00
|
|
|
{ "example-decorate", cmd__example_decorate },
|
2018-03-24 08:44:42 +01:00
|
|
|
{ "genrandom", cmd__genrandom },
|
2018-03-24 08:44:43 +01:00
|
|
|
{ "hashmap", cmd__hashmap },
|
2018-03-24 08:44:44 +01:00
|
|
|
{ "index-version", cmd__index_version },
|
2018-07-13 18:54:08 +02:00
|
|
|
{ "json-writer", cmd__json_writer },
|
2018-03-24 08:44:33 +01:00
|
|
|
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
|
2018-03-24 08:44:45 +01:00
|
|
|
{ "match-trees", cmd__match_trees },
|
2018-03-24 08:44:46 +01:00
|
|
|
{ "mergesort", cmd__mergesort },
|
2018-03-24 08:44:47 +01:00
|
|
|
{ "mktemp", cmd__mktemp },
|
2018-03-24 08:44:48 +01:00
|
|
|
{ "online-cpus", cmd__online_cpus },
|
2018-03-24 08:44:49 +01:00
|
|
|
{ "path-utils", cmd__path_utils },
|
2018-03-24 08:44:50 +01:00
|
|
|
{ "prio-queue", cmd__prio_queue },
|
2018-03-24 08:44:51 +01:00
|
|
|
{ "read-cache", cmd__read_cache },
|
2018-03-24 08:44:52 +01:00
|
|
|
{ "ref-store", cmd__ref_store },
|
2018-03-24 08:44:53 +01:00
|
|
|
{ "regex", cmd__regex },
|
2018-07-12 00:42:42 +02:00
|
|
|
{ "repository", cmd__repository },
|
2018-03-24 08:44:54 +01:00
|
|
|
{ "revision-walking", cmd__revision_walking },
|
2018-03-24 08:44:55 +01:00
|
|
|
{ "run-command", cmd__run_command },
|
2018-03-24 08:44:56 +01:00
|
|
|
{ "scrap-cache-tree", cmd__scrap_cache_tree },
|
2018-03-24 08:44:57 +01:00
|
|
|
{ "sha1-array", cmd__sha1_array },
|
2018-03-24 08:44:32 +01:00
|
|
|
{ "sha1", cmd__sha1 },
|
2018-03-24 08:44:58 +01:00
|
|
|
{ "sigchain", cmd__sigchain },
|
2018-03-24 08:44:59 +01:00
|
|
|
{ "strcmp-offset", cmd__strcmp_offset },
|
2018-03-24 08:45:00 +01:00
|
|
|
{ "string-list", cmd__string_list },
|
2018-03-24 08:45:01 +01:00
|
|
|
{ "submodule-config", cmd__submodule_config },
|
2018-03-24 08:45:02 +01:00
|
|
|
{ "subprocess", cmd__subprocess },
|
2018-03-24 08:45:03 +01:00
|
|
|
{ "urlmatch-normalization", cmd__urlmatch_normalization },
|
2018-03-24 08:45:04 +01:00
|
|
|
{ "wildmatch", cmd__wildmatch },
|
2018-03-24 08:45:05 +01:00
|
|
|
{ "write-cache", cmd__write_cache },
|
2018-03-24 08:44:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
int cmd_main(int argc, const char **argv)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
2018-05-02 11:38:28 +02:00
|
|
|
BUG_exit_code = 99;
|
2018-03-24 08:44:30 +01:00
|
|
|
if (argc < 2)
|
|
|
|
die("I need a test name!");
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_SIZE(cmds); i++) {
|
|
|
|
if (!strcmp(cmds[i].name, argv[1])) {
|
|
|
|
argv++;
|
|
|
|
argc--;
|
|
|
|
return cmds[i].fn(argc, argv);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
die("There is no test named '%s'", argv[1]);
|
|
|
|
}
|