1# Commands covered:  load unload
2#
3# This file contains a collection of tests for one or more of the Tcl
4# built-in commands.  Sourcing this file into Tcl runs the tests and
5# generates output for errors.  No output means no errors were found.
6#
7# Copyright © 1995 Sun Microsystems, Inc.
8# Copyright © 1998-1999 Scriptics Corporation.
9#
10# See the file "license.terms" for information on usage and redistribution
11# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
13if {"::tcltest" ni [namespace children]} {
14    package require tcltest 2.5
15    namespace import -force ::tcltest::*
16}
17set oldTSF $::tcltest::testSingleFile
18set ::tcltest::testSingleFile false
19
20if {[testConstraint unix] && $tcl_platform(os) eq "Darwin" &&
21	![string match *pkga* [info loaded]]} {
22    # On Darwin, test .bundle (un)loading in addition to .dylib
23    set ext .bundle
24    source [file join [file dirname [info script]] load.test]
25    set ext .bundle
26    source [file join [file dirname [info script]] unload.test]
27    unset -nocomplain ext
28}
29
30set ::tcltest::testSingleFile $oldTSF
31unset oldTSF
32::tcltest::cleanupTests
33return
34