Skip to content

test: test_text_freetype2_bundled_font fails on a machine that has JetBrainsMono Nerd Font installed #1076

Closed

Description

@rdoupe

Summary

test_text_freetype2_bundled_font (added in #1016) fails 2 of 3 cases on any machine where JetBrainsMono Nerd Font is installed system-wide. fontconfig resolves the default face to the system copy (for example /usr/share/fonts/TTF/JetBrainsMonoNerdFont-Regular.ttf on Arch), so get_font_path() returns a path outside BUNDLED_FONT_DIR:

[ RUN      ] regular_resolves_to_the_bundled_file
[  ERROR   ] --- 13 != 0
[   LINE   ] --- test/cmocka/test_text_freetype2_bundled_font.c:23: error: Failure!
[  FAILED  ] regular_resolves_to_the_bundled_file
[ RUN      ] bold_and_italic_resolve_to_their_bundled_files
[  ERROR   ] --- 13 != 0
[  FAILED  ] bold_and_italic_resolve_to_their_bundled_files

Tier 2's container doesn't have the font, so CI passes. Locally it shows up as the only failure in an otherwise clean ctest -j8, in both lanes (seen on master 673f76f and 29b6d27).

Not a product bug

Picking an installed copy of the same face is fine for users. The test's own comment says it checks resolution "even where the font isn't installed", which the host's fontconfig doesn't give it.

Suggested fix

Run the test with a fontconfig that has no system font directories, so only the bundled fonts that load_bundled_fonts() adds are visible. For example, ENVIRONMENT FONTCONFIG_FILE=<a minimal fonts.conf in the build dir> in tests.d/test_text_freetype2_bundled_font.cmake, with a config that lists no <dir> entries and a cache dir in the build tree. The assertions stay as they are.

Not claiming this one.

Activity

  1. zackees commented on Oct 16, 2026

    @zackees
    Member

    Claiming: fix for the test picking up a system-installed JetBrainsMono. Plan: 1) RED commit: make the test's environment reproduce the host-font case (a fontconfig that lists a system dir with a copy of the font), 2) GREEN: run the test under a minimal fontconfig with no system dirs via tests.d. One PR, today.

  2. added
    claimed
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions