diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-10-31 19:28:42 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-10-31 19:28:42 (GMT) |
| commit | c25f14940d3c7823cae0a783f34c6f147518a1b3 (patch) | |
| tree | d598543193e4ffbb2336840441fd696a854ab6cc /tests/visual_bb.test | |
| parent | 3d21e16ae679d4c1ae0b73441536c7429a72657d (diff) | |
| parent | 2f48a0563a693aeccaf7550989d0539a3c940d95 (diff) | |
| download | tk-core-tk-print-fixes.zip tk-core-tk-print-fixes.tar.gz tk-core-tk-print-fixes.tar.bz2 | |
Merge trunkcore-tk-print-fixes
Diffstat (limited to 'tests/visual_bb.test')
| -rw-r--r-- | tests/visual_bb.test | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/tests/visual_bb.test b/tests/visual_bb.test index e118838..0d318b9 100644 --- a/tests/visual_bb.test +++ b/tests/visual_bb.test @@ -1,23 +1,44 @@ -#!/usr/local/bin/wish -f -# # This script displays provides visual tests for many of Tk's features. # Each test displays a window with various information in it, along # with instructions about how the window should appear. You can look # at the window to make sure it appears as expected. Individual tests # are kept in separate ".tcl" files in this directory. -package require tcltest 2.2 -namespace import ::tcltest::* -tcltest::configure {*}$argv -tcltest::loadTestedCommands +# +# TESTFILE INITIALIZATION +# +package require tcltest 2.2; # needed in mode -singleproc 0 -set auto_path ". $auto_path" -wm title . "Visual Tests for Tk" +# Load the main script main.tcl, which takes care of: +# - setup for the application and the root window +# - importing commands from the tcltest namespace +# - loading of the testutils mechanism along with its utility procs +# - loading of Tk specific test constraints (additionally to constraints +# provided by the package tcltest) +source [file join [tcltest::configure -testdir] main.tcl] + +# Ensure a pristine initial window state +resetWindows set testNum 1 -# Each menu entry invokes a visual test file +# +# LOCAL UTILITY PROCS +# + +proc end {} { + cleanupTests + set ::EndOfVisualTests 1 +} + +# lpr -- +# +# Print the contents of a canvas +# +proc lpr {c args} { + exec lpr <<[eval [list $c postscript] $args] +} proc runTest {file} { global testNum @@ -29,18 +50,18 @@ proc runTest {file} { incr testNum } -# The following procedure is invoked to print the contents of a canvas: +# +# COMMON TEST SETUP +# -proc lpr {c args} { - exec lpr <<[eval [list $c postscript] $args] -} +set auto_path ". $auto_path" +wm title . "Visual Tests for Tk" -proc end {} { - cleanupTests - set ::EndOfVisualTests 1 -} +# +# TESTS +# -# ---------------------------------------------------------------------- +# Each menu entry invokes a visual test file test 1.1 {running visual tests} -constraints userInteraction -body { #------------------------------------------------------- @@ -109,6 +130,10 @@ test 1.1 {running visual tests} -constraints userInteraction -body { concat "" } -result {} +# +# TESTFILE CLEANUP +# + if {![testConstraint userInteraction]} { cleanupTests } else { |
