VirtualBox

source: kBuild/vendor/grep/2.12/tests/init.cfg@ 3627

Last change on this file since 3627 was 2595, checked in by bird, 13 years ago

gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)

File size: 2.3 KB
Line 
1# This file is sourced by init.sh, *before* its initialization.
2
3# This goes hand in hand with the "9>&2;" in tests/Makefile.am's
4# TESTS_ENVIRONMENT definition.
5stderr_fileno_=9
6
7# Map settings of "none" to the empty string.
8test _"$LOCALE_FR" = _none && LOCALE_FR=
9test _"$LOCALE_FR_UTF8" = _none && LOCALE_FR_UTF8=
10
11# Unset key environment variables.
12if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
13 as_unset=unset
14else
15 as_unset=false
16fi
17
18# Derive this list by searching for string literals as the first
19# argument to getenv:
20# git grep getenv|perl -nle '/\bgetenv *\("(.+?)"\)/ and print $1'|sort -u grep
21vars_='
22GREP_COLOR
23GREP_COLORS
24GREP_OPTIONS
25TERM
26'
27envvar_check_fail=0
28for v_ in $vars_
29do
30 $as_unset $v_
31 if eval test \"\${$v_+set}\" = set; then
32 echo "$0: the $v_ environment variable is set --" \
33 ' unset it and rerun this test' >&2
34 envvar_check_fail=1
35 fi
36done
37
38test "$envvar_check_fail" = 1 && fail_ "failed to unset the above envvars"
39
40require_timeout_()
41{
42 ( timeout 10s true ) > /dev/null 2>&1 \
43 || skip_ your system lacks the timeout program
44 timeout 10s false; test $? = 1 \
45 || skip_ your system has a non-GNU timeout program
46}
47
48require_pcre_()
49{
50 echo . | grep -P . 2>err || skip_ no PCRE support
51 compare /dev/null err || fail_ PCRE available, but stderr not empty.
52}
53
54# Some tests would fail without this particular locale.
55# If the locale is not available, just skip the test.
56require_en_utf8_locale_()
57{
58 path_prepend_ .
59 case $(get-mb-cur-max en_US.UTF-8) in
60 [3456]) ;;
61 *) skip_ 'en_US.UTF-8 locale not found' ;;
62 esac
63}
64
65require_ru_RU_koi8_r()
66{
67 path_prepend_ .
68 case $(get-mb-cur-max ru_RU.KOI8-R) in
69 1) ;;
70 *) skip_ 'ru_RU.KOI8-R locale not found' ;;
71 esac
72}
73
74require_compiled_in_MB_support()
75{
76 require_en_utf8_locale_
77 printf 'é' | LC_ALL=en_US.UTF-8 grep '[[:lower:]]' \
78 || skip_ this test requires MBS support
79}
80
81expensive_()
82{
83 if test "$RUN_EXPENSIVE_TESTS" != yes; then
84 skip_ 'expensive: disabled by default
85This test is relatively expensive, so it is disabled by default.
86To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS
87environment variable set to yes. E.g.,
88
89 env RUN_EXPENSIVE_TESTS=yes make check
90
91or use the shortcut target of the toplevel Makefile,
92
93 make check-expensive
94'
95 fi
96}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette