summaryrefslogtreecommitdiff
path: root/tests/envvar-check
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-03-24 17:40:29 +0000
committerJim Meyering <jim@meyering.net>2004-03-24 17:40:29 +0000
commitebe3477b7294134acdc02828393036235cdfc57e (patch)
tree1145002bd064cf22154527d2c4a298059c5b29de /tests/envvar-check
parent2a6326a83df77cdcc5fbf2a27f33a816b82f3394 (diff)
downloadcoreutils-ebe3477b7294134acdc02828393036235cdfc57e.tar.xz
Test for BLOCKSIZE. Factor the code to simplify it.
Diffstat (limited to 'tests/envvar-check')
-rw-r--r--tests/envvar-check65
1 files changed, 20 insertions, 45 deletions
diff --git a/tests/envvar-check b/tests/envvar-check
index bfc6c79c5..406a0692f 100644
--- a/tests/envvar-check
+++ b/tests/envvar-check
@@ -1,53 +1,28 @@
+# -*- sh -*-
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
-# FIXME-someday: The following is begging to be factored, ...
-
-$as_unset VERSION_CONTROL SIMPLE_BACKUP_SUFFIX
-$as_unset BLOCK_SIZE DU_BLOCK_SIZE DF_BLOCK_SIZE LS_BLOCK_SIZE
-
-if test "${VERSION_CONTROL+set}" = set; then
- echo "$0: the VERSION_CONTROL envvar is set --" \
- ' unset it and rerun this test' >&2
- envvar_check_fail=1
-fi
-
-if test "${SIMPLE_BACKUP_SUFFIX+set}" = set; then
- echo "$0: the SIMPLE_BACKUP_SUFFIX envvar is set --" \
- ' unset it and rerun this test' >&2
- >&2
- envvar_check_fail=1
-fi
-
-if test "${BLOCK_SIZE+set}" = set; then
- echo "$0: the BLOCK_SIZE envvar is set --" \
- ' unset it and rerun this test' >&2
- >&2
- envvar_check_fail=1
-fi
-
-if test "${DU_BLOCK_SIZE+set}" = set; then
- echo "$0: the DU_BLOCK_SIZE envvar is set --" \
- ' unset it and rerun this test' >&2
- >&2
- envvar_check_fail=1
-fi
-
-if test "${DF_BLOCK_SIZE+set}" = set; then
- echo "$0: the DF_BLOCK_SIZE envvar is set --" \
- ' unset it and rerun this test' >&2
- >&2
- envvar_check_fail=1
-fi
-
-if test "${LS_BLOCK_SIZE+set}" = set; then
- echo "$0: the LS_BLOCK_SIZE envvar is set --" \
- ' unset it and rerun this test' >&2
- >&2
- envvar_check_fail=1
-fi
+envvar_check_failed=0
+vars='
+ BLOCKSIZE
+ BLOCK_SIZE
+ DF_BLOCK_SIZE
+ DU_BLOCK_SIZE
+ LS_BLOCK_SIZE
+ SIMPLE_BACKUP_SUFFIX
+ VERSION_CONTROL
+'
+for var in $vars
+do
+ $as_unset $var
+ if eval test \"\${$var+set}\" = set; then
+ echo "$0: the $var environment variable is set --" \
+ ' unset it and rerun this test' >&2
+ envvar_check_failed=1
+ fi
+done
test "$envvar_check_fail" = 1 && exit 1