Created attachment 120044 [details] patch for test/run-test.sh make check fail on msys/mingw, ============================================= fontconfig 2.11.94: test/test-suite.log ============================================= # TOTAL: 2 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 2 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 FAIL: run-test ============== *** Test failed: Basic check *** output is in 'out', expected output in 'out.expected' FAIL run-test.sh (exit status: 1) FAIL: test-bz89617 ================== Fontconfig error: Cannot load default config fileFontconfig error: Cannot load default config fileFAIL test-bz89617.exe (exit status: 1) Here's why. All the program in the msys distribution are built against msys-1.0.dll which, among other things, translate paths between unix and windows style. That allows the autotool's generated files like configure, to be used to build native windows applications with the mingw compiler. In fontconfig's test suite, the first program that fails is run-test.sh, a shell script that use the pwd command to retrieve a unix style current working directory, which is then used to generate a configuration file for fc-list and fc-scan. fc-list and fc-scan are native windows program and doesn't know how to handle unix paths. Fortunately, msys's pwd has a special '-W' option which print the path in windows style. And the "$OSTYPE" environment variable can be checked to detect when the script is run on msys. Now for test-bz89617 i would like to fix it too but, but i don't know what is it supposed to test exactly ? Wouldn't it be better to call FcConfigCreate() instead of FcConfigGetCurrent() ? int main (void) { FcConfig *config = FcConfigCreate (); if (!FcConfigAppFontAddFile (config, SRCDIR "/4x6.pcf") || FcConfigAppFontAddFile (config, "/dev/null")) return 1; return 0; } I tried it and it works but i don't know if it divert from the original goal of the test. I'm sending a patch for run-test.sh. If you're happy with it could you please commit it to the future releases? Thanks Christian Fafard
Thanks. applied into git. for test case, it is to check if FcConfigAppFontAddFile() works as expected. so as you said, it should simply works without loading configurations etc. it doesn't matter right.
(In reply to Akira TAGOH from comment #1) > Thanks. applied into git. > > for test case, it is to check if FcConfigAppFontAddFile() works as expected. > so as you said, it should simply works without loading configurations etc. > it doesn't matter right. In my case, it fails with a "Cannot load config error" until i changed FcConfigGetCurrent() with FcConfigCreate() as shown above. Thanks
(In reply to cfaf from comment #2) > In my case, it fails with a "Cannot load config error" until i changed > FcConfigGetCurrent() with FcConfigCreate() as shown above. Hmm, there may be another issue somewhere else. run with FC_DEBUG=1024 may helps to investigate.
> run with FC_DEBUG=1024 may helps to investigate. Here it is: $ test-bz89617 FC_DEBUG=1024 Fontconfig error: Cannot load default config file Fontconfig error: Cannot load default config file If there is anything else you want me to try just let me know. Christian
Okay, I've tracked down. this is because no fonts.conf installed at the system. I'll modify the code to use FcConfigCreate() as you suggested so that it doesn't require any config to test as I mentioned earlier and other test cases which requires the certain fonts.conf required specifies FONTCONFIG_FILE say to avoid this. Thanks.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.