summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2026-06-05 01:06:27 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2026-06-11 18:05:26 +0300
commit9e3fcab6fbecebbcffeafeb5db612a57688cb7f4 (patch)
treefa244e03d37fbefd2efc3955a7dd8d47f6dfe39d /scripts
parent52e582e316c48c53bb3082c29f7862ebc554087e (diff)
downloadlinux-9e3fcab6fbecebbcffeafeb5db612a57688cb7f4.tar.xz
perf test: Truncate printed test descriptions dynamically to avoid terminal wrapping
When test descriptions are extremely long (e.g., the truncated perf.data graceful handling test is 103 characters long), they wrap across terminal boundaries. Because the ANSI escape code to delete the line (PERF_COLOR_DELETE_LINE) only clears a single terminal line, visual wrapping leaves orphan wrapped lines on the screen, which results in the test description being printed multiple times. Resolve this by checking the terminal width (get_term_dimensions) and dynamically truncating the printed test description to fit within the available columns, leaving safety space for the prefix index and status suffix. Also, remove the width padding from the test suite headers which do not display inline status messages. This prevents their trailing colons from wrapping onto new lines on standard width terminals. Finally, avoid GCC 16's -Wformat-truncation warnings by delegating the description padding to pr_info's %-*s format specifier instead of padding within a temporary buffer, and clamp the truncation limit to the temporary buffer's size. JUnit XML output and the failure summary report still print the full, untruncated test descriptions. Assisted-by: Gemini-CLI:Google Gemini 3.1 Pro Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions