summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBernhard Voelker <mail@bernhard-voelker.de>2019-01-09 00:24:34 +0100
committerBernhard Voelker <mail@bernhard-voelker.de>2019-01-09 00:24:34 +0100
commitfb99de8a29cb783a112be774ca671bcde15a310c (patch)
tree3b9c5929e0f98d03e6c656adc86910a1a1c25bda /tests
parentdbc218f5f5d7a3662a29ff8e1aeecd3aac311b44 (diff)
downloadfindutils-fb99de8a29cb783a112be774ca671bcde15a310c.tar.gz
tests: migrate 'refuse-noop' to the new testsuite
* find/testsuite/sv-48180-refuse-noop.sh: Move to ... * tests/find/refuse-noop.sh: ... this, and apply the above. Simplify, and make more robust. * find/testsuite/Makefile.am (tests_shell_progs): Remove the reference to this test ... * tests/local.mk (all_tests): .. and add it here.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/find/refuse-noop.sh36
-rw-r--r--tests/local.mk1
2 files changed, 37 insertions, 0 deletions
diff --git a/tests/find/refuse-noop.sh b/tests/find/refuse-noop.sh
new file mode 100755
index 00000000..856cf2db
--- /dev/null
+++ b/tests/find/refuse-noop.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+# This test verifies that find refuses the internal -noop, ---noop option.
+# Between findutils-4.3.1 and 4.6, find dumped core ($? = 139).
+# See Savannah bug #48180.
+
+# Copyright (C) 2016-2019 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"
+print_ver_ find oldfind
+
+# Exercise both the previous name of the pseudo-option '-noop',
+# and the now renamed '---noop' option for both find executables.
+for exe in find oldfind; do
+ for opt in 'noop' '--noop'; do
+ rm -f out err || framework_failure_
+ returns_ 1 "$exe" "-${opt}" > out 2> err || fail=1
+ compare /dev/null out || fail=1
+ grep "find: unknown predicate .-${opt}." err \
+ || { cat err; fail=1; }
+ done
+done
+
+Exit $fail
diff --git a/tests/local.mk b/tests/local.mk
index fc345572..01176031 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -111,6 +111,7 @@ all_tests = \
tests/find/printf_inode.sh \
tests/find/execdir-fd-leak.sh \
tests/find/exec-plus-last-file.sh \
+ tests/find/refuse-noop.sh \
$(all_root_tests)
$(TEST_LOGS): $(PROGRAMS)