diff options
author | dgp@users.sourceforge.net <dgp> | 2002-07-13 20:28:35 (GMT) |
---|---|---|
committer | dgp@users.sourceforge.net <dgp> | 2002-07-13 20:28:35 (GMT) |
commit | e03a6d8c8daca0485139c9a7edc9008565c2e000 (patch) | |
tree | 83ce372d1ae9d46d27acc5638739bddcbc8e6ba6 /tests/main.test | |
parent | 60df07e990cbc0441a2fcf7783ccbfae69a82aa8 (diff) | |
download | tk-e03a6d8c8daca0485139c9a7edc9008565c2e000.zip tk-e03a6d8c8daca0485139c9a7edc9008565c2e000.tar.gz tk-e03a6d8c8daca0485139c9a7edc9008565c2e000.tar.bz2 |
* Converted more files to tcltest and factored out common code.
Diffstat (limited to 'tests/main.test')
-rw-r--r-- | tests/main.test | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/main.test b/tests/main.test index 0422223..0f25637 100644 --- a/tests/main.test +++ b/tests/main.test @@ -8,30 +8,33 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: main.test,v 1.5 1999/04/16 01:51:39 stanton Exp $ +# RCS: @(#) $Id: main.test,v 1.6 2002/07/13 20:28:35 dgp Exp $ -if {[lsearch [namespace children] ::tcltest] == -1} { - source [file join [pwd] [file dirname [info script]] defs.tcl] -} +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 main-1.1 {StdinProc} {unixOnly} { - catch {removeFile script} - set fd [open script w] - puts $fd { +namespace import -force tcltest::interpreter +namespace import -force tcltest::makeFile +namespace import -force tcltest::removeFile + +test main-1.1 {StdinProc} {unix} { + set script [makeFile { close stdin; exit - } - close $fd - if {[catch {exec $::tcltest::tktest <script} msg]} { + } script] + if {[catch {exec [interpreter] <$script} msg]} { set error 1 } else { set error 0 } - file delete -force script + removeFile script list $error $msg } {0 {}} # cleanup -catch {removeFile script} ::tcltest::cleanupTests return |