Skip to content

Commit

Permalink
Improve interactive output on GHA (#15)
Browse files Browse the repository at this point in the history
Before this commit the output of the test262 step was only visible in
the web interface at the end of the test run. Now it prints a status
update every few seconds.
  • Loading branch information
bnoordhuis authored Nov 5, 2023
1 parent 18eb603 commit a59faac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,21 +1889,23 @@ void show_progress(int force) {
if (compact) {
static int last_test_skipped;
static int last_test_failed;
static int dots;
char c = '.';
if (test_skipped > last_test_skipped) c = '-';
if (test_failed > last_test_failed) c = '!';
last_test_skipped = test_skipped;
last_test_failed = test_failed;
fputc(c, stderr);
if (force)
fputc('\n', stderr);
fflush(stderr);
if (force || ++dots % 60 == 0) {
fprintf(stderr, " %d/%d/%d\n",
test_failed, test_count, test_skipped);
}
} else {
/* output progress indicator: erase end of line and return to col 0 */
fprintf(stderr, "%d/%d/%d\033[K\r",
test_failed, test_count, test_skipped);
fflush(stderr);
}
fflush(stderr);
}
}

Expand Down

0 comments on commit a59faac

Please sign in to comment.