Description: Many of the unit tests (specially on Windows) are dependent on DPI and scaling. If you set display scaling to something other than 1x (100%), like 2x (200%) or 3x (300%) scaling, and run 'make check', you will see those tests fails. If you switch back to 1x (100%) scaling, those test should pass. The task here is to fix such tests. As an example, one can take a look at some of the previous patches that provided such fixes: (thanks Ilmari for the hint) $ git log --grep=dpi -i '*/qa/*.cxx' The best would be to create a test independent of DPI: 3ffd375ffee648cdb67b1f3062f84a4b2f3af9df In some cases, changing some error margin (more tolerance) helps: b693d19884a09b5f841b30f2e8b586778584ed16 Sometimes, tests can be skipped with non-default DPI: c469e786be9345fc76e5cc62fd23dd317db53c02 Please note that there are many DPI-dependent aspects in LibreOffice. Therefore, sometimes a bug fix might be needed to make the test work. The ultimate goal of this issue is to be able to run 'make check' successfully on different display DPI and scaling.
To find a problematic test, first you should rung 'make check' with 1x (100%) scaling. You have to make sure that no test fails. Then, you should set the screen scaling to something other than 1x (100%), and then run 'make check' again. Once a test case fails, you can remove it from the source code, or the make file, and then try again running that test again. If the test does not fail again, this means that the test was related to DPI. These are some of the tests that fail because of DPI, alongside the source code/make file: (Note: it is not complete) make JunitTest_sot_complex complex.olesimplestorage.OLESimpleStorageUnitTest sot/JunitTest_sot_complex.mk make CppunitTest_sd_a11y TestImpressDefaultStructure TestImpressDefaultLayout sd/qa/unit/a11y/layout.cxx make CppunitTest_sc_shapetest testTdf144242_Line_noSwapWH sc/qa/unit/scshapetest.cxx make CppunitTest_sc_a11y Test64BitChildIndices TestCalcMenu sc/qa/extras/accessibility/basics.cxx make CppunitTest_sw_rtfexport2 testFdo52989 sw/qa/extras/rtfexport/rtfexport2.cxx make CppunitTest_sd_png_export_tests testTdf99729 testTdf126319 testTdf105998 sd/qa/unit/PNGExportTests.cxx make CppunitTest_sw_rtfexport8 testTdf155663 make CppunitTest_sw_ooxmlexport6 testDmlRectangleRelsize sw/qa/extras/ooxmlexport/ooxmlexport6.cxx make CppunitTest_sw_uiwriter6 testTdf160836 sw/qa/extras/uiwriter/uiwriter6.cxx make CppunitTest_sw_layoutwriter2 testTdf129054 sw/qa/extras/layout/layout2.cxx
These are the remaining failing tests with 3x scaling on Windows. First is the name of the test, then the failing test cases, and at last, the file that can be used to disable the test: make CppunitTest_sw_layoutwriter3 testTdf147666 testTdf159422 sw/qa/extras/layout/layout3.cxx make CppunitTest_sc_tabviewobj sc_apitest::ScTabViewObj::testSplit test/source/sheet/xviewsplitable.cxx make JunitTest_svx_unoapi svx.AccessibleShape svx/qa/unoapi/svx.sce make JunitTest_chart2_unoapi sch.ChartArea chart2/qa/unoapi/sch.sce make JunitTest_linguistic_unoapi lng.LinguProps linguistic/qa/unoapi/lng.sce make JunitTest_comphelper_complex comphelper/qa/complex/comphelper_all.sce make JunitTest_configmgr_unoapi org.openoffice.test.UnoApiTest configmgr/JunitTest_configmgr_unoapi.mk make JunitTest_dbaccess_unoapi complex.dbaccess.Beamer dbaccess/JunitTest_dbaccess_unoapi.mk make JunitTest_chart2_unoapi org.openoffice.test.UnoApiTest solenv/gbuild/JunitTest.mk Some complex test like JunitTest_unoxml_complex, JunitTest_sfx2_complex, JunitTest_dbaccess_complex, JunitTest_comphelper_complex and also CppunitTest_sw_a11y also fail, which may not be related to DPI. Please note that it is not guaranteed that all of the above tests are DPI related. Anyway, by disabling the above tests, you should be able to run 'make check' on a Windows machine with scaling other than 1x.
I recently tried building LibreOffice for the first time and noticed that some tests in chart2import2.cxx, specifically testTdf133376, testTdf136105, and testTdf136752 were consistently failing: https://paste.debian.net/1323698/ Hossein advised me in IRC that this is likely because of this bug (I’m running macOS on a 2019 16" Retina MacBook Pro). The first two of these tests include this check, which is not working properly on my machine: // FIXME: the DPI check should be removed when either (1) the test is fixed to work with // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin. if (!IsDefaultDPI()) return; testTdf136752 is missing this check. I spent several hours trying to figure out why this check is not working properly. Unfortunately this was somewhat difficult given by unfamiliarity with this codebase and I don’t currently have a fix. Here are my notes: https://docs.google.com/document/d/1At9aFXqVLQc_k82P5Qu3E0MYd5KZpGZkHvKQAxO5Mj0/edi I concluded: It seems that my Mac (a 2019 16” Retina MacBook Pro) using HiDPI mode is causing some sort of problem with the test case. However, the test harness is calling Application::EnableBitmapRendering() and seems to be running in some sort of headless mode where IsDefaultDPI() returns “true.” Potential fixes: 1. Fixing the tests to run properly in HiDPI mode (preferable) 2. Fixing the headless mode to report the DPI properly 3. Changing the test harness to create a window and avoid using the logic for the headless case
Sorry, the link should be: https://docs.google.com/document/d/1At9aFXqVLQc_k82P5Qu3E0MYd5KZpGZkHvKQAxO5Mj0/edit
Created attachment 203599 [details] LibreOffice chart2import2.cxx debugging notes (In reply to Ryan Landay from comment #4) > Sorry, the link should be: > https://docs.google.com/document/d/ > 1At9aFXqVLQc_k82P5Qu3E0MYd5KZpGZkHvKQAxO5Mj0/edit Attaching the ODT file to preserve it.
@Ryan: Is it possible for you to test below patch? tdf#160992: Fix DPI-dependent chart tests https://gerrit.libreoffice.org/c/core/+/193119
(In reply to Hossein from comment #6) > @Ryan: > Is it possible for you to test below patch? > > tdf#160992: Fix DPI-dependent chart tests > https://gerrit.libreoffice.org/c/core/+/193119 I can try but I think I deleted the checkout to save disk space so it might take me a little while.
I am unable to build my checkout because the version of make installed by LODE is immediately segfaulting when it reads the makefile: macOS Tahoe 26.0.1 make --version GNU Make 4.4 Built for x86_64-apple-darwin25.0.0 Copyright (C) 1988-2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (lldb) frame variable (char **) stringp = <variable not available> (size_t) size = 16 (int) stopmap = 1 (const char *) prefix = <variable not available> (int) flags = 25 (glob_t) gl = { gl_pathc = 1 gl_pathv = 0x0000000000000001 gl_offs = 0 gl_flags = 512 gl_closedir = 0x00006000030440a0 gl_readdir = 0x0000000000000000 gl_opendir = 0x00000001000037c0 (make`open_dirstream at dir.c:1216) gl_lstat = 0x00007ff81b46de1c (libsystem_kernel.dylib`lstat$INODE64) gl_stat = 0x00007ff81b4680c0 (libsystem_kernel.dylib`stat$INODE64) } (nameseq *) new = NULL (nameseq **) newp = 0x00007ff7bfefd3f0 (int) found_wait = 0 (int) findmap = <variable not available> (char *) p = <variable not available> (char *) tp = <variable not available> (int) cachep = <no location, value may have been optimized out> (char *) memname = <variable not available> (char *) arname = <variable not available> (int) globme = <variable not available> (char *) tildep = 0x0000000000000000 (const char **) nlist = <variable not available> (char *) s = <variable not available> (size_t) nlen = <variable not available> (const char *) name = <variable not available> (int) i = 0 (int) tot = <variable not available> (nameseq *) _ns = 0x00006000030440b0 (const char *) __n = <variable not available> (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1) * frame #0: 0x000000010001b84e make`parse_file_seq(stringp=<unavailable>, size=16, stopmap=1, prefix=<unavailable>, flags=25) at read.c:3532:11 [opt] frame #1: 0x0000000100009876 make`string_glob(line="/Users/rlanday/Documents/source/lode/dev/core/.git") at function.c:365:11 [opt] [inlined] frame #2: 0x000000010000985f make`func_wildcard(o="", argv=<unavailable>, funcname=<unavailable>) at function.c:1534:14 [opt] frame #3: 0x000000010000817c make`handle_function(op=0x00007ff7bfefd5e8, stringp=0x00007ff7bfefd5e0) at function.c:2668:9 [opt] frame #4: 0x000000010000405f make`variable_expand_string(line=<unavailable>, string=<unavailable>, length=<unavailable>) at expand.c:282:17 [opt] frame #5: 0x0000000100004489 make`variable_expand(line="$(wildcard $(SRCDIR)/.git)") at expand.c:441:10 [opt] [inlined] frame #6: 0x0000000100004478 make`variable_expand_for_file(line="$(wildcard $(SRCDIR)/.git)", file=0x0000000000000000) at expand.c:488:12 [opt] [inlined] frame #7: 0x0000000100004478 make`allocated_variable_expand_for_file(line="$(wildcard $(SRCDIR)/.git)", file=0x0000000000000000) at expand.c:590:11 [opt] [inlined] frame #8: 0x0000000100004460 make`expand_argument(str="$(wildcard $(SRCDIR)/.git)", end=<unavailable>) at expand.c:460:12 [opt] frame #9: 0x000000010000a736 make`func_if(o="", argv=0x00007ff7bfefd6e0, funcname=<unavailable>) at function.c:1400:25 [opt] frame #10: 0x000000010000817c make`handle_function(op=0x00007ff7bfefd7b8, stringp=0x00007ff7bfefd7b0) at function.c:2668:9 [opt] frame #11: 0x000000010000405f make`variable_expand_string(line=<unavailable>, string=<unavailable>, length=<unavailable>) at expand.c:282:17 [opt] frame #12: 0x0000000100003e09 make`variable_expand(line=<unavailable>) at expand.c:441:10 [opt] [inlined] frame #13: 0x0000000100003df8 make`variable_expand_for_file(line=<unavailable>, file=<unavailable>) at expand.c:488:12 [opt] [inlined] frame #14: 0x0000000100003d99 make`allocated_variable_expand_for_file(line=<unavailable>, file=0x0000000000000000) at expand.c:590:11 [opt] frame #15: 0x000000010002307e make`do_variable_definition(flocp=0x00007ff7bfefdb90, varname="GIT_BUILD", value=<unavailable>, origin=o_file, flavor=f_simple, target_var=0) at variable.c:1279:25 [opt] frame #16: 0x00000001000246c7 make`try_variable_definition(flocp=0x00007ff7bfefdb90, line="GIT_BUILD := $(if $(wildcard $(SRCDIR)/.git),T)", origin=o_file, target_var=0) at variable.c:1766:8 [opt] frame #17: 0x00000001000196dd make`eval(ebuf=0x00007ff7bfefdb68, set_default=<unavailable>) at read.c:758:17 [opt] frame #18: 0x0000000100019138 make`eval_makefile(filename="Makefile", flags=0) at read.c:442:3 [opt] frame #19: 0x0000000100018ceb make`read_all_makefiles(makefiles=<unavailable>) at read.c:261:11 [opt] frame #20: 0x0000000100014003 make`main(argc=1, argv=0x00007ff7bfefef60, envp=0x00007ff7ffffffff) at main.c:2069:18 [opt] frame #21: 0x00007ff81b0dd781 dyld`start + 3457 (lldb) frame select 0 frame #0: 0x000000010001b84e make`parse_file_seq(stringp=<unavailable>, size=16, stopmap=1, prefix=<unavailable>, flags=25) at read.c:3532:11 [opt] 3529 } 3530 else 3531 #endif /* !NO_ARCHIVES */ -> 3532 NEWELT (concat (2, prefix, nlist[i])); 3533 3534 if (globme) 3535 globfree (&gl); (lldb) source list 3536 3537 #ifndef NO_ARCHIVES 3538 free (arname); 3539 #endif 3540 3541 free (tildep); 3542 }
I was able to fix the build and reproduce the test failures by rebuilding LODE’s make without Guile. I will comment on the gerrit patch with my findings.