Welcome! Log In Create A New Profile

Advanced

[njs] Tests: introducing repeat argument for unit tests.

Dmitry Volyntsev
September 29, 2021 12:16PM
details: https://hg.nginx.org/njs/rev/56e3f06da4f0
branches:
changeset: 1709:56e3f06da4f0
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Wed Sep 29 16:13:36 2021 +0000
description:
Tests: introducing repeat argument for unit tests.

diffstat:

src/test/njs_unit_test.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diffs (38 lines):

diff -r 06d4768b37d8 -r 56e3f06da4f0 src/test/njs_unit_test.c
--- a/src/test/njs_unit_test.c Wed Sep 29 13:45:26 2021 +0000
+++ b/src/test/njs_unit_test.c Wed Sep 29 16:13:36 2021 +0000
@@ -22797,6 +22797,7 @@ njs_get_options(njs_opts_t *opts, int ar
"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 ar
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.disassemble = opts.disassemble;
+ op.repeat = opts.repeat ? opts.repeat : op.repeat;
op.verbose = opts.verbose;
- op.disassemble = opts.disassemble;

ret = suite->run(suite->tests, suite->n, &suite->name, &op, &stat);
if (ret != NJS_OK) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Tests: introducing repeat argument for unit tests.

Dmitry Volyntsev 510 September 29, 2021 12:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 132
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready