diff options
Diffstat (limited to 'contrib/bluegnu2.0.3/lib/Default_target.itcl')
-rw-r--r-- | contrib/bluegnu2.0.3/lib/Default_target.itcl | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/contrib/bluegnu2.0.3/lib/Default_target.itcl b/contrib/bluegnu2.0.3/lib/Default_target.itcl new file mode 100644 index 0000000..f66b20a --- /dev/null +++ b/contrib/bluegnu2.0.3/lib/Default_target.itcl @@ -0,0 +1,82 @@ +# +# This script create a Default Target object +# + +verbose "Default Target Information ****" 3 + +proc Default {args} { + global nspTestSuite auto_path env + global testCases + + verbose "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" + verbose "@@@@@@@ Default Target Initialization Procedure" + verbose {@@@@@@@ auto_path:\n [join [split $auto_path] \ + "\n "]} 4 + # + # Create the Default Target Object, which need to be returned. + # + namespace eval $nspTestSuite { + set args [uplevel 1 set args] + verbose "Arguments: $args (are not used)" 3 + verbose "======= Default Procedure creates Target Object" 3 + + + # Check argument and remove the local argument from the list + # All argument that do not contain a equal sign are also removed + set i 0 + catch {unset rmList} + foreach arg $args { + if {!$i} { + if {[llength [split $arg "="]] == 1} { + uplevel set eInterface $arg + lappend rmList $i + } + } + if {[string compare [lindex [split $arg "="] 0] \ + "testCases"] == 0} { + uplevel set testCases [lindex [split $arg "="] 1] + lappend rmList $i + } + incr i + } + if {[info exists rmList]} { + #puts "rmList >$rmList<" + for {set i [expr [llength $rmList] - 1]} {$i >= 0} {incr i -1} { + set args [lreplace $args $i $i] + } + } + verbose "Arguments (passed): $args" 5 + + verbose "Arguments (used): $args" 3 + set target [eval [concat createTarget $args]] + if {! [string match ::* $target]} { + set target [namespace current]::$target + } + debug {Target name >$target<} 3 + + # Save all Environment Variables so they may be cleared! + # + [$target environment] saveEnv + } + + # Return the name of the Target Object that has been created + # This should be the last statement + return [namespace eval $nspTestSuite {set target}] +} + +proc Default_start {} { + verbose "@@@@@@@ Starting Default Environment" +} + +proc Default_load {} { + verbose "@@@@@@@ Load Default Environment" +} + +proc Default_exit {} { + verbose "@@@@@@@ Exit Default Environment" + verbose "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" +} + +proc Default_version {} { + verbose "@@@@@@@ Version Default Environment" +} |