summaryrefslogtreecommitdiff
path: root/t/internals.tap
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-08-08 23:09:06 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-08-09 01:24:06 +0200
commitaf8c0d17c7627c4c5f83aecace3f5778a6b7293b (patch)
tree9ece57ecc81559670b94141db40f41d444098994 /t/internals.tap
parent15bf58f3d0d9e24f1b38f2802280fb193782ccfb (diff)
downloadautomake-af8c0d17c7627c4c5f83aecace3f5778a6b7293b.tar.gz
[ng] uninstall: refactor, more processing delegated to GNU make
* lib/am/header-vars.mk (am.chars.space, am.chars.tab): New variables, defined respectively to a literal white space characters and a literal tabulation character. (am.util.whitespace-escape): New function, backslash-escape whitespace characters in the given string. (am.util.file-exists): New function, tell whether the given argument is an existing file; it does so coping correctly with whitespaces and wildcard metacharacters as well, to be usable with paths containing references to $(DESTDIR). (am.uninst.cmd.aux): Re-implement using the new $(am.util.file-exists) function. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/internals.tap')
-rwxr-xr-xt/internals.tap29
1 files changed, 28 insertions, 1 deletions
diff --git a/t/internals.tap b/t/internals.tap
index 31b939c83..f4c8a18f6 100755
--- a/t/internals.tap
+++ b/t/internals.tap
@@ -19,7 +19,7 @@
am_create_testdir=empty
. ./defs || exit 1
-plan_ 12
+plan_ 13
# Filter out Automake comments.
grep -v '^##' "$am_amdir"/header-vars.mk > defn.mk \
@@ -252,4 +252,31 @@ test:
test -f n3
END
+T 'am.util.file-exists' <<'END'
+prepare:
+ : > 'a'
+ test -f 'a'
+ : > '?'
+ test -f '?'
+ : > 'foo bar'
+ test -f 'foo bar'
+ mkdir 'a b'
+ test -d 'a b'
+ : > 'a b'/'c d'
+ test -f 'a b'/'c d'
+test: prepare
+ test x'$(call am.util.file-exists,.)' = x'yes'
+ test x'$(call am.util.file-exists,Makefile)' = x'yes'
+ test x'$(call am.util.file-exists,.././defn.mk)' = x'yes'
+ test x'$(call am.util.file-exists,none)' = x
+ test x'$(call am.util.file-exists,Makefile oops)' = x
+ test x'$(call am.util.file-exists,foo bar)' = x'yes'
+ test x'$(call am.util.file-exists,a b)' = x'yes'
+ test x'$(call am.util.file-exists,a b/c d)' = x'yes'
+ test x'$(call am.util.file-exists,*)' = x
+ test x'$(call am.util.file-exists,a)' = x'yes'
+ test x'$(call am.util.file-exists,[ab])' = x
+ test x'$(call am.util.file-exists,?)' = x'yes'
+END
+
: