From c369dceef1a8e57426a9bec1b2751bd3e9c3a244 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Wed, 16 Apr 2003 10:16:03 +0000 Subject: Some test files for testing the tests --- tests/all.tcl | 8 ++++++++ tests/rectangle.test | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/all.tcl create mode 100644 tests/rectangle.test (limited to 'tests') diff --git a/tests/all.tcl b/tests/all.tcl new file mode 100644 index 0000000..cb36d08 --- /dev/null +++ b/tests/all.tcl @@ -0,0 +1,8 @@ + +package require Tcl 8.4 +package require tcltest 2.2 + +tcltest::configure -testdir [file dir [file normalize [info script]]] +eval tcltest::configure $argv + +tcltest::runAllTests diff --git a/tests/rectangle.test b/tests/rectangle.test new file mode 100644 index 0000000..35aa1c5 --- /dev/null +++ b/tests/rectangle.test @@ -0,0 +1,48 @@ +# -*- tcl -*- +# This file is part of the Tkzinc test suite. +# It tests the code in Rectangle.c which implements +# the rectangle item. +# + +package require tcltest 2.2 +eval tcltest::configure $argv + +lappend auto_path [file join [file dirname [info script]] ..] +package require Tkzinc + +zinc .z -width 400 -height 300 -borderwidth 2 -relief sunken +pack .z +bind .z <1> { + puts "button down at (%x,%y)" +} +update + +namespace eval ::rectangle::test { + namespace import ::tcltest::* + +# testConstraint X [expr {...}] + + variable SETUP { + #common setup code + } + variable CLEANUP { + #common cleanup code + } + + test example-1 {} -setup $SETUP { + set i 1 + } -cleanup $CLEANUP + +# test example-2 {} -constraints emptyTest -setup $SETUP { +# # Second test; constrained +# } -cleanup $CLEANUP -result {...} + +# test example-3 {} { +# # Third test; no context required +# } {...} + + cleanupTests +} + +namespace delete ::rectangle::test + \ No newline at end of file -- cgit v1.1