From: Dmitry Volyntsev Date: Wed, 29 Sep 2021 16:13:36 +0000 (+0000) Subject: Tests: introducing repeat argument for unit tests. X-Git-Url: http://git.kaiwu.me/postgresql/log/contrib/postgres_fdw/static/gitweb.js?a=commitdiff_plain;h=c953f22d3327910752124b5136b4813fbc9477d0;p=njs.git Tests: introducing repeat argument for unit tests. --- diff --git a/src/test/njs_unit_test.c b/src/test/njs_unit_test.c index c34413fa..81a1eb3d 100644 --- a/src/test/njs_unit_test.c +++ b/src/test/njs_unit_test.c @@ -22797,6 +22797,7 @@ njs_get_options(njs_opts_t *opts, int argc, char **argv) "Options:\n" " -d print disassembled code.\n" " -f PATTERN1[|PATTERN2..] filter test suites to run.\n" + " -r count overrides repeat count for tests.\n" " -v verbose mode.\n"; for (i = 1; i < argc; i++) { @@ -22829,6 +22830,15 @@ njs_get_options(njs_opts_t *opts, int argc, char **argv) njs_stderror("option \"-f\" requires argument\n"); return NJS_ERROR; + case 'r': + if (++i < argc) { + opts->repeat = atoi(argv[i]); + break; + } + + njs_stderror("option \"-r\" requires argument\n"); + return NJS_ERROR; + case 'v': opts->verbose = 1; break; @@ -23033,8 +23043,9 @@ main(int argc, char **argv) op = suite->opts; - op.verbose = opts.verbose; op.disassemble = opts.disassemble; + op.repeat = opts.repeat ? opts.repeat : op.repeat; + op.verbose = opts.verbose; ret = suite->run(suite->tests, suite->n, &suite->name, &op, &stat); if (ret != NJS_OK) {