summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-08-15 23:41:24 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-08-15 23:41:24 +0000
commit9e2b97bf352ad1a04ee6c28e2cd2668b63bfec84 (patch)
tree308cea2257cc1665e4fc5e2d33f93a7a78cd1c1d /tests
parent5ce0b45a43fc2de8862a439b6e6281fdd55e27ed (diff)
downloadcoreutils-9e2b97bf352ad1a04ee6c28e2cd2668b63bfec84.tar.xz
* NEWS: Mention that df exits with nonzero status if it generates
no output. This change was in 6.0 but inadvertently unmentioned. * doc/coreutils.texi (df invocation): df exits nonzero if it outpus nothing. * src/df.c (file_systems_processed): Renamed from n_valid_args, and now a boolean. (show_dev): Don't set it until we actually output something. Print the header if this is the first output. (main): Don't print a header, as that is now show_dev's job. * tests/misc/Makefile.am (TESTS): Add df. * tests/misc/df: New file.
Diffstat (limited to 'tests')
-rw-r--r--tests/misc/Makefile.am1
-rwxr-xr-xtests/misc/df17
2 files changed, 18 insertions, 0 deletions
diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am
index 60d5745da..5c01b43b4 100644
--- a/tests/misc/Makefile.am
+++ b/tests/misc/Makefile.am
@@ -27,6 +27,7 @@ TESTS = \
csplit \
date \
date-sec \
+ df \
dirname \
expand \
false-status \
diff --git a/tests/misc/df b/tests/misc/df
new file mode 100755
index 000000000..b1efe61ab
--- /dev/null
+++ b/tests/misc/df
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Ensure that "df ." outputs a header.
+
+if test "$VERBOSE" = yes; then
+ set -x
+ df --version
+fi
+
+case `df .` in
+*'
+'*)
+ fail=0;;
+*)
+ fail=1;;
+esac
+
+(exit $fail); exit $fail