[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master d7ab80c6 04/27: Clean up beforehand, not afte
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master d7ab80c6 04/27: Clean up beforehand, not afterward |
Date: |
Mon, 25 Apr 2022 12:56:13 -0400 (EDT) |
branch: master
commit d7ab80c647e93d5b798e8d501c93a636ffcf3dd5
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Clean up beforehand, not afterward
Formerly, files created as testing artifacts in a temporary directory
were obliterated at the end of the run. This made it less easy to
discern the reason for any failure. And anything left over from an
earlier run became a demonstration of Murphy's Law. And the cleanup
command was in effect
rm "$throwaway_dir"/*
which could have a surprising effect under various circumstances.
Now, the temporary directory is obliterated before its first use, by
rm -rf "$throwaway_dir"
which is less unsafe to copy and paste to the command line--so no old
artifacts can cause trouble, and the files remain for analysis after
the run completes (or fails to complete). This does waste two megabytes
of storage, but anyone who cares can clean up manually.
---
nychthemeral_test.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index af3e40a5..919984c1 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -362,8 +362,11 @@ java -jar /opt/lmi/third_party/rng/jing.jar -c xrc.rnc
./*.xrc 2>&1 \
| tee "$log_dir"/xrc
# Run the following tests in a throwaway directory so that the files
-# they create can be cleaned up easily.
+# they create can be cleaned up easily. To guard against interference
+# from any files left over from previous runs, destroy that directory
+# first, then recreate it.
throwaway_dir="$log_dir"/tmp
+rm -rf "$throwaway_dir"
mkdir --parents "$throwaway_dir"
cd "$throwaway_dir"
@@ -411,11 +414,6 @@ printf '%b' "\
srcdir=. datadir=. /opt/lmi/src/lmi/mst_to_xst.sh
cmp eraseme.xst eraseme.touchstone
-# Clean up stray output. (The zsh '(N)' glob qualifier turns on
-# null_glob for a single expansion.)
-# shellcheck disable=SC2039,SC3002
-for z in "$throwaway_dir"/*(N); do rm "$z"; done
-
printf '\n# test PETE rebuild\n\n'
# Automatically-generated PETE files are in the repository.
- [lmi-commits] [lmi] master d195c7af 10/27: Add a unit test for ledger_format(), (continued)
- [lmi-commits] [lmi] master d195c7af 10/27: Add a unit test for ledger_format(), Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 3064fee4 09/27: Add a helper function with a deliberately ugly name, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 37b663fe 11/27: Add an option to format cents as decimal dollars, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 550db6d9 15/27: Record speed measurements, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master a7d075cd 16/27: Document, suppress, or expunge unused formats, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master fdb47029 08/27: Fix dblize()ation in commented-out code, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 174198af 12/27: Reformat, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master dcbe9418 14/27: Change currency fields in ledger to integral cents, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master af0666c3 24/27: Distinguish two ledger formats, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 7b30e2d8 03/27: Filter unexpectedly small system-test discrepancies, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master d7ab80c6 04/27: Clean up beforehand, not afterward,
Greg Chicares <=
- [lmi-commits] [lmi] master 12192723 06/27: Add two new ledger emission options, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 119df7a9 13/27: Add a 'divisor' argument to LedgerBase::value_str(), Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 2b108ed7 18/27: Avoid unnecessary rounding, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master b7c61b4d 20/27: Regularize format names, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 8de190ce 17/27: Regularize whitespace, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 0b6a3b69 02/27: Avoid writing " \n", Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 95b4e917 19/27: Remove an unnecessary comment, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 61f6a237 21/27: Reorder format-style map, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 299cc249 22/27: Improve documentation, Greg Chicares, 2022/04/25
- [lmi-commits] [lmi] master 6f50ad93 23/27: Transpose a ledger format, Greg Chicares, 2022/04/25