diff options
Diffstat (limited to 'tests/pkgMkIndex.test')
-rw-r--r-- | tests/pkgMkIndex.test | 77 |
1 files changed, 18 insertions, 59 deletions
diff --git a/tests/pkgMkIndex.test b/tests/pkgMkIndex.test index f30c8ea..a91b158 100644 --- a/tests/pkgMkIndex.test +++ b/tests/pkgMkIndex.test @@ -8,7 +8,7 @@ # Copyright (c) 1998 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: pkgMkIndex.test,v 1.1 1998/10/17 00:21:39 escoffon Exp $ +# RCS: @(#) $Id: pkgMkIndex.test,v 1.2 1998/10/30 23:02:03 welch Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -17,15 +17,8 @@ if {[string compare test [info procs test]] == 1} then {source defs} # Make sure that the path to pkg1 is absolute. set scriptDir [file dirname [info script]] -if {[string compare [file pathtype $scriptDir] relative] == 0} { - set oldDir [pwd] - catch { - cd [file join [pwd] $scriptDir] - set scriptDir [pwd] - } - cd $oldDir -} -lappend auto_path [file join $scriptDir pkg1] +set oldDir [pwd] +lappend auto_path [file join [pwd] $scriptDir pkg1] # pkgproc -- # @@ -279,7 +272,7 @@ pkgproc runIndex { args } { test pkgMkIndex-1.1 {nothing matches pattern - current dir is the same} { list [runIndex pkg nomatch.tcl] [pwd] } [list {1 {no files matched glob pattern "nomatch.tcl"}} [pwd]] - +cd $oldDir ;# 'cause 8.0.3 is left in the wrong place test pkgMkIndex-2.1 {simple package} { runIndex pkg simple.tcl } {0 {{simple:1.0 {tclPkgSetup {simple.tcl source {::simple::lower ::simple::upper}}}}}} @@ -311,10 +304,6 @@ test pkgMkIndex-5.1 {requires -direct package} { runIndex pkg std.tcl } {0 {{std:1.0 {tclPkgSetup {std.tcl source {::std::p1 ::std::p2}}}}}} -test pkgMkIndex-5.2 {requires -direct package - use -nopkgrequire} { - runIndex -nopkgrequire pkg std.tcl -} {0 {{std:1.0 {tclPkgSetup {std.tcl source {::std::p1 ::std::p2}}}}}} - test pkgMkIndex-6.1 {pkg1 requires pkg3} { runIndex pkg pkg1.tcl pkg3.tcl } {0 {{pkg1:1.0 {tclPkgSetup {pkg1.tcl source {::pkg1::p1-1 ::pkg1::p1-2}}}} {pkg3:1.0 {tclPkgSetup {pkg3.tcl source {::pkg3::p3-1 ::pkg3::p3-2}}}}}} @@ -323,14 +312,6 @@ test pkgMkIndex-6.2 {pkg1 requires pkg3 - use -direct} { runIndex -direct pkg pkg1.tcl pkg3.tcl } {0 {{pkg1:1.0 {source pkg/pkg1.tcl}} {pkg3:1.0 {source pkg/pkg3.tcl}}}} -test pkgMkIndex-6.3 {pkg1 requires pkg3 - use -nopkgrequire} { - runIndex -nopkgrequire pkg pkg1.tcl pkg3.tcl -} {0 {{pkg1:1.0 {tclPkgSetup {pkg1.tcl source {::pkg1::p1-1 ::pkg1::p1-2}}}} {pkg3:1.0 {tclPkgSetup {pkg3.tcl source {::pkg3::p3-1 ::pkg3::p3-2}}}}}} - -test pkgMkIndex-6.4 {pkg1 requires pkg3 - use -direct -nopkgrequire} { - runIndex -direct -nopkgrequire pkg pkg1.tcl pkg3.tcl -} {0 {{pkg1:1.0 {source pkg/pkg1.tcl}} {pkg3:1.0 {source pkg/pkg3.tcl}}}} - test pkgMkIndex-7.1 {pkg4 uses pkg3} { runIndex pkg pkg4.tcl pkg3.tcl } {0 {{pkg3:1.0 {tclPkgSetup {pkg3.tcl source {::pkg3::p3-1 ::pkg3::p3-2}}}} {pkg4:1.0 {tclPkgSetup {pkg4.tcl source {::pkg4::p4-1 ::pkg4::p4-2}}}}}} @@ -339,19 +320,6 @@ test pkgMkIndex-7.2 {pkg4 uses pkg3 - use -direct} { runIndex -direct pkg pkg4.tcl pkg3.tcl } {0 {{pkg3:1.0 {source pkg/pkg3.tcl}} {pkg4:1.0 {source pkg/pkg4.tcl}}}} -# Should pkg_mkIndex throw an error if not all packages are indexed? -# Currently it doesn't, and that's why there is a "success". -# The error marker was set at 1 so that the fail tests as a reminder to -# look at pkg_mkIndex behaviour on errors like these - -test pkgMkIndex-7.3 {pkg4 uses pkg3 - use -nopkgrequire} { - runIndex -nopkgrequire pkg pkg4.tcl pkg3.tcl -} {1 {{pkg3:1.0 {tclPkgSetup {pkg3.tcl source {::pkg3::p3-1 ::pkg3::p3-2}}}}}} - -test pkgMkIndex-7.4 {pkg4 uses pkg3 - use -direct -nopkgrequire} { - runIndex -direct -nopkgrequire pkg pkg4.tcl pkg3.tcl -} {1 {{pkg3:1.0 {source pkg/pkg3.tcl}}}} - test pkgMkIndex-8.1 {pkg5 uses pkg2} { runIndex pkg pkg5.tcl pkg2_a.tcl pkg2_b.tcl } {0 {{pkg2:1.0 {tclPkgSetup {pkg2_a.tcl source ::pkg2::p2-1} {pkg2_b.tcl source ::pkg2::p2-2}}} {pkg5:1.0 {tclPkgSetup {pkg5.tcl source {::pkg5::p5-1 ::pkg5::p5-2}}}}}} @@ -361,36 +329,26 @@ test pkgMkIndex-8.2 {pkg5 uses pkg2 - use -direct} { } {0 {{pkg2:1.0 {source pkg/pkg2_a.tcl source pkg/pkg2_b.tcl}} {pkg5:1.0 {source pkg/pkg5.tcl}}}} -# Should pkg_mkIndex throw an error if not all packages are indexed? -# Currently it doesn't, and that's why there is a "success". -# The error marker was set at 1 so that the fail tests as a reminder to -# look at pkg_mkIndex behaviour on errors like these - -test pkgMkIndex-8.3 {pkg5 uses pkg2 - use -nopkgrequire} { - runIndex -nopkgrequire pkg pkg5.tcl pkg2_a.tcl pkg2_b.tcl -} {1 {{pkg2:1.0 {tclPkgSetup {pkg2_a.tcl source ::pkg2::p2-1} {pkg2_b.tcl source ::pkg2::p2-2}}}}} - -test pkgMkIndex-8.4 {pkg5 uses pkg2 - use -direct -nopkgrequire} { - runIndex -direct -nopkgrequire pkg pkg5.tcl pkg2_a.tcl pkg2_b.tcl -} {1 {{pkg2:1.0 {source pkg/pkg2_a.tcl -source pkg/pkg2_b.tcl}}}} - -# Should pkg_mkIndex throw an error if not all packages are indexed? -# Currently it doesn't, and that's why there is a "success". -# The error marker was set at 1 so that the fail tests as a reminder to -# look at pkg_mkIndex behaviour on errors like these - test pkgMkIndex-9.1 {circular packages} { runIndex pkg circ1.tcl circ2.tcl circ3.tcl -} {1 {}} - -test pkgMkIndex-9.2 {circular packages - use -nopkgrequire} { - runIndex -nopkgrequire pkg circ1.tcl circ2.tcl circ3.tcl } {0 {{circ1:1.0 {tclPkgSetup {circ1.tcl source {::circ1::c1-1 ::circ1::c1-2 ::circ1::c1-3 ::circ1::c1-4}}}} {circ2:1.0 {tclPkgSetup {circ2.tcl source {::circ2::c2-1 ::circ2::c2-2}}}} {circ3:1.0 {tclPkgSetup {circ3.tcl source ::circ3::c3-1}}}}} +# Try to find one of the DLLs in the dltest directory +set x [file join [pwd] [file dirname [info script]]] +set x [file join $x ../unix/dltest/pkga[info sharedlibextension]] +if {[file exists $x]} { + file copy -force $x pkg + test pkgMkIndex-10.1 {package in DLL and script} { + runIndex pkg pkga.tcl pkga[info sharedlibextension] + } {0 {{Pkga:1.0 {tclPkgSetup {pkga.tcl source pkga_neq} {pkga.so load {pkga_eq pkga_quote}}}}}} +} else { + puts "Skipping pkgMkIndex-10.1 (index of DLL and script)" +} + # # cleanup # +if {![info exist TESTS]} { file delete [file join pkg pkgIndex.tcl] @@ -400,3 +358,4 @@ foreach p $::procList { unset ::procList unset ::pkgDriverCount +} |