Skip to content

Commit

Permalink
Display the correct number of jobs ##tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainpelissier authored Aug 12, 2024
1 parent 7504875 commit 5af81cf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions binr/r2r/r2r.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void parse_skip(const char *arg) {
}
}

static void helpvars(void) {
static void helpvars(int workers_count) {
printf (
"R2R_SKIP_ARCHOS=0 # do not run the arch-os-specific tests\n"
"R2R_SKIP_JSON=0 # do not run the JSON tests\n"
Expand All @@ -72,11 +72,11 @@ static void helpvars(void) {
"R2R_JOBS=%d # maximum parallel jobs\n"
"R2R_TIMEOUT=%d # timeout after 1 minute (60 * 60)\n"
"R2R_OFFLINE=0 # same as passing -u\n"
, WORKERS_DEFAULT, TIMEOUT_DEFAULT
, workers_count, TIMEOUT_DEFAULT
);
}

static int help(bool verbose) {
static int help(bool verbose, int workers_count) {
printf ("Usage: r2r [-qvVnLi] [-C dir] [-F dir] [-f file] [-o file] [-s test] [-t seconds] [-j threads] [test file/dir | @test-type]\n");
if (verbose) {
printf (
Expand All @@ -98,7 +98,7 @@ static int help(bool verbose) {
" -u do not git pull/clone test/bins (See R2R_OFFLINE)\n"
" -v show version\n"
"\n");
helpvars ();
helpvars (workers_count);
printf ("\n"
"Supported test types: @asm @json @unit @fuzz @arch @cmd\n"
"OS/Arch for archos tests: "R2R_ARCH_OS"\n");
Expand Down Expand Up @@ -332,7 +332,7 @@ int main(int argc, char **argv) {
r2r_git ();
return 0;
case 'h':
ret = help (true);
ret = help (true, workers_count);
goto beach;
case 'q':
quiet = true;
Expand Down Expand Up @@ -368,7 +368,7 @@ int main(int argc, char **argv) {
workers_count = atoi (opt.arg);
if (workers_count <= 0) {
R_LOG_ERROR ("Invalid thread count");
ret = help (false);
ret = help (false, workers_count);
goto beach;
}
break;
Expand All @@ -383,7 +383,7 @@ int main(int argc, char **argv) {
json_test_file = strdup (opt.arg);
break;
case 'H':
helpvars ();
helpvars (workers_count);
goto beach;
case 'u':
get_bins = false;
Expand All @@ -399,7 +399,7 @@ int main(int argc, char **argv) {
output_file = r_file_abspath (opt.arg);
break;
default:
ret = help (false);
ret = help (false, workers_count);
goto beach;
}
}
Expand Down

0 comments on commit 5af81cf

Please sign in to comment.