summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2023-10-25 19:18:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2023-10-25 19:18:14 (GMT)
commitae695082eef0d6fb62c464f80649af308c951062 (patch)
treee9c706c3b6cdb1a50341a9fe243f586ef23632c1
parent0da684fdc5bb947113ddb2a6760ade2b688fe36b (diff)
downloadtcl-ae695082eef0d6fb62c464f80649af308c951062.zip
tcl-ae695082eef0d6fb62c464f80649af308c951062.tar.gz
tcl-ae695082eef0d6fb62c464f80649af308c951062.tar.bz2
Obsolete tests unixInit-2.* testing older versions of the internal routine
TclpInitLibraryPath() have been skipped since at least Tcl 8.5.2. Remove them.
-rw-r--r--tests/unixInit.test243
1 files changed, 0 insertions, 243 deletions
diff --git a/tests/unixInit.test b/tests/unixInit.test
index 51ecafe..5f02031 100644
--- a/tests/unixInit.test
+++ b/tests/unixInit.test
@@ -81,249 +81,6 @@ test unixInit-1.2 {initialisation: standard channel type deduction} {unix stdio}
}
} {OK}
-# The unixInit-2.* tests were written to test the internal routine,
-# TclpInitLibraryPath. That routine no longer does the things it used to do
-# so those tests are obsolete. Skip them.
-
-skip [concat [skip] unixInit-2.*]
-
-test unixInit-2.0 {TclpInitLibraryPath: setting tclDefaultEncodingDir} {
- set origDir [testgetdefenc]
- testsetdefenc slappy
- set path [testgetdefenc]
- testsetdefenc $origDir
- set path
-} {slappy}
-test unixInit-2.1 {TclpInitLibraryPath: value of installLib, developLib} -setup {
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- unset env(TCL_LIBRARY)
- }
-} -body {
- set path [getlibpath]
- set installLib lib/tcl[info tclversion]
- set developLib tcl[info patchlevel]/library
- set prefix [file dirname [file dirname [interpreter]]]
- list [string equal [lindex $path 0] $prefix/$installLib] \
- [string equal [lindex $path 4] [file dirname $prefix]/$developLib]
-} -cleanup {
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result {1 1}
-test unixInit-2.2 {TclpInitLibraryPath: TCL_LIBRARY} -setup {
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
-} -body {
- # ((str != NULL) && (str[0] != '\0'))
- set env(TCL_LIBRARY) sparkly
- lindex [getlibpath] 0
-} -cleanup {
- unset -nocomplain env(TCL_LIBRARY)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result "sparkly"
-test unixInit-2.3 {TclpInitLibraryPath: TCL_LIBRARY wrong version} -setup {
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
-} -body {
- # ((pathc > 0) && (strcasecmp(installLib + 4, pathv[pathc - 1]) != 0))
- set env(TCL_LIBRARY) /a/b/tcl1.7
- lrange [getlibpath] 0 1
-} -cleanup {
- unset -nocomplain env(TCL_LIBRARY)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result [list /a/b/tcl1.7 /a/b/tcl[info tclversion]]
-test unixInit-2.4 {TclpInitLibraryPath: TCL_LIBRARY: INTL} -setup {
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
-} -body {
- # Child process translates env variable from native encoding.
- set env(TCL_LIBRARY) "\xa7"
- lindex [getlibpath] 0
-} -cleanup {
- unset -nocomplain env(TCL_LIBRARY) env(LANG)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result "\xa7"
-test unixInit-2.5 {TclpInitLibraryPath: compiled-in library path} {
- # cannot test
-} {}
-test unixInit-2.6 {TclpInitLibraryPath: executable relative} -setup {
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
- set env(TCL_LIBRARY) [info library]
- makeDirectory tmp
- makeDirectory [file join tmp sparkly]
- makeDirectory [file join tmp sparkly bin]
- file copy [interpreter] [file join [temporaryDirectory] tmp sparkly \
- bin tcltest]
- makeDirectory [file join tmp sparkly lib]
- makeDirectory [file join tmp sparkly lib tcl[info tclversion]]
- makeFile {} [file join tmp sparkly lib tcl[info tclversion] init.tcl]
-} -body {
- lrange [getlibpath [file join [temporaryDirectory] tmp sparkly \
- bin tcltest]] 1 2
-} -cleanup {
- removeFile [file join tmp sparkly lib tcl[info tclversion] init.tcl]
- removeDirectory [file join tmp sparkly lib tcl[info tclversion]]
- removeDirectory [file join tmp sparkly lib]
- removeDirectory [file join tmp sparkly bin]
- removeDirectory [file join tmp sparkly]
- removeDirectory tmp
- unset env(TCL_LIBRARY)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result [list [temporaryDirectory]/tmp/sparkly/lib/tcl[info tclversion] [temporaryDirectory]/tmp/lib/tcl[info tclversion]]
-test unixInit-2.7 {TclpInitLibraryPath: compiled-in library path} {
- # would need test command to get defaultLibDir and compare it to
- # [lindex $auto_path end]
-} {}
-#
-# The following two tests write to the directory /tmp/sparkly instead of to
-# [temporaryDirectory]. This is because the failures tested by these tests
-# need paths near the "root" of the file system to present themselves.
-#
-test unixInit-2.8 {TclpInitLibraryPath: all absolute pathtype} -setup {
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
- set env(TCL_LIBRARY) [info library]
- # Checking for Bug 219416
- # When a program that embeds the Tcl library, like tcltest, is installed
- # near the "root" of the file system, there was a problem constructing
- # directories relative to the executable. When a relative ".." went past
- # the root, relative path names were created rather than absolute
- # pathnames. In some cases, accessing past the root caused memory access
- # violations too.
- #
- # The bug is now fixed, but here we check for it by making sure that the
- # directories constructed relative to the executable are all absolute
- # pathnames, even when the executable is installed near the root of the
- # filesystem.
- #
- # The only directory near the root we are likely to have write access to
- # is /tmp.
- file delete -force /tmp/sparkly
- file delete -force /tmp/lib/tcl[info tclversion]
- file mkdir /tmp/sparkly
- file copy [interpreter] /tmp/sparkly/tcltest
- # Keep any existing /tmp/lib directory
- set deletelib 1
- if {[file exists /tmp/lib]} {
- if {[file isdirectory /tmp/lib]} {
- set deletelib 0
- } else {
- file delete -force /tmp/lib
- }
- }
- # For a successful Tcl_Init, we need a [source]-able init.tcl in
- # ../lib/tcl$version relative to the executable.
- file mkdir /tmp/lib/tcl[info tclversion]
- close [open /tmp/lib/tcl[info tclversion]/init.tcl w]
-} -body {
- # Check that all directories in the library path are absolute pathnames
- set allAbsolute 1
- foreach dir [getlibpath /tmp/sparkly/tcltest] {
- set allAbsolute [expr {$allAbsolute \
- && [string equal absolute [file pathtype $dir]]}]
- }
- set allAbsolute
-} -cleanup {
- # Clean up temporary installation
- file delete -force /tmp/sparkly
- file delete -force /tmp/lib/tcl[info tclversion]
- if {$deletelib} {file delete -force /tmp/lib}
- unset env(TCL_LIBRARY)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result 1
-test unixInit-2.9 {TclpInitLibraryPath: paths relative to executable} -setup {
- # Checking for Bug 438014
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
- set env(TCL_LIBRARY) [info library]
- file delete -force /tmp/sparkly
- file delete -force /tmp/library
- file mkdir /tmp/sparkly
- file copy [interpreter] /tmp/sparkly/tcltest
- file mkdir /tmp/library/
- close [open /tmp/library/init.tcl w]
-} -body {
- lrange [getlibpath /tmp/sparkly/tcltest] 1 5
-} -cleanup {
- file delete -force /tmp/sparkly
- file delete -force /tmp/library
- unset env(TCL_LIBRARY)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result [list /tmp/lib/tcl[info tclversion] /lib/tcl[info tclversion] \
- /tmp/library /library /tcl[info patchlevel]/library]
-test unixInit-2.10 {TclpInitLibraryPath: executable relative} -setup {
- unset -nocomplain oldlibrary
- if {[info exists env(TCL_LIBRARY)]} {
- set oldlibrary $env(TCL_LIBRARY)
- }
- set env(TCL_LIBRARY) [info library]
- set tmpDir [makeDirectory tmp]
- set sparklyDir [makeDirectory sparkly $tmpDir]
- set execPath [file join [makeDirectory bin $sparklyDir] tcltest]
- file copy [interpreter] $execPath
- set libDir [makeDirectory lib $sparklyDir]
- set scriptDir [makeDirectory tcl[info tclversion] $libDir]
- makeFile {} init.tcl $scriptDir
- set saveDir [pwd]
- cd $libDir
-} -body {
- # Checking for Bug 832657
- set x [lrange [getlibpath [file join .. bin tcltest]] 3 4]
- foreach p $x {
- lappend y [file normalize $p]
- }
- set y
-} -cleanup {
- cd $saveDir
- removeFile init.tcl $scriptDir
- removeDirectory tcl[info tclversion] $libDir
- file delete $execPath
- removeDirectory bin $sparklyDir
- removeDirectory lib $sparklyDir
- removeDirectory sparkly $tmpDir
- removeDirectory tmp
- unset -nocomplain saveDir scriptDir libDir execPath sparklyDir tmpDir
- unset -nocomplain x p y env(TCL_LIBRARY)
- if {[info exists oldlibrary]} {
- set env(TCL_LIBRARY) $oldlibrary
- unset oldlibrary
- }
-} -result [list [file join [temporaryDirectory] tmp sparkly library] \
- [file join [temporaryDirectory] tmp library] ]
-
test unixInit-3.1 {TclpSetInitialEncodings} -constraints {
unix stdio
} -body {