summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko2014-06-19 11:32:11 +0200
committerDenys Vlasenko2014-06-19 11:32:11 +0200
commit6be3a5242ce4855734a4cdd5770b6ea7adaf2b3d (patch)
treee4903316cbaaaeb7cb0a4396daacb3ec1ff8e467 /testsuite
parent14158b4127dba30466c50147b868a6a89702960b (diff)
downloadbusybox-6be3a5242ce4855734a4cdd5770b6ea7adaf2b3d.zip
busybox-6be3a5242ce4855734a4cdd5770b6ea7adaf2b3d.tar.gz
find: exit code fixes for find -exec
function old new delta func_exec 127 100 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/find.tests26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/find.tests b/testsuite/find.tests
index 345d1e8..f041106 100755
--- a/testsuite/find.tests
+++ b/testsuite/find.tests
@@ -15,6 +15,32 @@ testing "find -type f" \
"./testfile\n" \
"" ""
+optional FEATURE_FIND_EXEC
+testing "find -exec exitcode 1" \
+ "cd find.tempdir && find testfile -exec true {} \; 2>&1; echo \$?" \
+ "0\n" \
+ "" ""
+SKIP=
+optional FEATURE_FIND_EXEC_PLUS
+testing "find -exec exitcode 2" \
+ "cd find.tempdir && find testfile -exec true {} + 2>&1; echo \$?" \
+ "0\n" \
+ "" ""
+SKIP=
+# Surprisingly, "-exec false ;" results in exitcode 0! "-exec false +" is different!!!
+optional FEATURE_FIND_EXEC
+testing "find -exec exitcode 3" \
+ "cd find.tempdir && find testfile -exec false {} \; 2>&1; echo \$?" \
+ "0\n" \
+ "" ""
+SKIP=
+optional FEATURE_FIND_EXEC_PLUS
+testing "find -exec exitcode 4" \
+ "cd find.tempdir && find testfile -exec false {} + 2>&1; echo \$?" \
+ "1\n" \
+ "" ""
+SKIP=
+
# testing "description" "command" "result" "infile" "stdin"
rm -rf find.tempdir