diff options
-rw-r--r-- | tests/defs | 44 | ||||
-rw-r--r-- | tests/fCmd.test | 8 | ||||
-rw-r--r-- | unix/Makefile.in | 10 |
3 files changed, 36 insertions, 26 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"} { diff --git a/unix/Makefile.in b/unix/Makefile.in index 28870e3..71a4611 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.1.2.11 1998/12/10 01:40:56 stanton Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.1.2.12 1998/12/10 03:28:02 stanton Exp $ # Current Tcl version; used in various names. @@ -464,7 +464,7 @@ install-binaries: $(TCL_LIB_FILE) tclsh do \ if [ ! -d $$i ] ; then \ echo "Making directory $$i"; \ - mkdir $$i; \ + mkdir -p $$i; \ chmod 755 $$i; \ else true; \ fi; \ @@ -484,7 +484,7 @@ install-libraries: do \ if [ ! -d $$i ] ; then \ echo "Making directory $$i"; \ - mkdir $$i; \ + mkdir -p $$i; \ chmod 755 $$i; \ else true; \ fi; \ @@ -493,7 +493,7 @@ install-libraries: do \ if [ ! -d $(SCRIPT_INSTALL_DIR)/$$i ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ - mkdir $(SCRIPT_INSTALL_DIR)/$$i; \ + mkdir -p $(SCRIPT_INSTALL_DIR)/$$i; \ chmod 755 $(SCRIPT_INSTALL_DIR)/$$i; \ else true; \ fi; \ @@ -523,7 +523,7 @@ install-man: do \ if [ ! -d $$i ] ; then \ echo "Making directory $$i"; \ - mkdir $$i; \ + mkdir -p $$i; \ chmod 755 $$i; \ else true; \ fi; \ |