From f50987254b0753bf6761d7639faefa2b318b18c0 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 30 Oct 2022 22:44:40 +0000 Subject: fontchooser-4.4: Replace constraint failsOnUbuntuNoXft by a more specific constraint hasTimes14Bold checking exactly what is needed. Note: Without the constraint this test returns '9' instead of '14 bold' when run at Github Actions CI with XQuartz because the font actually selected in the fontchooser when requesting -font {times 14 bold} is 'times 9', for an unknown reason. --- tests/fontchooser.test | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/fontchooser.test b/tests/fontchooser.test index 471ed64..0c8a694 100644 --- a/tests/fontchooser.test +++ b/tests/fontchooser.test @@ -6,8 +6,7 @@ package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands -testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}] -testConstraint failsOnUbuntuNoXft [expr {[testConstraint failsOnUbuntu] || (![catch {tk::pkgconfig get fontsystem} fs] && ($fs eq "xft"))}] +testConstraint hasTimes14Bold [expr {([font actual {times 14 bold} -size] == 14) && ([font actual {times 14 bold} -weight] eq "bold")}] # the following helper functions are related to the functions used # in winDialog.test where they are used to send messages to the win32 @@ -182,7 +181,7 @@ test fontchooser-4.3 {fontchooser -font} -constraints scriptImpl -body { expr {$::testfont ne {}} } -result {1} -test fontchooser-4.4 {fontchooser -font} -constraints {scriptImpl failsOnUbuntuNoXft} -body { +test fontchooser-4.4 {fontchooser -font} -constraints {scriptImpl hasTimes14Bold} -body { start { tk::fontchooser::Configure -command ApplyFont -font {times 14 bold} tk::fontchooser::Show -- cgit v0.12