Re: sort and tests
Derek Robert Price <[email protected]> Tue, 25 Feb 2003 22:33:40 -0500
| Newsgroups | gmane.comp.tex.texi2html.devel |
|---|---|
| Organization | Ximbiot <http://ximbiot.com> |
| Message-ID | <[email protected]> |
Dumas Patrice wrote:
>>I tested texi2html on another computer, and it seems that the letters
>>weren't sorted alike. Indeed in one case upper case came first, in one case
>>lower case came first. This is a bit annoying for tests and comparisons
>>against reference files. My guessi is that it comes from the locale
>>definition. Does anybody knows how to inhibit that, in order to have
>>reproducible tests ?
>>
>>
>
>I have set the local to "C" with setlocale like explained in POSIX, when
>doing tests.
>I hope it will work as intended.
>
>
Sorry I've been out of touch for a few weeks. I'm trying to catch up -
there's no rest for the wicked.
Anyway, your suggestion is what CVS does, mostly. There are also some
differences in sort implementations across platforms. CVS basically
relies on GNU sort being installed. You can look at src/sanity.sh in
the CVS distribution, but here's a snippet:
# We want to invoke a predictable set of i18n behaviors, not whatever
# the user running this script might have set.
# In particular:
# 'sort' and tabs and spaces (LC_COLLATE).
# Messages from getopt (LC_MESSAGES) (in the future, CVS itself might
# also alter its messages based on LC_MESSAGES).
LANG=C
export LANG
LC_ALL=C
export LC_ALL
Okay, I thought there was code to look for GNU sort, but it appears to
be missing. I might be confusing sort with expr. IIRC, when installed
on, at least, some older SUN boxes, the CVS test scripts fail without
GNU expr and, I thought, GNU sort, but I could be wrong. Searching the
CVS email archive on cvshome.org or google might be informative.
Derek
--
*8^)
Email: [email protected]
Get CVS support at <http://ximbiot.com>!
--
I will not teach others to fly.
I will not teach others to fly.
I will not teach others to fly...
- Bart Simpson on chalkboard, _The Simpsons_