bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make-4.2.93 patch enhance error reporting from the test suite


From: Dmitry Goncharov
Subject: make-4.2.93 patch enhance error reporting from the test suite
Date: Fri, 3 Jan 2020 22:19:50 -0500

Good morning.

This patch enhances error reporting from the test suite.

E.g.
Clearing work...
cannot unlink work/features/.nfs0000000000c262d5000001ec: Device or
resource busy
cannot unlink work/features: Is a directory
./run_make_tests.pl: 697: Couldn't wipe out work: Is a directory

regards, Dmitry



diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index 49c5c0e..a683313 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)) {
+    printf "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) {
+        printf "cannot remove $object: $!\n";
+        return 0;
+      }
     } else {
       if ($^O ne 'VMS') {
-        unlink $object or return 0;
+        if (!unlink $object) {
+          printf "cannot unlink $object: $!\n";
+          return 0;
+        }
       } else {
         # VMS can have multiple versions of a file.
         1 while unlink $object;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]