I develop on F24 and my tests pass, but when I try them in Travis CI, they fail. AFAIK, they (Travis CI) use Ubuntu 12.04 VMs. The test compares the output of a run with previously gathered "gold" output and flags any differences as failures.
In this particular case, the difference arises because a
cp command is called on a non-existent file which produces an error message, but the error message is slightly different between the two systems. On Fedora 24, I get:
$ cp foo bar cp: cannot stat 'foo': No such file or directory
On an Ubuntu 12.04 VM (set up to simulate the Travis CI environment), I get:
$ cp foo bar cp: cannot stat `foo': No such file or directory
N.B. the backtick in the Ubuntu output, as opposed to the single quote in the F24 output.
export LC_ALL=C, but that does not do anything to either output. F24 has version 8.25 of coreutils (which contains the infamous quoted filename changes in ls output, but afaict this has nothing to do with my problem). Ubuntu 12.04 has version 8.13.
1) Is this a change in coreutils between 8.13 and 8.25? Or did Fedora and Ubuntu compile coreutils differently somehow?
2) Do more recent Ubuntu versions use a backtick in this (and presumably other) error messages?
3) Is there any way to set the quotes that are used in error messages? On either system?
4) I'm probably going to munge the output of the command and change any backticks to single quotes before comparing with the "gold" output. Any suggestions for a better method?
EDIT: I have been informed that I can run a more recent version of ubuntu in the Travis CI environment (add "dist: trusty" to
.travis.yml). That version (16.04) uses Unicode single quotes (codepoint #x2018) in the en_US.UTF-8 environment for both opening and closing quotes in the error message; it uses ASCII apostrophes in the C locale - that's good enough for my purposes.