summaryrefslogtreecommitdiffstats
path: root/tests/unixFont.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unixFont.test')
-rw-r--r--tests/unixFont.test56
1 files changed, 22 insertions, 34 deletions
diff --git a/tests/unixFont.test b/tests/unixFont.test
index f703ae0..27826d4 100644
--- a/tests/unixFont.test
+++ b/tests/unixFont.test
@@ -13,29 +13,30 @@
# All rights reserved.
package require tcltest 2.1
-namespace import -force tcltest::configure
-namespace import -force tcltest::testsDirectory
-configure -testdir [file join [pwd] [file dirname [info script]]]
-configure -loadfile [file join [testsDirectory] constraints.tcl]
+eval tcltest::configure $argv
tcltest::loadTestedCommands
-testConstraint hasArial 1
-testConstraint hasCourierNew 1
-testConstraint hasTimesNew 1
-set xlsf [auto_execok xlsfonts]
-if {[llength $xlsf]} {
- foreach {constraint font} {
- hasArial arial
- hasCourierNew "courier new"
- hasTimesNew "times new roman"
- } {
- if {![catch {eval exec $xlsf [list *-$font-*]} res]
- && ![string match *unmatched* $res]} {
- # Newer Unix systems have more default fonts installed,
- # so we can't rely on fallbacks for fonts to need to
- # fall back on anything.
- testConstraint $constraint 0
+if {[tk windowingsystem] eq "x11"} {
+ set xlsf [auto_execok xlsfonts]
+}
+foreach {constraint font} {
+ hasArial arial
+ hasCourierNew "courier new"
+ hasTimesNew "times new roman"
+} {
+ if {[tk windowingsystem] eq "x11"} {
+ testConstraint $constraint 1
+ if {[llength $xlsf]} {
+ if {![catch {eval exec $xlsf [list *-$font-*]} res]
+ && ![string match *unmatched* $res]} {
+ # Newer Unix systems have more default fonts installed,
+ # so we can't rely on fallbacks for fonts to need to
+ # fall back on anything.
+ testConstraint $constraint 0
+ }
}
+ } else {
+ testConstraint $constraint 0
}
}
@@ -313,18 +314,5 @@ test unixfont-9.2 {GetControlCharSubst procedure: 4 chars subst} unix {
} {0 1 1 1 1 2}
# cleanup
-::tcltest::cleanupTests
+cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-
-