diff options
Diffstat (limited to 'find/testsuite/find.gnu')
102 files changed, 489 insertions, 0 deletions
diff --git a/find/testsuite/find.gnu/comma.exp b/find/testsuite/find.gnu/comma.exp new file mode 100644 index 0000000..07a768b --- /dev/null +++ b/find/testsuite/find.gnu/comma.exp @@ -0,0 +1 @@ +find_start p {. -maxdepth 2 -false , -name .} diff --git a/find/testsuite/find.gnu/comma.xo b/find/testsuite/find.gnu/comma.xo new file mode 100644 index 0000000..9c558e3 --- /dev/null +++ b/find/testsuite/find.gnu/comma.xo @@ -0,0 +1 @@ +. diff --git a/find/testsuite/find.gnu/delete.exp b/find/testsuite/find.gnu/delete.exp new file mode 100644 index 0000000..e137fa0 --- /dev/null +++ b/find/testsuite/find.gnu/delete.exp @@ -0,0 +1,7 @@ +global FIND +global FINDFLAGS +exec rm -rf tmp +exec mkdir tmp tmp/top tmp/top/one tmp/top/one/foo tmp/top/two +eval exec $FIND tmp $FINDFLAGS -path tmp/top/two -delete +find_start p {tmp -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/delete.xo b/find/testsuite/find.gnu/delete.xo new file mode 100644 index 0000000..c84cffb --- /dev/null +++ b/find/testsuite/find.gnu/delete.xo @@ -0,0 +1,4 @@ +tmp +tmp/top +tmp/top/one +tmp/top/one/foo diff --git a/find/testsuite/find.gnu/depth-d.exp b/find/testsuite/find.gnu/depth-d.exp new file mode 100644 index 0000000..725e676 --- /dev/null +++ b/find/testsuite/find.gnu/depth-d.exp @@ -0,0 +1,8 @@ +exec rm -rf tmp +exec mkdir tmp +exec mkdir tmp/top +exec mkdir tmp/top/one +exec touch tmp/top/one/foo +exec mkdir tmp/top/two +find_start p {tmp/top -d -mindepth 1 -type d -empty -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/depth-d.xo b/find/testsuite/find.gnu/depth-d.xo new file mode 100644 index 0000000..e5f6986 --- /dev/null +++ b/find/testsuite/find.gnu/depth-d.xo @@ -0,0 +1 @@ +tmp/top/two diff --git a/find/testsuite/find.gnu/depth.exp b/find/testsuite/find.gnu/depth.exp new file mode 100644 index 0000000..d4913b2 --- /dev/null +++ b/find/testsuite/find.gnu/depth.exp @@ -0,0 +1,8 @@ +exec rm -rf tmp +exec mkdir tmp +exec mkdir tmp/top +exec mkdir tmp/top/one +exec touch tmp/top/one/foo +exec mkdir tmp/top/two +find_start p {tmp/top -depth -mindepth 1 -type d -empty -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/depth.xo b/find/testsuite/find.gnu/depth.xo new file mode 100644 index 0000000..e5f6986 --- /dev/null +++ b/find/testsuite/find.gnu/depth.xo @@ -0,0 +1 @@ +tmp/top/two diff --git a/find/testsuite/find.gnu/empty.exp b/find/testsuite/find.gnu/empty.exp new file mode 100644 index 0000000..78f94d7 --- /dev/null +++ b/find/testsuite/find.gnu/empty.exp @@ -0,0 +1,7 @@ +# tests for -empty +exec rm -rf tmp +exec mkdir tmp +exec true > tmp/empty +exec echo > tmp/notempty +find_start p { tmp -type f -empty } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/empty.xo b/find/testsuite/find.gnu/empty.xo new file mode 100644 index 0000000..f352040 --- /dev/null +++ b/find/testsuite/find.gnu/empty.xo @@ -0,0 +1 @@ +tmp/empty
\ No newline at end of file diff --git a/find/testsuite/find.gnu/exec-many-rtn-failure.exp b/find/testsuite/find.gnu/exec-many-rtn-failure.exp new file mode 100644 index 0000000..20142e9 --- /dev/null +++ b/find/testsuite/find.gnu/exec-many-rtn-failure.exp @@ -0,0 +1,4 @@ +# POSIX: If the invoked command fails, -exec still returns true if it +# was punctuated with +, because that always returns true. However, +# the program as a whole should return a NON-zero exit status. +find_start f { /tmp -exec true \{\} + -printf "yep\n" -quit } diff --git a/find/testsuite/find.gnu/exec-many-rtn-failure.xo b/find/testsuite/find.gnu/exec-many-rtn-failure.xo new file mode 100644 index 0000000..3b6f27e --- /dev/null +++ b/find/testsuite/find.gnu/exec-many-rtn-failure.xo @@ -0,0 +1 @@ +yep diff --git a/find/testsuite/find.gnu/exec-many-rtn-success.exp b/find/testsuite/find.gnu/exec-many-rtn-success.exp new file mode 100644 index 0000000..142929f --- /dev/null +++ b/find/testsuite/find.gnu/exec-many-rtn-success.exp @@ -0,0 +1,4 @@ +# POSIX: If the invoked command succeeds, -exec should return true if +# it was punctuated with +, because that always returns true. However, +# the program as a whole should also return a zero exit status. +find_start p { /tmp -exec true \{\} + -printf "yep\n" -quit } diff --git a/find/testsuite/find.gnu/exec-many-rtn-success.xo b/find/testsuite/find.gnu/exec-many-rtn-success.xo new file mode 100644 index 0000000..3b6f27e --- /dev/null +++ b/find/testsuite/find.gnu/exec-many-rtn-success.xo @@ -0,0 +1 @@ +yep diff --git a/find/testsuite/find.gnu/exec-one-rtn-fail.exp b/find/testsuite/find.gnu/exec-one-rtn-fail.exp new file mode 100644 index 0000000..c3f66fa --- /dev/null +++ b/find/testsuite/find.gnu/exec-one-rtn-fail.exp @@ -0,0 +1,5 @@ +# If -exec \; fails, it should return false. The return +# value of find shoudl stil; be 0, unless another error has +# happened. +find_start p { /tmp -exec false \; -o \( -printf "yep\n" -quit \) } + diff --git a/find/testsuite/find.gnu/exec-one-rtn-fail.xo b/find/testsuite/find.gnu/exec-one-rtn-fail.xo new file mode 100644 index 0000000..3b6f27e --- /dev/null +++ b/find/testsuite/find.gnu/exec-one-rtn-fail.xo @@ -0,0 +1 @@ +yep diff --git a/find/testsuite/find.gnu/exec-one-rtn-success.exp b/find/testsuite/find.gnu/exec-one-rtn-success.exp new file mode 100644 index 0000000..d3c8b99 --- /dev/null +++ b/find/testsuite/find.gnu/exec-one-rtn-success.exp @@ -0,0 +1,3 @@ +# POSIX: If the invoked command succeeds, -exec should return true if +# it was punctuated with ; +find_start p { /tmp -exec true \; -printf "yep\n" -quit } diff --git a/find/testsuite/find.gnu/exec-one-rtn-success.xo b/find/testsuite/find.gnu/exec-one-rtn-success.xo new file mode 100644 index 0000000..3b6f27e --- /dev/null +++ b/find/testsuite/find.gnu/exec-one-rtn-success.xo @@ -0,0 +1 @@ +yep diff --git a/find/testsuite/find.gnu/execdir-one.exp b/find/testsuite/find.gnu/execdir-one.exp new file mode 100644 index 0000000..a3c747e --- /dev/null +++ b/find/testsuite/find.gnu/execdir-one.exp @@ -0,0 +1,10 @@ +# tests for -name +if { [ dot_is_on_path ] } { + warning { Cannot perform test as your $PATH environment variable includes a reference to the current directory } + untested { skipping this test because your $PATH variable is wrongly set } +} else { + exec rm -rf tmp + exec mkdir tmp tmp/fred tmp/jim + find_start p {tmp -name fred -execdir echo \{\} \; } + exec rm -rf tmp +}
\ No newline at end of file diff --git a/find/testsuite/find.gnu/execdir-one.xo b/find/testsuite/find.gnu/execdir-one.xo new file mode 100644 index 0000000..8584084 --- /dev/null +++ b/find/testsuite/find.gnu/execdir-one.xo @@ -0,0 +1 @@ +./fred diff --git a/find/testsuite/find.gnu/execdir-root-only.exp b/find/testsuite/find.gnu/execdir-root-only.exp new file mode 100644 index 0000000..2c81f46 --- /dev/null +++ b/find/testsuite/find.gnu/execdir-root-only.exp @@ -0,0 +1,24 @@ +# Bug report by Bas van Gompel: +# +# This appears to work well. However when the rootdir is passed, +# something looks fishy: +# +# find / -mindepth 0 -maxdepth 0 -execdir echo {} \; +# .// +# +# I also spotted, when `+' is used: +# +# find / -mindepth 0 -maxdepth 0 -execdir echo == {} + +# == +# == .// +# +# (Notice the first line of output, which should not be there.) + + +# This test checks the second of these two cases. +if { [ dot_is_on_path ] } { + warning { Cannot perform test as your $PATH environment variable includes a reference to the current directory } + untested { skipping this test because your $PATH variable is wrongly set } +} else { + find_start p { / -mindepth 0 -maxdepth 0 -execdir echo == "{}" + } +} diff --git a/find/testsuite/find.gnu/execdir-root-only.xo b/find/testsuite/find.gnu/execdir-root-only.xo new file mode 100644 index 0000000..c975392 --- /dev/null +++ b/find/testsuite/find.gnu/execdir-root-only.xo @@ -0,0 +1 @@ +== / diff --git a/find/testsuite/find.gnu/false.exp b/find/testsuite/find.gnu/false.exp new file mode 100644 index 0000000..31f98a5 --- /dev/null +++ b/find/testsuite/find.gnu/false.exp @@ -0,0 +1,5 @@ +# test for -false. +exec rm -rf tmp +exec mkdir tmp tmp/fred tmp/fred/jim +find_start p { tmp -depth -print -false -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/false.xo b/find/testsuite/find.gnu/false.xo new file mode 100644 index 0000000..9baad64 --- /dev/null +++ b/find/testsuite/find.gnu/false.xo @@ -0,0 +1,3 @@ +tmp/fred/jim +tmp/fred +tmp diff --git a/find/testsuite/find.gnu/follow-arg-parent-symlink.exp b/find/testsuite/find.gnu/follow-arg-parent-symlink.exp new file mode 100644 index 0000000..52f374a --- /dev/null +++ b/find/testsuite/find.gnu/follow-arg-parent-symlink.exp @@ -0,0 +1,6 @@ +exec rm -rf tmp +exec mkdir tmp tmp/dir1 tmp/dir1/dir2 +exec touch tmp/dir1/dir2/foo +exec ln -s dir1 tmp/link1 +find_start p {tmp/link1/dir2 -type f -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/follow-arg-parent-symlink.xo b/find/testsuite/find.gnu/follow-arg-parent-symlink.xo new file mode 100644 index 0000000..0cf5187 --- /dev/null +++ b/find/testsuite/find.gnu/follow-arg-parent-symlink.xo @@ -0,0 +1 @@ +tmp/link1/dir2/foo diff --git a/find/testsuite/find.gnu/follow-basic.exp b/find/testsuite/find.gnu/follow-basic.exp new file mode 100644 index 0000000..bc62a2d --- /dev/null +++ b/find/testsuite/find.gnu/follow-basic.exp @@ -0,0 +1,10 @@ +# Verifies that the -follow option is correctly implemented, +# but does this by using the GNU extension -printf. +exec rm -rf tmp + +exec mkdir tmp +exec ln -s /etc/passwd tmp/LINK +exec ln -s /NOSUCHFILE tmp/BROKEN + +# Links should all be dereferenced unless they are broken. +find_start p { tmp/LINK tmp/BROKEN tmp -follow -printf "%y %d %p\n" } diff --git a/find/testsuite/find.gnu/follow-basic.xo b/find/testsuite/find.gnu/follow-basic.xo new file mode 100644 index 0000000..f2c7940 --- /dev/null +++ b/find/testsuite/find.gnu/follow-basic.xo @@ -0,0 +1,5 @@ +d 0 tmp +f 0 tmp/LINK +f 1 tmp/LINK +l 0 tmp/BROKEN +l 1 tmp/BROKEN diff --git a/find/testsuite/find.gnu/gnu-or.exp b/find/testsuite/find.gnu/gnu-or.exp new file mode 100644 index 0000000..92a2939 --- /dev/null +++ b/find/testsuite/find.gnu/gnu-or.exp @@ -0,0 +1,5 @@ +# test for -false. +exec rm -rf tmp +exec mkdir tmp tmp/fred tmp/fred/jim +find_start p { tmp -depth -print -false -or -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/gnu-or.xo b/find/testsuite/find.gnu/gnu-or.xo new file mode 100644 index 0000000..8484390 --- /dev/null +++ b/find/testsuite/find.gnu/gnu-or.xo @@ -0,0 +1,6 @@ +tmp/fred/jim +tmp/fred/jim +tmp/fred +tmp/fred +tmp +tmp diff --git a/find/testsuite/find.gnu/gnuand.exp b/find/testsuite/find.gnu/gnuand.exp new file mode 100644 index 0000000..2e685ca --- /dev/null +++ b/find/testsuite/find.gnu/gnuand.exp @@ -0,0 +1,5 @@ +# tests for -name +exec rm -rf tmp +exec mkdir tmp tmp/fred tmp/jim +find_start p {tmp -name fred -and -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/gnuand.xo b/find/testsuite/find.gnu/gnuand.xo new file mode 100644 index 0000000..8cc8940 --- /dev/null +++ b/find/testsuite/find.gnu/gnuand.xo @@ -0,0 +1 @@ +tmp/fred diff --git a/find/testsuite/find.gnu/gnunot.exp b/find/testsuite/find.gnu/gnunot.exp new file mode 100644 index 0000000..4951c1e --- /dev/null +++ b/find/testsuite/find.gnu/gnunot.exp @@ -0,0 +1,5 @@ +# tests for ! +exec rm -rf tmp +exec mkdir tmp tmp/fred tmp/jim +find_start p {tmp -not -name fred -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/gnunot.xo b/find/testsuite/find.gnu/gnunot.xo new file mode 100644 index 0000000..776fed4 --- /dev/null +++ b/find/testsuite/find.gnu/gnunot.xo @@ -0,0 +1,2 @@ +tmp +tmp/jim
\ No newline at end of file diff --git a/find/testsuite/find.gnu/ilname.exp b/find/testsuite/find.gnu/ilname.exp new file mode 100644 index 0000000..9b77b6a --- /dev/null +++ b/find/testsuite/find.gnu/ilname.exp @@ -0,0 +1,7 @@ +# tests for -ilname +exec rm -rf tmp +exec mkdir tmp +exec touch tmp/one +exec ln -s one tmp/two +find_start p {tmp -ilname One -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/ilname.xo b/find/testsuite/find.gnu/ilname.xo new file mode 100644 index 0000000..c7b45df --- /dev/null +++ b/find/testsuite/find.gnu/ilname.xo @@ -0,0 +1 @@ +tmp/two diff --git a/find/testsuite/find.gnu/iname.exp b/find/testsuite/find.gnu/iname.exp new file mode 100644 index 0000000..c8c26a4 --- /dev/null +++ b/find/testsuite/find.gnu/iname.exp @@ -0,0 +1,5 @@ +# tests for -name +exec rm -rf tmp +exec mkdir tmp tmp/fred tmp/jim +find_start p {tmp -iname frED -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/iname.xo b/find/testsuite/find.gnu/iname.xo new file mode 100644 index 0000000..8cc8940 --- /dev/null +++ b/find/testsuite/find.gnu/iname.xo @@ -0,0 +1 @@ +tmp/fred diff --git a/find/testsuite/find.gnu/inum.exp b/find/testsuite/find.gnu/inum.exp new file mode 100644 index 0000000..75614f5 --- /dev/null +++ b/find/testsuite/find.gnu/inum.exp @@ -0,0 +1,7 @@ +# test for -inum +exec rm -rf tmp tmp2 +exec touch tmp tmp2 +set list [ split [ exec ls -1i tmp ] ] +set inode [ lindex $list 0 ] +find_start p " tmp tmp2 -inum $inode -print " +exec rm -rf tmp tmp2 diff --git a/find/testsuite/find.gnu/inum.xo b/find/testsuite/find.gnu/inum.xo new file mode 100644 index 0000000..a9a5aec --- /dev/null +++ b/find/testsuite/find.gnu/inum.xo @@ -0,0 +1 @@ +tmp diff --git a/find/testsuite/find.gnu/ipath.exp b/find/testsuite/find.gnu/ipath.exp new file mode 100644 index 0000000..0013e48 --- /dev/null +++ b/find/testsuite/find.gnu/ipath.exp @@ -0,0 +1,5 @@ +# test for -path +exec rm -rf tmp +exec mkdir tmp tmp/top tmp/top/ONE tmp/top/ONE/two +find_start p {tmp/top -ipath Tmp/TOP/one -print 2>/dev/null } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/ipath.xo b/find/testsuite/find.gnu/ipath.xo new file mode 100644 index 0000000..6ac3ca0 --- /dev/null +++ b/find/testsuite/find.gnu/ipath.xo @@ -0,0 +1 @@ +tmp/top/ONE diff --git a/find/testsuite/find.gnu/iregex1.exp b/find/testsuite/find.gnu/iregex1.exp new file mode 100644 index 0000000..c24cdf0 --- /dev/null +++ b/find/testsuite/find.gnu/iregex1.exp @@ -0,0 +1,5 @@ +# test for -iregex +exec rm -rf tmp +exec mkdir tmp tmp/d tmp/d/D tmp/d/D/d tmp/d/D/d/e +find_start p {tmp -iregex {tmp\(/d\)*} -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/iregex1.xo b/find/testsuite/find.gnu/iregex1.xo new file mode 100644 index 0000000..8901de0 --- /dev/null +++ b/find/testsuite/find.gnu/iregex1.xo @@ -0,0 +1,4 @@ +tmp +tmp/d +tmp/d/D +tmp/d/D/d diff --git a/find/testsuite/find.gnu/iwholename.exp b/find/testsuite/find.gnu/iwholename.exp new file mode 100644 index 0000000..d58656a --- /dev/null +++ b/find/testsuite/find.gnu/iwholename.exp @@ -0,0 +1,5 @@ +# test for -iwholename +exec rm -rf tmp +exec mkdir tmp tmp/top tmp/top/one tmp/top/one/two +find_start p {tmp/top -iwholename tmP/TOP/One -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/iwholename.xo b/find/testsuite/find.gnu/iwholename.xo new file mode 100644 index 0000000..66d2877 --- /dev/null +++ b/find/testsuite/find.gnu/iwholename.xo @@ -0,0 +1 @@ +tmp/top/one diff --git a/find/testsuite/find.gnu/lname.exp b/find/testsuite/find.gnu/lname.exp new file mode 100644 index 0000000..ada635f --- /dev/null +++ b/find/testsuite/find.gnu/lname.exp @@ -0,0 +1,7 @@ +# tests for -lname +exec rm -rf tmp +exec mkdir tmp +exec touch tmp/one +exec ln -s one tmp/two +find_start p {tmp -lname one -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/lname.xo b/find/testsuite/find.gnu/lname.xo new file mode 100644 index 0000000..c7b45df --- /dev/null +++ b/find/testsuite/find.gnu/lname.xo @@ -0,0 +1 @@ +tmp/two diff --git a/find/testsuite/find.gnu/name-opt.exp b/find/testsuite/find.gnu/name-opt.exp new file mode 100644 index 0000000..0ec1d8d --- /dev/null +++ b/find/testsuite/find.gnu/name-opt.exp @@ -0,0 +1,8 @@ +# Verifies that -name is not optimized in front of -prune +exec rm -rf tmp +exec mkdir tmp +exec mkdir tmp/top +exec mkdir tmp/top/one +exec touch tmp/top/one/foo +find_start p {tmp/top -prune -name foo} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/name-opt.xo b/find/testsuite/find.gnu/name-opt.xo new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/find/testsuite/find.gnu/name-opt.xo diff --git a/find/testsuite/find.gnu/name-period.exp b/find/testsuite/find.gnu/name-period.exp new file mode 100644 index 0000000..42858fe --- /dev/null +++ b/find/testsuite/find.gnu/name-period.exp @@ -0,0 +1,10 @@ +# Verifies that -name '*bar' will match quux/.foobar. +# See http://standards.ieee.org/reading/ieee/interp/1003-2-92_int/pasc-1003.2-126.html +# Also see http://savannah.gnu.org/bugs/?func=detailitem&item_id=10757 +exec rm -rf tmp +exec mkdir tmp +exec mkdir tmp/top +exec mkdir tmp/top/.one +exec mkdir tmp/top/bane +find_start p {tmp/top -name \*ne -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/name-period.xo b/find/testsuite/find.gnu/name-period.xo new file mode 100644 index 0000000..53cbcdc --- /dev/null +++ b/find/testsuite/find.gnu/name-period.xo @@ -0,0 +1,2 @@ +tmp/top/bane +tmp/top/.one diff --git a/find/testsuite/find.gnu/path.exp b/find/testsuite/find.gnu/path.exp new file mode 100644 index 0000000..40fa01e --- /dev/null +++ b/find/testsuite/find.gnu/path.exp @@ -0,0 +1,5 @@ +# test for -path +exec rm -rf tmp +exec mkdir tmp tmp/top tmp/top/one tmp/top/one/two +find_start p {tmp/top -path tmp/top/one -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/path.xo b/find/testsuite/find.gnu/path.xo new file mode 100644 index 0000000..66d2877 --- /dev/null +++ b/find/testsuite/find.gnu/path.xo @@ -0,0 +1 @@ +tmp/top/one diff --git a/find/testsuite/find.gnu/perm-slash.exp b/find/testsuite/find.gnu/perm-slash.exp new file mode 100644 index 0000000..a5be0ab --- /dev/null +++ b/find/testsuite/find.gnu/perm-slash.exp @@ -0,0 +1,19 @@ +# tests for -perm /nnn +# The slash is a GNU extension + +exec rm -rf tmp +exec mkdir tmp + +## set up a selection of test files +foreach perm { 400 200 555 700 000 050 } { + exec touch "tmp/$perm" + exec chmod $perm "tmp/$perm" +} + +# +# The -o operator normally has a short-circuit effect, +# so we have to use "-exec false \;" to make sure that +# all the parenthesised expression actually fail. +# +find_start p {tmp -mindepth 1 -perm /555 -printf "p/555 %p\n" } +# exec rm -rf tmp tmp2 diff --git a/find/testsuite/find.gnu/perm-slash.xo b/find/testsuite/find.gnu/perm-slash.xo new file mode 100644 index 0000000..f84e5b7 --- /dev/null +++ b/find/testsuite/find.gnu/perm-slash.xo @@ -0,0 +1,4 @@ +p/555 tmp/050 +p/555 tmp/555 +p/555 tmp/400 +p/555 tmp/700
\ No newline at end of file diff --git a/find/testsuite/find.gnu/perm.exp b/find/testsuite/find.gnu/perm.exp new file mode 100644 index 0000000..d4913f8 --- /dev/null +++ b/find/testsuite/find.gnu/perm.exp @@ -0,0 +1,7 @@ +# tests for -perm -0100 (-perm with -) +exec rm -rf tmp +exec mkdir tmp +exec touch tmp/fred +exec chmod 444 tmp/fred +find_start p {tmp -perm -0100} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/perm.xo b/find/testsuite/find.gnu/perm.xo new file mode 100644 index 0000000..a9a5aec --- /dev/null +++ b/find/testsuite/find.gnu/perm.xo @@ -0,0 +1 @@ +tmp diff --git a/find/testsuite/find.gnu/posix-dflt.exp b/find/testsuite/find.gnu/posix-dflt.exp new file mode 100644 index 0000000..3e7d573 --- /dev/null +++ b/find/testsuite/find.gnu/posix-dflt.exp @@ -0,0 +1,10 @@ +# Verifies that the POSIX behaviour without -P or -L options is +# correctly implemented, but does this by using the GNU extension +# -printf. +exec rm -rf tmp + +exec mkdir tmp +exec ln -s /etc/passwd tmp/LINK +exec ln -s /NOSUCHFILE tmp/BROKEN + +find_start p { -P tmp/LINK tmp/BROKEN tmp -printf "%y %d %p\n" } diff --git a/find/testsuite/find.gnu/posix-dflt.xo b/find/testsuite/find.gnu/posix-dflt.xo new file mode 100644 index 0000000..7359d24 --- /dev/null +++ b/find/testsuite/find.gnu/posix-dflt.xo @@ -0,0 +1,5 @@ +d 0 tmp +l 0 tmp/BROKEN +l 0 tmp/LINK +l 1 tmp/BROKEN +l 1 tmp/LINK diff --git a/find/testsuite/find.gnu/posix-h.exp b/find/testsuite/find.gnu/posix-h.exp new file mode 100644 index 0000000..4023b25 --- /dev/null +++ b/find/testsuite/find.gnu/posix-h.exp @@ -0,0 +1,13 @@ +# Verifies that the POSIX -H option is correctly implemented, +# but does this by using the GNU extension -printf. +exec rm -rf tmp + +exec mkdir tmp +exec ln -s /etc/passwd tmp/LINK +exec ln -s /NOSUCHFILE tmp/BROKEN + +# If the file is not on the command line, the link is not +# dereferenced, and so tmp/LINK should appear at depth 1 +# but as type "l". tmp itself appears first at depth 0 as +# a directory. +find_start p { -H tmp/LINK tmp/BROKEN tmp -printf "H1: %y %d %p\n" } diff --git a/find/testsuite/find.gnu/posix-h.xo b/find/testsuite/find.gnu/posix-h.xo new file mode 100644 index 0000000..4d503f7 --- /dev/null +++ b/find/testsuite/find.gnu/posix-h.xo @@ -0,0 +1,5 @@ +H1: d 0 tmp +H1: f 0 tmp/LINK +H1: l 0 tmp/BROKEN +H1: l 1 tmp/BROKEN +H1: l 1 tmp/LINK diff --git a/find/testsuite/find.gnu/posix-l.exp b/find/testsuite/find.gnu/posix-l.exp new file mode 100644 index 0000000..6055edf --- /dev/null +++ b/find/testsuite/find.gnu/posix-l.exp @@ -0,0 +1,10 @@ +# Verifies that the POSIX -L option is correctly implemented, +# but does this by using the GNU extension -printf. +exec rm -rf tmp + +exec mkdir tmp +exec ln -s /etc/passwd tmp/LINK +exec ln -s /NOSUCHFILE tmp/BROKEN + +# Links should all be dereferenced unless they are broken. +find_start p { -L tmp/LINK tmp/BROKEN tmp -printf "%y %d %p\n" } diff --git a/find/testsuite/find.gnu/posix-l.xo b/find/testsuite/find.gnu/posix-l.xo new file mode 100644 index 0000000..f2c7940 --- /dev/null +++ b/find/testsuite/find.gnu/posix-l.xo @@ -0,0 +1,5 @@ +d 0 tmp +f 0 tmp/LINK +f 1 tmp/LINK +l 0 tmp/BROKEN +l 1 tmp/BROKEN diff --git a/find/testsuite/find.gnu/print0.exp b/find/testsuite/find.gnu/print0.exp new file mode 100644 index 0000000..11a3cb6 --- /dev/null +++ b/find/testsuite/find.gnu/print0.exp @@ -0,0 +1,5 @@ +# test for -print0. +exec rm -rf tmp +exec touch tmp +find_start p { tmp -print0 } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/print0.xo b/find/testsuite/find.gnu/print0.xo Binary files differnew file mode 100644 index 0000000..b947b3b --- /dev/null +++ b/find/testsuite/find.gnu/print0.xo diff --git a/find/testsuite/find.gnu/printf-h.exp b/find/testsuite/find.gnu/printf-h.exp new file mode 100644 index 0000000..fb0187c --- /dev/null +++ b/find/testsuite/find.gnu/printf-h.exp @@ -0,0 +1,5 @@ +# Test case for Savannah bug ID #12085. +exec rm -rf tmp +exec touch tmp +find_start p {tmp -printf "RESULT: %h %f\n" } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/printf-h.xo b/find/testsuite/find.gnu/printf-h.xo new file mode 100644 index 0000000..dc6ce01 --- /dev/null +++ b/find/testsuite/find.gnu/printf-h.xo @@ -0,0 +1 @@ +RESULT: . tmp diff --git a/find/testsuite/find.gnu/printf-symlink.exp b/find/testsuite/find.gnu/printf-symlink.exp new file mode 100644 index 0000000..6acc3e6 --- /dev/null +++ b/find/testsuite/find.gnu/printf-symlink.exp @@ -0,0 +1,6 @@ +exec rm -rf tmp +exec mkdir tmp +exec touch tmp/file +exec ln -s file tmp/LINK +find_start p {tmp/LINK -printf "RESULT: %y %Y %p\n" -printf "RESULT2: %Y %y %p\n" } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/printf-symlink.xo b/find/testsuite/find.gnu/printf-symlink.xo new file mode 100644 index 0000000..cc2b69c --- /dev/null +++ b/find/testsuite/find.gnu/printf-symlink.xo @@ -0,0 +1,2 @@ +RESULT: l f tmp/LINK +RESULT2: f l tmp/LINK diff --git a/find/testsuite/find.gnu/printf.exp b/find/testsuite/find.gnu/printf.exp new file mode 100644 index 0000000..c504d85 --- /dev/null +++ b/find/testsuite/find.gnu/printf.exp @@ -0,0 +1,6 @@ +exec rm -rf tmp +exec mkdir tmp +exec touch tmp/file +exec chmod 600 tmp/file +find_start p {tmp -type f -printf "a %d\n" -printf "b %f\n" -printf "c %h\n" -printf "d %H\n" -printf "e %l\n" -printf "f %m\n" -printf "g %n\n" -printf "h %p\n" -printf "i %P\n" -printf "j %y\n" -printf "k %Y\n"} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/printf.xo b/find/testsuite/find.gnu/printf.xo new file mode 100644 index 0000000..4eda7e3 --- /dev/null +++ b/find/testsuite/find.gnu/printf.xo @@ -0,0 +1,11 @@ +a 1 +b file +c tmp +d tmp +e +f 600 +g 1 +h tmp/file +i file +j f +k f diff --git a/find/testsuite/find.gnu/printfHdfl.exp b/find/testsuite/find.gnu/printfHdfl.exp new file mode 100644 index 0000000..517ecc5 --- /dev/null +++ b/find/testsuite/find.gnu/printfHdfl.exp @@ -0,0 +1,2 @@ +# verify that %H with no argument assumes "." +find_start p { -maxdepth 0 -printf "%H" } diff --git a/find/testsuite/find.gnu/printfHdfl.xo b/find/testsuite/find.gnu/printfHdfl.xo new file mode 100644 index 0000000..9c558e3 --- /dev/null +++ b/find/testsuite/find.gnu/printfHdfl.xo @@ -0,0 +1 @@ +. diff --git a/find/testsuite/find.gnu/prune-default-print.exp b/find/testsuite/find.gnu/prune-default-print.exp new file mode 100644 index 0000000..b43a6b9 --- /dev/null +++ b/find/testsuite/find.gnu/prune-default-print.exp @@ -0,0 +1,5 @@ +# Verifies that default -print is used with -prune +exec rm -rf tmp +exec mkdir tmp +find_start p {tmp -prune} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/prune-default-print.xo b/find/testsuite/find.gnu/prune-default-print.xo new file mode 100644 index 0000000..a9a5aec --- /dev/null +++ b/find/testsuite/find.gnu/prune-default-print.xo @@ -0,0 +1 @@ +tmp diff --git a/find/testsuite/find.gnu/quit.exp b/find/testsuite/find.gnu/quit.exp new file mode 100644 index 0000000..610ad7f --- /dev/null +++ b/find/testsuite/find.gnu/quit.exp @@ -0,0 +1,5 @@ +# test for -quit. +exec rm -rf tmp +exec mkdir tmp tmp/top tmp/top/one tmp/top/one/foo tmp/top/two +find_start p {tmp/top/one tmp/top/two -depth -print -name one -quit } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/quit.xo b/find/testsuite/find.gnu/quit.xo new file mode 100644 index 0000000..14c1d8d --- /dev/null +++ b/find/testsuite/find.gnu/quit.xo @@ -0,0 +1,2 @@ +tmp/top/one/foo +tmp/top/one diff --git a/find/testsuite/find.gnu/regex1.exp b/find/testsuite/find.gnu/regex1.exp new file mode 100644 index 0000000..071dcaf --- /dev/null +++ b/find/testsuite/find.gnu/regex1.exp @@ -0,0 +1,5 @@ +# test for -regex +exec rm -rf tmp +exec mkdir tmp tmp/d tmp/d/d tmp/d/d/d tmp/d/d/d/e +find_start p {tmp -regex {tmp\(/d\)*} -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/regex1.xo b/find/testsuite/find.gnu/regex1.xo new file mode 100644 index 0000000..c4259bb --- /dev/null +++ b/find/testsuite/find.gnu/regex1.xo @@ -0,0 +1,4 @@ +tmp +tmp/d +tmp/d/d +tmp/d/d/d diff --git a/find/testsuite/find.gnu/regex2.exp b/find/testsuite/find.gnu/regex2.exp new file mode 100644 index 0000000..71cc1e3 --- /dev/null +++ b/find/testsuite/find.gnu/regex2.exp @@ -0,0 +1,5 @@ +# test for -regex +exec rm -rf tmp +exec mkdir tmp tmp/d tmp/d/d tmp/d/d/d tmp/d/d/d/e +find_start p {tmp -regextype posix-extended -regex {tmp(/d)*} -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/regex2.xo b/find/testsuite/find.gnu/regex2.xo new file mode 100644 index 0000000..c4259bb --- /dev/null +++ b/find/testsuite/find.gnu/regex2.xo @@ -0,0 +1,4 @@ +tmp +tmp/d +tmp/d/d +tmp/d/d/d diff --git a/find/testsuite/find.gnu/samefile-copy.exp b/find/testsuite/find.gnu/samefile-copy.exp new file mode 100644 index 0000000..69e47cd --- /dev/null +++ b/find/testsuite/find.gnu/samefile-copy.exp @@ -0,0 +1,8 @@ +# test for -samefile +exec rm -rf tmp +exec mkdir tmp tmp/one tmp/two +exec touch tmp/file1 tmp/file2 +exec cp tmp/file1 tmp/one/link +exec cp tmp/file2 tmp/two/link +find_start p {tmp/one tmp/two -samefile tmp/file1 -print} +# exec rm -rf tmp diff --git a/find/testsuite/find.gnu/samefile-copy.xo b/find/testsuite/find.gnu/samefile-copy.xo new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/find/testsuite/find.gnu/samefile-copy.xo diff --git a/find/testsuite/find.gnu/samefile-link.exp b/find/testsuite/find.gnu/samefile-link.exp new file mode 100644 index 0000000..e288160 --- /dev/null +++ b/find/testsuite/find.gnu/samefile-link.exp @@ -0,0 +1,9 @@ +# test for -samefile +exec rm -rf tmp +exec mkdir tmp tmp/one tmp/two +exec touch tmp/file1 tmp/file2 +exec ln tmp/file1 tmp/one/link +exec ln -s tmp/file1 tmp/one/symlink +exec ln tmp/file2 tmp/two/link +find_start p {tmp/one tmp/two -samefile tmp/file1 -print} +# exec rm -rf tmp diff --git a/find/testsuite/find.gnu/samefile-link.xo b/find/testsuite/find.gnu/samefile-link.xo new file mode 100644 index 0000000..e53b73e --- /dev/null +++ b/find/testsuite/find.gnu/samefile-link.xo @@ -0,0 +1 @@ +tmp/one/link diff --git a/find/testsuite/find.gnu/samefile-same.exp b/find/testsuite/find.gnu/samefile-same.exp new file mode 100644 index 0000000..739f6c6 --- /dev/null +++ b/find/testsuite/find.gnu/samefile-same.exp @@ -0,0 +1,6 @@ +# test for -samefile +exec rm -rf tmp +exec mkdir tmp tmp/one tmp/two +exec touch tmp/file +find_start p {tmp tmp/file -samefile tmp/file -print} +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/samefile-same.xo b/find/testsuite/find.gnu/samefile-same.xo new file mode 100644 index 0000000..061fd95 --- /dev/null +++ b/find/testsuite/find.gnu/samefile-same.xo @@ -0,0 +1,2 @@ +tmp/file +tmp/file diff --git a/find/testsuite/find.gnu/samefile-symlink.exp b/find/testsuite/find.gnu/samefile-symlink.exp new file mode 100644 index 0000000..1c6aa1f --- /dev/null +++ b/find/testsuite/find.gnu/samefile-symlink.exp @@ -0,0 +1,10 @@ +# test for -samefile +exec rm -rf tmp +exec mkdir tmp tmp/one tmp/two +exec touch tmp/file1 tmp/file2 +exec ln tmp/file1 tmp/one/link +exec ln -s ../file1 tmp/one/symlink +exec ln tmp/file2 tmp/two/link +exec ln -s ../file2 tmp/two/symlink +find_start p { -L tmp/one tmp/two -samefile tmp/file1 -print} +# exec rm -rf tmp diff --git a/find/testsuite/find.gnu/samefile-symlink.xo b/find/testsuite/find.gnu/samefile-symlink.xo new file mode 100644 index 0000000..ca1e727 --- /dev/null +++ b/find/testsuite/find.gnu/samefile-symlink.xo @@ -0,0 +1,2 @@ +tmp/one/link +tmp/one/symlink diff --git a/find/testsuite/find.gnu/sv-bug-12230.exp b/find/testsuite/find.gnu/sv-bug-12230.exp new file mode 100644 index 0000000..f0c435e --- /dev/null +++ b/find/testsuite/find.gnu/sv-bug-12230.exp @@ -0,0 +1,17 @@ +# Bug report by Dmitry V. Levin. +# +# The command: +# find tmp -false -execdir echo == {} + +# Actually produces one line of output. It +# should produce none, because the echo command +# should never be invoked. +# +if { [ dot_is_on_path ] } { + warning { Cannot perform test as your $PATH environment variable includes a reference to the current directory } + untested { skipping this test because your $PATH variable is wrongly set } +} else { + exec rm -rf tmp + exec mkdir tmp + find_start p { tmp -false -execdir echo == "{}" + } + exec rm -rf tmp +} diff --git a/find/testsuite/find.gnu/sv-bug-17477.exp b/find/testsuite/find.gnu/sv-bug-17477.exp new file mode 100644 index 0000000..2cc7fe3 --- /dev/null +++ b/find/testsuite/find.gnu/sv-bug-17477.exp @@ -0,0 +1,2 @@ +# verify that % with no argument fails gracefully +find_start f { -maxdepth 0 -printf "test: %" } diff --git a/find/testsuite/find.gnu/sv-bug-17782.exp b/find/testsuite/find.gnu/sv-bug-17782.exp new file mode 100644 index 0000000..cdd80e6 --- /dev/null +++ b/find/testsuite/find.gnu/sv-bug-17782.exp @@ -0,0 +1,18 @@ +# Savannah bug #17782. +# While -execdir echo blah {} works, -execdir echo "blah {}" doesn't. +# The bug is that the ./ prefix is prepended to the argument containing the +# braces, not to the expansion of the braces, so you get output like +# ./blah foo +# instead of +# blah ./foo +# +if { [ dot_is_on_path ] } { + warning { Cannot perform test as your $PATH environment variable includes a reference to the current directory } + untested { skipping this test because your $PATH variable is wrongly set } +} else { + exec rm -rf tmp + exec mkdir tmp + exec touch tmp/foo + find_start p { tmp -name foo -execdir echo "saw {}" \; } + exec rm -rf tmp +} diff --git a/find/testsuite/find.gnu/sv-bug-17782.xo b/find/testsuite/find.gnu/sv-bug-17782.xo new file mode 100644 index 0000000..2bde550 --- /dev/null +++ b/find/testsuite/find.gnu/sv-bug-17782.xo @@ -0,0 +1 @@ +saw ./foo
\ No newline at end of file diff --git a/find/testsuite/find.gnu/true.exp b/find/testsuite/find.gnu/true.exp new file mode 100644 index 0000000..3da595b --- /dev/null +++ b/find/testsuite/find.gnu/true.exp @@ -0,0 +1,5 @@ +# test for -true. +exec rm -rf tmp +exec mkdir tmp tmp/fred tmp/fred/jim +find_start p { tmp -depth -print -true -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/true.xo b/find/testsuite/find.gnu/true.xo new file mode 100644 index 0000000..8484390 --- /dev/null +++ b/find/testsuite/find.gnu/true.xo @@ -0,0 +1,6 @@ +tmp/fred/jim +tmp/fred/jim +tmp/fred +tmp/fred +tmp +tmp diff --git a/find/testsuite/find.gnu/wholename.exp b/find/testsuite/find.gnu/wholename.exp new file mode 100644 index 0000000..128d1ac --- /dev/null +++ b/find/testsuite/find.gnu/wholename.exp @@ -0,0 +1,5 @@ +# test for -wholename +exec rm -rf tmp +exec mkdir tmp tmp/top tmp/top/one tmp/top/one/two +find_start p {tmp/top -wholename tmp/top/one -print } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/wholename.xo b/find/testsuite/find.gnu/wholename.xo new file mode 100644 index 0000000..66d2877 --- /dev/null +++ b/find/testsuite/find.gnu/wholename.xo @@ -0,0 +1 @@ +tmp/top/one diff --git a/find/testsuite/find.gnu/xtype-symlink.exp b/find/testsuite/find.gnu/xtype-symlink.exp new file mode 100644 index 0000000..500daa5 --- /dev/null +++ b/find/testsuite/find.gnu/xtype-symlink.exp @@ -0,0 +1,7 @@ +exec rm -rf tmp +exec mkdir tmp +exec touch tmp/file +exec ln -s file tmp/LINK +exec ls -l tmp > /tmp/z +find_start p {tmp/LINK -xtype f } +exec rm -rf tmp diff --git a/find/testsuite/find.gnu/xtype-symlink.xo b/find/testsuite/find.gnu/xtype-symlink.xo new file mode 100644 index 0000000..f46bde2 --- /dev/null +++ b/find/testsuite/find.gnu/xtype-symlink.xo @@ -0,0 +1 @@ +tmp/LINK diff --git a/find/testsuite/find.gnu/xtype.exp b/find/testsuite/find.gnu/xtype.exp new file mode 100644 index 0000000..62cb749 --- /dev/null +++ b/find/testsuite/find.gnu/xtype.exp @@ -0,0 +1,8 @@ +# checks for the -xtype test. +exec rm -rf tmp + +exec mkdir tmp +exec ln -s /etc/passwd tmp/LINK +exec ln -s /NOSUCHFILE tmp/BROKEN + +find_start p { -H tmp/LINK tmp/BROKEN tmp -xtype l -printf "xtype is l: %p\n" , \! -xtype l -printf "xtype is not l: %p\n" } diff --git a/find/testsuite/find.gnu/xtype.xo b/find/testsuite/find.gnu/xtype.xo new file mode 100644 index 0000000..92b74ed --- /dev/null +++ b/find/testsuite/find.gnu/xtype.xo @@ -0,0 +1,5 @@ +xtype is l: tmp/LINK +xtype is l: tmp/BROKEN +xtype is not l: tmp +xtype is not l: tmp/LINK +xtype is l: tmp/BROKEN |