mirror of
https://github.com/token2/snapd.git
synced 2026-03-13 11:15:47 -07:00
Several of our tests used a trick where a "defer.sh" script was appended to, collecting more and more commands to execute. The restore section then used tac(1) to reverse file order and execute the result, implementing a simple cleanup stack in shell. This patch takes that idea and polishes the rough edges. The new tests.cleanup tool comes with basic but sufficient functionality, tests and documentation to complete the same task. Using this pattern can simplify restore logic as the conditions that lead to prepare or execute customizing something do not have to be repeated. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
Symbolic link
1 line
26 B
Plaintext
Symbolic link
1 line
26 B
Plaintext
../lib/tools/tests.cleanup |