]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* tests/scripts/functions/wildcard: Skip slash tests for local glob.
authorPaul Smith <psmith@gnu.org>
Sat, 5 Oct 2019 18:45:45 +0000 (14:45 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 5 Oct 2019 21:48:19 +0000 (17:48 -0400)
tests/scripts/functions/wildcard

index c3210effc310fb2e67e68f51d4cb7e1479eade63..f01f574a97ab626d0b1a2123a8f931f535144cdd 100644 (file)
@@ -75,18 +75,21 @@ run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, '', "file=\n");
 
 # TEST #7: verify that when the input pattern has a trailing slash wildcard
 # returns only directories.
+#
+# Currently this doesn't work with our embedded GLOB so disable it.
 # -------
 
-touch("hellof");
-mkdir("hellod", 0770);
-mkdir("hellod/worldd", 0770);
-touch("hellod/worldf");
-mkdir("hellod/worldd/kend1", 0770);
-mkdir("hellod/worldd/kend2", 0770);
-touch("hellod/worldd/kenf1");
-touch("hellod/worldd/kenf2");
-
-run_make_test(qq!
+if (get_config('USE_SYSTEM_GLOB') eq 'yes') {
+  touch("hellof");
+  mkdir("hellod", 0770);
+  mkdir("hellod/worldd", 0770);
+  touch("hellod/worldf");
+  mkdir("hellod/worldd/kend1", 0770);
+  mkdir("hellod/worldd/kend2", 0770);
+  touch("hellod/worldd/kenf1");
+  touch("hellod/worldd/kenf2");
+
+  run_make_test(qq!
 print3:
 \t\@echo \$(wildcard hello*)
 \t\@echo \$(wildcard hello*/)
@@ -102,56 +105,59 @@ print3:
 \t\@echo \$(wildcard hellod/*/ken?[12])
 \t\@echo \$(wildcard hellod/*/ken?[12]/)
 !, '',
-              "hellod hellof\n"
-              ."hellod/\n"
-              ."hellod/worldd hellod/worldf\n"
-              ."hellod/worldd/\n"
-              ."hellod hellof hellod/worldd hellod/worldf\n"
-              ."hellod/ hellod/worldd/\n"
-              ."hellod/worldd hellod/worldf\n"
-              ."hellod/worldd/\n"
-              ."hellod/worldd hellod/worldf\n"
-              ."hellod/worldd/\n"
-              ."hellod/worldd/kend1/ hellod/worldd/kend2/\n"
-              ."hellod/worldd/kend1 hellod/worldd/kend2 "
-              ."hellod/worldd/kenf1 hellod/worldd/kenf2\n"
-              ."hellod/worldd/kend1/ hellod/worldd/kend2/\n");
-
-unlink('hellof', 'hellod/worldf', 'hellod/worldd/kenf1', 'hellod/worldd/kenf2');
-foreach $d ('hellod/worldd/kend1', 'hellod/worldd/kend2', 'hellod/worldd', 'hellod') {
+                "hellod hellof\n"
+                ."hellod/\n"
+                ."hellod/worldd hellod/worldf\n"
+                ."hellod/worldd/\n"
+                ."hellod hellof hellod/worldd hellod/worldf\n"
+                ."hellod/ hellod/worldd/\n"
+                ."hellod/worldd hellod/worldf\n"
+                ."hellod/worldd/\n"
+                ."hellod/worldd hellod/worldf\n"
+                ."hellod/worldd/\n"
+                ."hellod/worldd/kend1/ hellod/worldd/kend2/\n"
+                ."hellod/worldd/kend1 hellod/worldd/kend2 "
+                ."hellod/worldd/kenf1 hellod/worldd/kenf2\n"
+                ."hellod/worldd/kend1/ hellod/worldd/kend2/\n");
+
+  unlink('hellof', 'hellod/worldf', 'hellod/worldd/kenf1',
+         'hellod/worldd/kenf2');
+  foreach $d ('hellod/worldd/kend1', 'hellod/worldd/kend2', 'hellod/worldd',
+              'hellod') {
     rmdir($d);
+  }
 }
 
 if ($port_type ne 'W32') {
-    # Check wildcard on the root directory
-    run_make_test('print4: ; @echo $(wildcard /)', '', "/\n");
+  # Check wildcard on the root directory
+  run_make_test('print4: ; @echo $(wildcard /)', '', "/\n");
 }
 
 if ($port_type ne 'W32' && eval { symlink("",""); 1 }) {
 
-    # TEST #6: check for wildcards matching directories
-    # See SV 53465
+  # TEST #6: check for wildcards matching directories
+  # See SV 53465
 
-    my $dir = '__rdir';
-    my $lnk = '__ldir';
-    mkdir($dir, 0777);
-    symlink($dir, $lnk);
+  my $dir = '__rdir';
+  my $lnk = '__ldir';
+  mkdir($dir, 0777);
+  symlink($dir, $lnk);
 
-    run_make_test(qq!all: ; \@echo \$(wildcard $lnk*/.)!, '', "$lnk/.");
+  run_make_test(qq!all: ; \@echo \$(wildcard $lnk*/.)!, '', "$lnk/.");
 
-    unlink($lnk);
-    rmdir($dir);
+  unlink($lnk);
+  rmdir($dir);
 
-    # Test for dangling symlinks
-    # This doesn't work with the built-in glob... needs to be updated!
+  # Test for dangling symlinks
+  # This doesn't work with the built-in glob... needs to be updated!
 
-    if (get_config('USE_SYSTEM_GLOB') eq 'yes') {
-        symlink($dir, $lnk);
+  if (get_config('USE_SYSTEM_GLOB') eq 'yes') {
+    symlink($dir, $lnk);
 
-        run_make_test(qq!all: ; \@echo \$(wildcard $lnk)!, '', "$lnk");
+    run_make_test(qq!all: ; \@echo \$(wildcard $lnk)!, '', "$lnk");
 
-        unlink($lnk);
-    }
+    unlink($lnk);
+  }
 }
 
 1;