summaryrefslogtreecommitdiff
path: root/tests/test_driver.pl
diff options
context:
space:
mode:
authorDmitry Goncharov <dgoncharov@users.sf.net>2020-01-05 10:46:58 -0500
committerPaul Smith <psmith@gnu.org>2020-01-05 10:46:58 -0500
commit4e277f6fbdc9361a006f00f18a13125cc709d0f8 (patch)
treef9020edff4b8ddbd64e808f8ce0f6ae02ace25a1 /tests/test_driver.pl
parentec946d7e21ca55cc03d056f61bd2abc068ede5c0 (diff)
downloadmake-git-4e277f6fbdc9361a006f00f18a13125cc709d0f8.tar.gz
* tests/test_driver.pl: Enhance error messages
Diffstat (limited to 'tests/test_driver.pl')
-rw-r--r--tests/test_driver.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index 49c5c0e4..f18e7854 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -237,7 +237,7 @@ sub toplevel
if (-d $workpath) {
print "Clearing $workpath...\n";
&remove_directory_tree("$workpath/")
- or &error ("Couldn't wipe out $workpath\n");
+ or &error ("Couldn't wipe out $workpath: $!\n");
} else {
mkdir ($workpath, 0777) or &error ("Couldn't mkdir $workpath: $!\n");
}
@@ -1129,8 +1129,9 @@ sub remove_directory_tree
-e $targetdir or return 1;
&remove_directory_tree_inner ("RDT00", $targetdir) or return 0;
- if ($nuketop) {
- rmdir($targetdir) or return 0;
+ if ($nuketop && !rmdir ($targetdir)) {
+ print "Cannot remove $targetdir: $!\n";
+ return 0;
}
return 1;
@@ -1149,10 +1150,16 @@ sub remove_directory_tree_inner
lstat ($object);
if (-d _ && &remove_directory_tree_inner ($subdirhandle, $object)) {
- rmdir $object or return 0;
+ if (!rmdir($object)) {
+ print "Cannot remove $object: $!\n";
+ return 0;
+ }
} else {
if ($^O ne 'VMS') {
- unlink $object or return 0;
+ if (!unlink $object) {
+ print "Cannot unlink $object: $!\n";
+ return 0;
+ }
} else {
# VMS can have multiple versions of a file.
1 while unlink $object;