Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

locale dependent test #16

Closed
vagrantc opened this issue Jan 16, 2021 · 2 comments
Closed

locale dependent test #16

vagrantc opened this issue Jan 16, 2021 · 2 comments

Comments

@vagrantc
Copy link
Contributor

Even though the tests in Kaem/test.sh are prefixed with LANG=C, other variables such as LC_ALL can override the effective locale.

The test suite for Kaem/test/test14 fails when LC_ALL=C.

18:53 < vagrantc> LANG=en_US.UTF-8 ./bin/kaem -f "Kaem/test/test14/kaem.test"
18:53 < vagrantc> hiprintf: warning: ignoring excess arguments, starting with ‘’
18:54 < vagrantc> LANG=C ./bin/kaem -f "Kaem/test/test14/kaem.test"
18:54 < vagrantc> hiprintf: warning: ignoring excess arguments, starting with ''
18:54 < vagrantc> now for a magic trick, since they're called with LANG=C
18:54 < vagrantc> LC_ALL=en_US.UTF-8 LANG=C ./bin/kaem -f "Kaem/test/test14/kaem.test"
18:54 < vagrantc> hiprintf: warning: ignoring excess arguments, starting with ‘’

I'm not sure what the best fix is at the moment; maybe prefix the tests with LC_ALL=C and update the test suite answers to use the checksum for the C locale variant.

Alternately, pick a widely used UTF-8 locale (e.g. en_US.UTF-8), and also prefix the test suite with LC_ALL=en_US.UTF-8. It would be nicer to use C.UTF-8, but this is not supported in upstream glibc, and various distros that support it are not 100% compatible with each other.

For the moment, I think I will "export LC_ALL=C.UTF-8" for Debian package builds, as it seems to fix the issue for 1.1.0 for the moment.

@vagrantc
Copy link
Contributor Author

That workaround solved some of the issues, but it appears that LANGUAGE also affects some tests... these locales are feisty!

https://tests.reproducible-builds.org/debian/logs/unstable/amd64/mescc-tools_1.1.0-2.build2.log.gz

LANG=C
LANGUAGE=et_EE:et
LC_ALL=C
...
test/results/test14-output: EBAÕNNESTUS
test/results/test15-output: OK
sha256sum: HOIATUS: 1 arvutatud kontrollsumma EI klappinud
make[2]: *** [makefile:32: test] Error 1
make[2]: Leaving directory '/build/2/mescc-tools-1.1.0/2nd/Kaem'

https://tests.reproducible-builds.org/debian/logs/unstable/arm64/mescc-tools_1.1.0-2.build2.log.gz

LANG=C
LANGUAGE=nl_BE:nl
LC_ALL=C
...

  • out='test/test8/proof: goed'
  • '[' 'test/test8/proof: goed' = 'test/test8/proof: OK' ']'
  • exit 2

I'm not sure if there is a specific LANGUAGE value that would be widely available (such as LANG=C and LC_ALL=C) ... maybe unsetting LANGUAGE entirely would work.

@oriansj
Copy link
Owner

oriansj commented Feb 4, 2021

This has been addressed in commit: a643118

@oriansj oriansj closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants