Blame tests/envvar-check

Packit Service fdd496
# -*- sh -*-
Packit Service fdd496
# Check environment variables for sane values while testing.
Packit Service fdd496
Packit Service fdd496
# Copyright (C) 2000-2017 Free Software Foundation, Inc.
Packit Service fdd496
Packit Service fdd496
# This program is free software: you can redistribute it and/or modify
Packit Service fdd496
# it under the terms of the GNU General Public License as published by
Packit Service fdd496
# the Free Software Foundation, either version 3 of the License, or
Packit Service fdd496
# (at your option) any later version.
Packit Service fdd496
Packit Service fdd496
# This program is distributed in the hope that it will be useful,
Packit Service fdd496
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fdd496
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service fdd496
# GNU General Public License for more details.
Packit Service fdd496
Packit Service fdd496
# You should have received a copy of the GNU General Public License
Packit Service fdd496
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit Service fdd496
Packit Service fdd496
if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
Packit Service fdd496
  as_unset=unset
Packit Service fdd496
else
Packit Service fdd496
  as_unset=false
Packit Service fdd496
fi
Packit Service fdd496
Packit Service fdd496
envvar_check_fail=0
Packit Service fdd496
vars='
Packit Service fdd496
  _POSIX2_VERSION
Packit Service fdd496
  _STDBUF_E
Packit Service fdd496
  _STDBUF_I
Packit Service fdd496
  _STDBUF_O
Packit Service fdd496
  BASH_ENV
Packit Service fdd496
  BLOCKSIZE
Packit Service fdd496
  BLOCK_SIZE
Packit Service fdd496
  CDPATH
Packit Service fdd496
  COLUMNS
Packit Service fdd496
  DF_BLOCK_SIZE
Packit Service fdd496
  DU_BLOCK_SIZE
Packit Service fdd496
  EDITOR
Packit Service fdd496
  ENV
Packit Service fdd496
  GREP_OPTIONS
Packit Service fdd496
  LANGUAGE
Packit Service fdd496
  LS_BLOCK_SIZE
Packit Service fdd496
  LS_COLORS
Packit Service fdd496
  OMP_NUM_THREADS
Packit Service fdd496
  POSIXLY_CORRECT
Packit Service fdd496
  QUOTING_STYLE
Packit Service fdd496
  SIMPLE_BACKUP_SUFFIX
Packit Service fdd496
  TABSIZE
Packit Service fdd496
  TERM
Packit Service fdd496
  COLORTERM
Packit Service fdd496
  TIME_STYLE
Packit Service fdd496
  TMPDIR
Packit Service fdd496
  VERSION_CONTROL
Packit Service fdd496
'
Packit Service fdd496
for var in $vars
Packit Service fdd496
do
Packit Service fdd496
  $as_unset $var
Packit Service fdd496
  if eval test \"\${$var+set}\" = set; then
Packit Service fdd496
    echo "$0: the $var environment variable is set --" \
Packit Service fdd496
      ' unset it and rerun this test' >&2
Packit Service fdd496
    envvar_check_fail=1
Packit Service fdd496
  fi
Packit Service fdd496
done
Packit Service fdd496
Packit Service fdd496
test "$envvar_check_fail" = 1 && exit 1