Error when running test suite

John Ralls jralls at ceridwen.us
Mon Dec 2 10:22:01 EST 2013


On Dec 2, 2013, at 7:06 AM, Derek Atkins <warlord at MIT.EDU> wrote:

> John Ralls <jralls at ceridwen.us> writes:
> 
>> On Nov 27, 2013, at 1:41 PM, Geert Janssens <janssens-geert at telenet.be> wrote:
>> 
>>> On Wednesday 27 November 2013 11:31:24 John Ralls wrote:
>>>> The comment ahead of that test function says:
>>>> /*
>>>> * There are some differences between distros in the way they name
>>>> * locales, and this can cause trouble with the locale-based
>>>> * formatting. If you get the assert in this function, run locale -a
>>>> * and make sure that en_US, en_GB, and fr_FR are installed and that
>>>> * if a suffix is needed it's in the suffixes array.
>>>> */
>>>> 
>>>> The reason is that the test exercises the date functions in those
>>>> locales to ensure that the i18n part of the date routines is
>>>> functioning correctly.
>>>> 
>>>> Regards,
>>>> John Ralls
>>>> 
>>> John,
>>> 
>>> would it make sense for the test to write a similar message to the
>>> log in case this assert is reached ? Not everybody looks in the test
>>> source automatically.
>>> 
>> 
>> Geert,
>> 
>> Well, print out to stderr. There is no log. 
>> 
>> OK. This is the third time this has come up on the list. In this
>> particular case, it’s an easy change. r23451.
> 
> Arguably the test shouldn't CRASH if the locales don't exist; it should
> at least fail gracefully, no?


OK, make the argument. Unit tests work by using g_assert, which crashes the test. That's by design, to make debugging easy. A better test-runner might trap the assert and close down a bit more gracefully, but gtester isn't that test runner.

Regards,
John Ralls




More information about the gnucash-devel mailing list