diff options
author | Clément Bœsch <cboesch@gopro.com> | 2017-03-31 10:06:13 +0200 |
---|---|---|
committer | Clément Bœsch <cboesch@gopro.com> | 2017-03-31 10:06:13 +0200 |
commit | b589e83f435f8d7e7abeb3146cdef87b40463e14 (patch) | |
tree | 5ee482d19ab5f72d9bec056b2c98ecc6b6f4adf2 /tests/checkasm/checkasm.c | |
parent | 5273916700f2f1f72d535c35c56e28ed92c48ff7 (diff) | |
parent | 9498237049d15812cecb79df47b196c73013908b (diff) | |
download | ffmpeg-b589e83f435f8d7e7abeb3146cdef87b40463e14.tar.gz |
Merge commit '9498237049d15812cecb79df47b196c73013908b'
* commit '9498237049d15812cecb79df47b196c73013908b':
checkasm: Add --test parameter to check only specific components
Merged-by: Clément Bœsch <cboesch@gopro.com>
Diffstat (limited to 'tests/checkasm/checkasm.c')
-rw-r--r-- | tests/checkasm/checkasm.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c index e070c8dd90..ad897b9001 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -204,6 +204,7 @@ static struct { int nop_time; int cpu_flag; const char *cpu_flag_name; + const char *test_name; } state; /* PRNG state */ @@ -495,6 +496,8 @@ static void check_cpu_flag(const char *name, int flag) state.cpu_flag_name = name; for (i = 0; tests[i].func; i++) { + if (state.test_name && strcmp(tests[i].name, state.test_name)) + continue; state.current_test_name = tests[i].name; tests[i].func(); } @@ -512,7 +515,7 @@ static void print_cpu_name(void) int main(int argc, char *argv[]) { - unsigned int seed; + unsigned int seed = av_get_random_seed(); int i, ret = 0; #if ARCH_ARM && HAVE_ARMV5TE_EXTERNAL @@ -525,22 +528,27 @@ int main(int argc, char *argv[]) return 0; } - if (argc > 1 && !strncmp(argv[1], "--bench", 7)) { + while (argc > 1) { + if (!strncmp(argv[1], "--bench", 7)) { #ifndef AV_READ_TIME - fprintf(stderr, "checkasm: --bench is not supported on your system\n"); - return 1; + fprintf(stderr, "checkasm: --bench is not supported on your system\n"); + return 1; #endif - if (argv[1][7] == '=') { - state.bench_pattern = argv[1] + 8; - state.bench_pattern_len = strlen(state.bench_pattern); - } else - state.bench_pattern = ""; + if (argv[1][7] == '=') { + state.bench_pattern = argv[1] + 8; + state.bench_pattern_len = strlen(state.bench_pattern); + } else + state.bench_pattern = ""; + } else if (!strncmp(argv[1], "--test=", 7)) { + state.test_name = argv[1] + 7; + } else { + seed = strtoul(argv[1], NULL, 10); + } argc--; argv++; } - seed = (argc > 1) ? strtoul(argv[1], NULL, 10) : av_get_random_seed(); fprintf(stderr, "checkasm: using random seed %u\n", seed); av_lfg_init(&checkasm_lfg, seed); |