bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests/cp/cp-reply: --reply only accepts valid arguments


From: Brock Noland
Subject: [PATCH] tests/cp/cp-reply: --reply only accepts valid arguments
Date: Wed, 30 Apr 2008 21:43:51 -0500

Greetings,

tests is an area where I may be of service. However, I am not overly
familiar with git or how the tests should be written. Before I write a
bunch, I wanted to submit a single test and make sure I am `doing it
right.' As such, I wrote the relatively trivial test below as this
code appeared to be uncovered in:

http://keeda.stanford.edu/~cristic/coreutils-dev-tests/src/

Feedback is appreciated.

Respectfully,
Brock

>From 5727ff8119dc96dc956acb16fb4a2e89500b4842 Mon Sep 17 00:00:00 2001
From: Brock Noland <address@hidden>
Date: Wed, 30 Apr 2008 21:36:29 -0500
Subject: [PATCH] New test for cp - tests --reply

tests/cp/cp-reply: --reply only accepts valid arguments
and deprecated message is printed.

Signed-off-by: Brock Noland <address@hidden>
---
 tests/Makefile.am |    1 +
 tests/cp/cp-reply |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100755 tests/cp/cp-reply

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8dde07e..9a81c28 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -259,6 +259,7 @@ TESTS =                                             \
   cp/src-base-dot                              \
   cp/symlink-slash                             \
   cp/thru-dangling                             \
+  cp/cp-reply                   \
   dd/misc                                      \
   dd/not-rewound                               \
   dd/skip-seek                                 \
diff --git a/tests/cp/cp-reply b/tests/cp/cp-reply
new file mode 100755
index 0000000..2e8a394
--- /dev/null
+++ b/tests/cp/cp-reply
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Test cp --reply invalid-arg and cp --reply deprecated message
+
+# Copyright (C) 2006-2008 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 <http://www.gnu.org/licenses/>.
+
+if test "$VERBOSE" = yes; then
+  set -x
+  cp --version
+fi
+
+. $top_srcdir/tests/lang-default
+. $top_srcdir/tests/test-lib.sh
+
+fail=0
+
+touch a || framework_failure
+cp --reply a 2>&1 | grep -q 'Valid arguments are' || fail=1
+cp --reply yes a b 2>&1 | grep -q 'reply option is deprecated' || fail=1
+
+(exit $fail); exit $fail
--
1.5.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]