diff options
author | stanton <stanton> | 1998-12-10 03:28:02 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-12-10 03:28:02 (GMT) |
commit | f83326906134a42cb02d4811970b37dec3eac20f (patch) | |
tree | 927fecf40faa8313978c9e55265f90352152d4dd /tests | |
parent | 60e1f6f58d57656d72da839188a72a91bbb91d9a (diff) | |
download | tcl-f83326906134a42cb02d4811970b37dec3eac20f.zip tcl-f83326906134a42cb02d4811970b37dec3eac20f.tar.gz tcl-f83326906134a42cb02d4811970b37dec3eac20f.tar.bz2 |
merged 8.0 changes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/defs | 44 | ||||
-rw-r--r-- | tests/fCmd.test | 8 |
2 files changed, 31 insertions, 21 deletions
@@ -5,16 +5,17 @@ # # Copyright (c) 1990-1994 The Regents of the University of California. # Copyright (c) 1994-1996 Sun Microsystems, Inc. +# Copyright (c) 1998 by Scriptics Corporation # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: defs,v 1.1.2.4 1998/12/03 23:58:52 stanton Exp $ +# RCS: @(#) $Id: defs,v 1.1.2.5 1998/12/10 03:28:02 stanton Exp $ -if ![info exists VERBOSE] { +if {![info exists VERBOSE]} { set VERBOSE 0 } -if ![info exists TESTS] { +if {![info exists TESTS]} { set TESTS {} } @@ -102,9 +103,9 @@ proc safeFetch {n1 n2 op} { # "doAllTests" in this directory is used to indicate that the non-portable # tests should be run. -set testConfig(nonPortable) [expr [file exists doAllTests] || [file exists DOALLT~1]] +set testConfig(nonPortable) [file exists doAllTests] set testConfig(notIfCompiled) [file exists doAllCompilerTests] -set testConfig(knownBug) [expr [file exists doBuggyTests] || [file exists DOBUGG~1]] +set testConfig(knownBug) [file exists doBuggyTests] if {$testConfig(nonPortable) == 0} { puts "(will skip non-portable tests)" @@ -118,9 +119,9 @@ set testConfig(unix) $testConfig(unixOnly) set testConfig(mac) $testConfig(macOnly) set testConfig(pc) $testConfig(pcOnly) -set testConfig(unixOrPc) [expr $testConfig(unix) || $testConfig(pc)] -set testConfig(macOrPc) [expr $testConfig(mac) || $testConfig(pc)] -set testConfig(macOrUnix) [expr $testConfig(mac) || $testConfig(unix)] +set testConfig(unixOrPc) [expr {$testConfig(unix) || $testConfig(pc)}] +set testConfig(macOrPc) [expr {$testConfig(mac) || $testConfig(pc)}] +set testConfig(macOrUnix) [expr {$testConfig(mac) || $testConfig(unix)}] set testConfig(nt) [expr {$tcl_platform(os) == "Windows NT"}] set testConfig(95) [expr {$tcl_platform(os) == "Windows 95"}] @@ -145,7 +146,7 @@ set testConfig(unixCrash) [expr !$testConfig(unix)] if {[catch {set f [open defs r]}]} { set testConfig(nonBlockFiles) 1 } else { - if {[expr [catch {fconfigure $f -blocking off}]] == 0} { + if {[catch {fconfigure $f -blocking off}] == 0} { set testConfig(nonBlockFiles) 1 } else { set testConfig(nonBlockFiles) 0 @@ -189,7 +190,7 @@ if {$tcl_platform(platform) == "unix"} { set testConfig(eformat) 1 if {[string compare "[format %g 5e-5]" "5e-05"] != 0} { set testConfig(eformat) 0 - puts "(will skip tests that depend on the \"e\" format of floating-point numbers)" + puts stdout "(will skip tests that depend on the \"e\" format of floating-point numbers)" } # Test to see if execed commands such as cat, echo, rm and so forth are @@ -301,15 +302,18 @@ proc print_verbose {name description constraints script code answer} { proc test {name description script answer args} { global VERBOSE TESTS testConfig - if {[string compare $TESTS ""] != 0} then { + + if {[string compare $TESTS ""] != 0} { set ok 0 foreach test $TESTS { - if [string match $test $name] then { + if {[string match $test $name]} { set ok 1 break } } - if !$ok then return + if {!$ok} { + return + } } set i [llength $args] if {$i == 0} { @@ -345,7 +349,7 @@ proc test {name description script answer args} { } } if {$doTest == 0} { - if $VERBOSE then { + if {$VERBOSE} { puts stdout "++++ $name SKIPPED: $constraints" } return @@ -365,8 +369,8 @@ proc test {name description script answer args} { if {$code != 0} { print_verbose $name $description $constraints $script \ $code $result - } elseif {[string compare $result $answer] == 0} then { - if $VERBOSE then { + } elseif {[string compare $result $answer] == 0} { + if {$VERBOSE} { if {$VERBOSE > 0} { print_verbose $name $description $constraints $script \ $code $result @@ -441,7 +445,7 @@ proc normalizeMsg {msg} { proc makeFile {contents name} { set fd [open $name w] fconfigure $fd -translation lf - if {[string index $contents [expr [string length $contents] - 1]] == "\n"} { + if {[string index $contents [expr {[string length $contents] - 1}]] == "\n"} { puts -nonewline $fd $contents } else { puts $fd $contents @@ -498,7 +502,7 @@ set tcltest [info nameofexecutable] if {$tcltest == "{}"} { set tcltest {} - puts "Unable to find tcltest executable, multiple process tests will fail." + puts stdout "Unable to find tcltest executable, multiple process tests will fail." } set testConfig(stdio) 0 @@ -521,14 +525,14 @@ if {$tcl_platform(os) != "Win32s"} { } if {($tcl_platform(platform) == "windows") && ($testConfig(stdio) == 0)} { - puts "(will skip tests that redirect stdio of exec'd 32-bit applications)" + puts stdout "(will skip tests that redirect stdio of exec'd 32-bit applications)" } catch {socket} msg set testConfig(socket) [expr {$msg != "sockets are not available on this system"}] if {$testConfig(socket) == 0} { - puts "(will skip tests that use sockets)" + puts stdout "(will skip tests that use sockets)" } # diff --git a/tests/fCmd.test b/tests/fCmd.test index 2544a3f..fcde275 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -9,11 +9,17 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fCmd.test,v 1.1.2.2 1998/09/24 23:59:24 stanton Exp $ +# RCS: @(#) $Id: fCmd.test,v 1.1.2.3 1998/12/10 03:28:02 stanton Exp $ # if {[string compare test [info procs test]] == 1} then {source defs} +if {[string compare testgetplatform [info commands testgetplatform]] != 0} { + puts "This application hasn't been compiled with the \"testgetplatform\"" + puts "command, therefore I am skipping all of these tests." + return +} + set platform [testgetplatform] if {$user == "root"} { |