lix/tests/unit
alois31 cb79437c1c
tree-wide: unify progress bar inactive and paused states
Previously, the progress bar had two subtly different states in which the bar
would not actually render, both with their own shortcomings: inactive (which
was irreversible) and paused (reversible, but swallowing logs). Furthermore,
there was no way of resetting the statistics, so a very bad solution was
implemented (243c0f18da) that would create a new
logger for each line of the repl, leaking the previous one and discarding the
value of printBuildLogs. Finally, if stderr was not attached to a TTY, the
update thread was started even though the logger was not active, violating the
invariant required by the destructor (which is not observed because the logger
is leaked).

In this commit, the two aforementioned states are unified into a single one,
which can be exited again, correctly upholds the invariant that the update
thread is only running while the progress bar is active, and does not swallow
logs. The latter change in behavior is not expected to be a problems in the
rare cases where the paused state was used before, since other loggers (like
the simple one) don't exhibit it anyway. The startProgressBar/stopProgressBar
API is removed due to being a footgun, and a new method for properly resetting
the progress is added.

Co-Authored-By: Qyriad <qyriad@qyriad.me>
Change-Id: I2b7c3eb17d439cd0c16f7b896cfb61239ac7ff3a
2024-06-29 19:18:08 +02:00
..
libcmd util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
libexpr libexpr: add expr memory management 2024-06-17 19:46:44 +00:00
libexpr-support/tests libexpr: pass Exprs as references, not pointers 2024-06-17 19:46:44 +00:00
libmain tree-wide: unify progress bar inactive and paused states 2024-06-29 19:18:08 +02:00
libstore filetransfer: return a Source from download() 2024-06-19 10:50:12 +00:00
libstore-support/tests util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
libutil libutil: add some serialize.hh serializer tests 2024-06-23 11:52:49 +00:00
libutil-support/tests util.hh: Delete remaining file and clean up headers 2024-05-29 12:38:51 +02:00
meson.build libutil: add some serialize.hh serializer tests 2024-06-23 11:52:49 +00:00