]> git.notmuchmail.org Git - notmuch/commitdiff
test: say_color() in one write(2)
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 6 May 2021 14:12:32 +0000 (17:12 +0300)
committerDavid Bremner <david@tethera.net>
Sun, 23 May 2021 11:05:15 +0000 (08:05 -0300)
say_color() used to call (builtin) printf (and tput(1) to stdout)
several times, which caused attempts to write messages with color
to have partial content (e.g. escape sequences) often intermixed
with other tests when parallel tests were run.

Now, with all output collected, then written out using one
printf, all strings with color print out correctly
((at least short) write(2)'s appear to write out "atomically").

While at it, used only one tput(1) execution to determine whether
color output works, and made bold/colors/sgr0 to tput(1) their
values once per test.


No differences found