diff options
Diffstat (limited to 'tests/menu.test')
-rw-r--r-- | tests/menu.test | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/tests/menu.test b/tests/menu.test index 701a3af..5c157f3 100644 --- a/tests/menu.test +++ b/tests/menu.test @@ -5,36 +5,14 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: menu.test,v 1.11 2002/01/31 21:05:27 uid38226 Exp $ +# RCS: @(#) $Id: menu.test,v 1.12 2002/07/13 20:28:35 dgp Exp $ -if {[lsearch [namespace children] ::tcltest] == -1} { - source [file join [pwd] [file dirname [info script]] defs.tcl] -} - -if {[lsearch [image types] test] < 0} { - puts "This application hasn't been compiled with the \"test\" image" - puts "type, so I can't run this test. Are you sure you're using" - puts "tktest instead of wish?" - ::tcltest::cleanupTests - return -} - -# Some tests require user interaction on non-unix platform -set ::tcltest::testConfig(nonUnixUserInteraction) \ - [expr {$::tcltest::testConfig(userInteraction) || \ - $::tcltest::testConfig(unixOnly)}] - -set ::tcltest::testConfig(altDisplay) [info exists env(TK_ALT_DISPLAY)] - -proc deleteWindows {} { - foreach i [winfo children .] { - catch [destroy $i] - } -} - -deleteWindows -wm geometry . {} -raise . +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] +tcltest::loadTestedCommands test menu-1.1 {Tk_MenuCmd procedure} { list [catch menu msg] $msg @@ -1377,7 +1355,7 @@ test menu-8.2 {DestroyMenuEntry} { .m1 add command -image image1a list [catch {.m1 delete 1} msg] $msg [destroy .m1] [image delete image1a] } {0 {} {} {}} -test menu-8.3 {DestroyMenuEntry} { +test menu-8.3 {DestroyMenuEntry} testImageType { catch {eval image delete [image names]} catch {destroy .m1} image create test image1 @@ -1613,7 +1591,7 @@ test menu-11.17 {ConfigureMenuEntry} { .m1 add checkbutton list [catch {.m1 entryconfigure 1 -onvalue "test"} msg] $msg [.m1 entrycget 1 -onvalue] [destroy .m1] } {0 {} test {}} -test menu-11.18 {ConfigureMenuEntry} { +test menu-11.18 {ConfigureMenuEntry} testImageType { catch {destroy .m1} catch {image delete image1} menu .m1 @@ -1621,7 +1599,7 @@ test menu-11.18 {ConfigureMenuEntry} { image create test image1 list [catch {.m1 entryconfigure 1 -image image1} msg] $msg [destroy .m1] [image delete image1] } {0 {} {} {}} -test menu-11.19 {ConfigureMenuEntry} { +test menu-11.19 {ConfigureMenuEntry} testImageType { catch {destroy .m1} catch {image delete image1} catch {image delete image2} @@ -1631,7 +1609,7 @@ test menu-11.19 {ConfigureMenuEntry} { .m1 add command -image image1 list [catch {.m1 entryconfigure 1 -image image2} msg] $msg [destroy .m1] [image delete image1] [image delete image2] } {0 {} {} {} {}} -test menu-11.20 {ConfigureMenuEntry} { +test menu-11.20 {ConfigureMenuEntry} testImageType { catch {destroy .m1} catch {image delete image1} catch {image delete image2} @@ -1641,7 +1619,7 @@ test menu-11.20 {ConfigureMenuEntry} { .m1 add checkbutton -image image1 list [catch {.m1 entryconfigure 1 -selectimage image2} msg] $msg [destroy .m1] [image delete image1] [image delete image2] } {0 {} {} {} {}} -test menu-11.21 {ConfigureMenuEntry} { +test menu-11.21 {ConfigureMenuEntry} testImageType { catch {destroy .m1} catch {image delete image1} catch {image delete image2} |