]> git.ipfire.org Git - thirdparty/make.git/commit
test_driver: check for leftover temp files after each test
authorPaul Smith <psmith@gnu.org>
Mon, 29 Aug 2022 03:48:09 +0000 (23:48 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 29 Aug 2022 04:09:10 +0000 (00:09 -0400)
commit5eff618c8cbfbe1f386e3a55499cd8fe26cd35a1
tree2e0ff7317ff6b5cfa83d42403dcc78fc821db83a
parent10e130b20793f650835085d5ebe85e4ad0c83654
test_driver: check for leftover temp files after each test

Reset the temp directory for every test to a local directory, then
after each test see if any new temp files were created and not
deleted: if they were then fail the test.  Rather than delete the
temp files we leave them there and avoid reporting files that were
seen before, so the user can investigate them.

Rewrite the temp_stdin tests to rely on this built-in behavior
rather than implementing the checks directly.

* tests/test_driver.pl: Create a $TEMPDIR variable pointing to a
temporary directory outside the test temp directory.
(toplevel) Before starting any tests create a temp directory and set
the POSIX and Windows temp directory environment variables to use it.
(compare_output) Check the contents of the temp directory.  If any
new files have appeared, fail the test.
* tests/scripts/features/temp_stdin: Remove check_tempfile() and
all users of it, plus setting of temp environment variables.
tests/scripts/features/temp_stdin
tests/test_driver.pl