projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d9c779
)
test: do not remove state directory on failure
author
Luca Boccassi
<bluca@debian.org>
Tue, 28 Mar 2023 23:07:45 +0000
(
00:07
+0100)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Wed, 29 Mar 2023 03:59:02 +0000
(12:59 +0900)
The test log is in the state directory, and we want to keep it around
when a test fails.
Follow-up for:
256a835f1c6c646a55039659aa2db186fbeb5c5d
test/test-functions
patch
|
blob
|
history
diff --git
a/test/test-functions
b/test/test-functions
index 5a16459aeb8ea4fc490dcfd7ca3f1c480fca8923..1a4e42f575d10cdc0f946a88f7c196aa337b5e12 100644
(file)
--- a/
test/test-functions
+++ b/
test/test-functions
@@
-3040,7
+3040,6
@@
_test_cleanup() {
fi
[[ -n "$TESTDIR" ]] && rm -vfr "$TESTDIR"
[[ -n "$STATEFILE" ]] && rm -vf "$STATEFILE"
- [[ -n "$STATEDIR" ]] && rm -vfr "$STATEDIR"
) || :
}
@@
-3255,7
+3254,8
@@
do_test() {
fi
test_cleanup
if [ $ret -eq 0 ]; then
- rm "$TESTLOG"
+ # $TESTLOG is in $STATEDIR, so clean it up only on success
+ [[ -n "$STATEDIR" ]] && rm -vfr "$STATEDIR"
echo "[OK]"
else
echo "[FAILED]"