make-4.2.93 patch enhance error reporting from the test suite

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

make-4.2.93 patch enhance error reporting from the test suite

Gnu - Make - Bugs mailing list
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 | Threaded
Open this post in threaded view
|

Re: make-4.2.93 patch enhance error reporting from the test suite

Paul Smith-20
On Fri, 2020-01-03 at 22:19 -0500, Dmitry Goncharov via Bug reports and
discussion for GNU make wrote:
> This patch enhances error reporting from the test suite.

Thanks I applied this.