[111468] trunk/base/src/macports1.0/tests

marius at macports.org marius at macports.org
Mon Sep 23 08:19:23 PDT 2013


Revision: 111468
          https://trac.macports.org/changeset/111468
Author:   marius at macports.org
Date:     2013-09-23 08:19:23 -0700 (Mon, 23 Sep 2013)
Log Message:
-----------
macports1.0: removed tabs, added library.tcl file

Modified Paths:
--------------
    trunk/base/src/macports1.0/tests/macports.test
    trunk/base/src/macports1.0/tests/macports_dlist.test
    trunk/base/src/macports1.0/tests/macports_util.test

Added Paths:
-----------
    trunk/base/src/macports1.0/tests/library.tcl

Added: trunk/base/src/macports1.0/tests/library.tcl
===================================================================
--- trunk/base/src/macports1.0/tests/library.tcl	                        (rev 0)
+++ trunk/base/src/macports1.0/tests/library.tcl	2013-09-23 15:19:23 UTC (rev 111468)
@@ -0,0 +1,65 @@
+##
+# This is basically a copy of macports::worker_init, but without using
+# sub-interpreters
+proc macports_worker_init {} {
+    interp alias {} _cd {} cd
+    proc PortSystem {version} {
+        package require port $version
+    }
+    # Clearly separate slave interpreters and the master interpreter.
+    interp alias {} mport_exec      {} mportexec
+    interp alias {} mport_open      {} mportopen
+    interp alias {} mport_close     {} mportclose
+    interp alias {} mport_lookup    {} mportlookup
+    interp alias {} mport_info      {} mportinfo
+    # Export some utility functions defined here.
+    interp alias {} macports_create_thread          {} macports::create_thread
+    interp alias {} getportworkpath_from_buildpath  {} macports::getportworkpath_from_buildpath
+    interp alias {} getportresourcepath             {} macports::getportresourcepath
+    interp alias {} getportlogpath                  {} macports::getportlogpath
+    interp alias {} getdefaultportresourcepath      {} macports::getdefaultportresourcepath
+    interp alias {} getprotocol                     {} macports::getprotocol
+    interp alias {} getportdir                      {} macports::getportdir
+    interp alias {} findBinary                      {} macports::findBinary
+    interp alias {} binaryInPath                    {} macports::binaryInPath
+    # New Registry/Receipts stuff
+    interp alias {} registry_new                    {} registry::new_entry
+    interp alias {} registry_open                   {} registry::open_entry
+    interp alias {} registry_write                  {} registry::write_entry
+    interp alias {} registry_prop_store             {} registry::property_store
+    interp alias {} registry_prop_retr              {} registry::property_retrieve
+    interp alias {} registry_exists                 {} registry::entry_exists
+    interp alias {} registry_exists_for_name        {} registry::entry_exists_for_name
+    interp alias {} registry_activate               {} portimage::activate
+    interp alias {} registry_deactivate             {} portimage::deactivate
+    interp alias {} registry_deactivate_composite   {} portimage::deactivate_composite
+    interp alias {} registry_uninstall              {} registry_uninstall::uninstall
+    interp alias {} registry_register_deps          {} registry::register_dependencies
+    interp alias {} registry_fileinfo_for_index     {} registry::fileinfo_for_index
+    interp alias {} registry_fileinfo_for_file      {} registry::fileinfo_for_file
+    interp alias {} registry_bulk_register_files    {} registry::register_bulk_files
+    interp alias {} registry_active                 {} registry::active
+    interp alias {} registry_file_registered        {} registry::file_registered
+    interp alias {} registry_port_registered        {} registry::port_registered
+    interp alias {} registry_list_depends           {} registry::list_depends
+    # deferred options processing.
+    interp alias {} getoption {} macports::getoption
+    # ping cache
+    interp alias {} get_pingtime {} macports::get_pingtime
+    interp alias {} set_pingtime {} macports::set_pingtime
+    # archive_sites.conf handling
+    interp alias {} get_archive_sites_conf_values {} macports::get_archive_sites_conf_values
+    foreach opt $macports::portinterp_options {
+        if {![info exists $opt]} {
+            global macports::$opt
+            set ::$opt macports::$opt
+        }
+        if {[info exists $opt]} {
+            set system_options($opt) $opt
+            set ::$opt $opt
+        }
+    }
+
+    # We don't need to handle portinterp_deferred_options, they're
+    # automatically handled correctly.
+}

Modified: trunk/base/src/macports1.0/tests/macports.test
===================================================================
--- trunk/base/src/macports1.0/tests/macports.test	2013-09-23 15:19:02 UTC (rev 111467)
+++ trunk/base/src/macports1.0/tests/macports.test	2013-09-23 15:19:23 UTC (rev 111468)
@@ -30,46 +30,25 @@
 #set ui_options(ports_verbose) yes
 mportinit ui_options
 
-source ../../port1.0/portutil.tcl
-source ../../port1.0/portuninstall.tcl
-source ../../port1.0/portinstall.tcl
+package require portutil 1.0
+package require portinstall 1.0
+package require portuninstall 1.0
+package require Thread
 source ../../registry2.0/portuninstall.tcl
 source ../../port1.0/port_autoconf.tcl
+source ./library.tcl
+macports_worker_init
 
-proc registry_exists {name version {revision 0} {variants ""}} {
-    global macports::registry.format
-    return [${macports::registry.format}::entry_exists $name $version $revision $variants]
-}
 
-proc uninstall_main {args} {
-    global subport version revision portvariants user_options
-    registry_uninstall::uninstall $subport $version $revision $portvariants [array get user_options]
-    return 0
-}
-
-proc findBinary {prog {autoconf_hint ""}} {
-    if {${autoconf_hint} != "" && [file executable ${autoconf_hint}]} {
-        return ${autoconf_hint}
-    } else {
-        if {[catch {set cmd_path [macports::binaryInPath ${prog}]} result] == 0} {
-            return ${cmd_path}
-        } else {
-            return -code error "${result} or at its MacPorts guration time tion, did you move it?"
-        }
-    }
-}
-
-
-
 test mportclose {
     Mport close unit test.
 } -body {
     set mport [mportopen file://.]
     if {[catch {mportclose $mport}] != 0} {
-	   return "FAIL: cannot run mportclose"
+       return "FAIL: cannot run mportclose"
     }
     if {[ditem_key $mport workername] != ""} {
-	   return "FAIL: port not closed"
+       return "FAIL: port not closed"
     }
     return "Mport close successful."
 } -result "Mport close successful."
@@ -163,19 +142,21 @@
 } -body {
     set res [mportopen_installed $subport $version $revision $variants $options]
     if {![string match "ditem_*" $res]} {
-	   return "FAIL: installed port not opened"
+       return "FAIL: installed port not opened"
     }
 
     if {[catch {mportclose_installed $res}] != 0} {
-	   return "FAIL: cannot close port"
+       return "FAIL: cannot close port"
     }
     if {[catch {mportclose_installed $res}] != 1} {
-	   return "FAIL: installed port not closed"
+       return "FAIL: installed port not closed"
     }
     return "Installed port open successful."
 
 } -cleanup {
-    set res [uninstall_main]
+    if {[catch {portuninstall::uninstall_main}] != 0} {
+        return "FAIL: cannot install port"
+    }
     mportclose $mport
 
     file delete -force $pwd/work
@@ -187,13 +168,13 @@
     Ui is set unit test.
 } -body {
     namespace eval macports {
-	array set ui_options { test yes }
+    array set ui_options { test yes }
     }
     if {[macports::ui_isset test] != 1} {
-	   return "FAIL: set option not detected"
+       return "FAIL: set option not detected"
     }
     if {[macports::ui_isset port] != 0} {
-	   return "FAIL: unset option detected"
+       return "FAIL: unset option detected"
     }
     return "ui_isset successful."
 } -result "ui_isset successful."
@@ -203,13 +184,13 @@
     Global option is set unit test.
 } -body {
     namespace eval macports {
-	array set global_options { test yes }
+    array set global_options { test yes }
     }
     if {[macports::global_option_isset test] != 1} {
-	   return "FAIL: set option not detected"
+       return "FAIL: set option not detected"
     }
     if {[macports::global_option_isset port] != 0} {
-	   return "FAIL: unset option detected"
+       return "FAIL: unset option detected"
     }
     return "Global option isset successful."
 } -result "Global option isset successful."
@@ -223,13 +204,13 @@
     set mport [mportopen file://.]
 } -body {
     if {[macports::init_logging $mport] != 0} {
-	   return "FAIL: incorrect channels"
+       return "FAIL: incorrect channels"
     }
     if {$macports::channels(any) != "stdout debuglog"} {
-	   return "FAIL: incorrect channels(any)"
+       return "FAIL: incorrect channels(any)"
     }
     if {$macports::channels(debug) != "debuglog"} {
-	   return "FAIL: incorrect channels(debug)"
+       return "FAIL: incorrect channels(debug)"
     }
     return "Init logging successful."
 } -cleanup {
@@ -251,13 +232,13 @@
 
 } -body {
     if {[macports::ch_logging $mport] != 0} {
-	   return "FAIL: channels not set"
+       return "FAIL: channels not set"
     }
     if {![file exists $logname]} {
-	   return "FAIL: logname dir missing"
+       return "FAIL: logname dir missing"
     }
     if {![file exists $logname/main.log]} {
-	   return "FAIL: main.log missing"
+       return "FAIL: main.log missing"
     }
     return "Channel logging successful."
 
@@ -275,10 +256,10 @@
 } -body {
     set ::logenabled 1
     if {[catch {macports::push_log $mport}] != 0} {
-	   return "FAIL: cannot push log"
+       return "FAIL: cannot push log"
     }
     if {[lindex $::logstack 0] != [list $::debuglog $::debuglogname]} {
-	   return "FAIL: incorrect logstack"
+       return "FAIL: incorrect logstack"
     }
     return "Push log successful."
 } -cleanup {
@@ -300,10 +281,10 @@
     Find binary unit test.
 } -body {
     if {[macports::findBinary pwd ls] != "/bin/pwd"} {
-	   return "FAIL: wrong binary"
+       return "FAIL: wrong binary"
     }
     if {[macports::findBinary pwd /bin/ls] != "/bin/ls"} {
-	   return "FAIL: wrong binary"
+       return "FAIL: wrong binary"
     }
     return "Find binary successful."
 } -result "Find binary successful."
@@ -313,10 +294,10 @@
     Binary in path unit test.
 } -body {
     if {[catch {macports::binaryInPath zz}] != 1} {
-	   return "FAIL: invalid binary found"
+       return "FAIL: invalid binary found"
     }
     if {[macports::binaryInPath ls] != "/bin/ls"} {
-	   return "FAIL: wrong binary found"
+       return "FAIL: wrong binary found"
     }
     return "Binary in path successful."
 } -result "Binary in path successful."
@@ -333,10 +314,10 @@
     unset macports::xcodeversion
 
     if {[macports::setxcodeinfo a b c] != ""} {
-	   return "FAIL: xcode binary not found"
+       return "FAIL: xcode binary not found"
     }
     if {![info exists macports::xcodeversion]} {
-	   return "FAIL: xcodeversion unset"
+       return "FAIL: xcodeversion unset"
     }
     return "Set XCode version successful."
 } -result "Set XCode version successful."
@@ -350,10 +331,10 @@
     unset macports::developer_dir
 
     if {[macports::set_developer_dir a b c] != ""} {
-	   return "FAIL: cannot set dev dir"
+       return "FAIL: cannot set dev dir"
     }
     if {![info exists macports::developer_dir]} {
-	   return "FAIL: developer_dir var no set"
+       return "FAIL: developer_dir var no set"
     }
     return "Set developer dir successful."
 } -result "Set developer dir successful."
@@ -364,7 +345,7 @@
 } -body {
     set macports::set_developer /Applications/Xcode.app/Contents/Developer
     if {[macports::_is_valid_developer_dir $macports::developer_dir] != 1} {
-	   return "FAIL: valid dir not detected"
+       return "FAIL: valid dir not detected"
     }
     return "Valid dev dir successful."
 } -result "Valid dev dir successful."
@@ -389,7 +370,7 @@
 
 } -body {
     if {[mportshutdown] != ""} {
-	   return "FAIL: errors occured"
+       return "FAIL: errors occured"
     }
 
     set res ""
@@ -397,7 +378,7 @@
     set fd [open $macports::portdbpath/pingtimes r]
 
     if {[gets $fd] != $res} {
-	   return "FAIL: wrong value saved"
+       return "FAIL: wrong value saved"
     }
     close $fd
     return "Mportshutdown successful."
@@ -415,10 +396,10 @@
     set target $pwd/target
 
     if {[macports::copy_xcode_plist $target] != ""} {
-	   return "FAIL: cannot copy xcode plist"
+       return "FAIL: cannot copy xcode plist"
     }
     if {![file exists $target/Library/Preferences/com.apple.dt.Xcode.plist]} {
-	   return "FAIL: missing plist file"
+       return "FAIL: missing plist file"
     }
     return "Copy xcode plist successful."
 } -cleanup {
@@ -438,16 +419,16 @@
 } -body {
     macports::worker_init $name $portpath $porturl $portbuildpath $options $variations
     if {$name != "interp0"} {
-	   return "FAIL: wrong workername"
+       return "FAIL: wrong workername"
     }
     if {[$name eval source Portfile] != "yes"} {
-	   return "FAIL: cannot load Portfile"
+       return "FAIL: cannot load Portfile"
     }
     if {[$name eval findBinary ls] != "/bin/ls"} {
-	   return "FAIL: alias not created"
+       return "FAIL: alias not created"
     }
     if {[$name eval return \$os_arch] != "i386"} {
-	   return "FAIL: var not set"
+       return "FAIL: var not set"
     }
     return "Worker init successful."
 } -result "Worker init successful."
@@ -461,7 +442,7 @@
 
     set res [macports::create_thread]
     if {![string match "tid0x*" $res]} {
-	   return "FAIL: cannot create thread"
+       return "FAIL: cannot create thread"
     }
     return "Create thread successful."
 } -result "Create thread successful."
@@ -475,7 +456,7 @@
     Get protocol unit test.
 } -body {
     if {[macports::getprotocol http://www.macports.org] != "http"} {
-	   return "FAIL: wrong protocol"
+       return "FAIL: wrong protocol"
     }
     return "Get protocol successful."
 } -result "Get protocol successful."
@@ -493,13 +474,13 @@
     set fallback_path $pwd/portdbpath/sources/packages.macports.org/fondu/fondu-060102_1.darwin_12.x86_64.tbz2/_resources
 
     if {[macports::getportresourcepath $url "" yes] != $default_path} {
-	   return "FAIL: wrong resource path"
+       return "FAIL: wrong resource path"
     }
     if {[macports::getportresourcepath $url "" no] != $fallback_path} {
-	   return "FAIL: wrong fallback path"
+       return "FAIL: wrong fallback path"
     }
     if {[macports::getportresourcepath $url "test" no] != "${fallback_path}/test"} {
-	   return "FAIL: wrong fallback path with subdir"
+       return "FAIL: wrong fallback path with subdir"
     }
 
     return "Get resource path successful."
@@ -512,14 +493,14 @@
     set path test/path
     set macports::sources_default file://$pwd
     if {[macports::getdefaultportresourcepath $path] != "${pwd}/_resources/${path}"} {
-	   return "FAIL: wrong file res path"
+       return "FAIL: wrong file res path"
     }
 
     set macports::sources_default http://$pwd
     set default_source_url [lindex ${macports::sources_default} 0]
     set right_path [macports::getsourcepath $default_source_url]/_resources/test/path
     if {[macports::getdefaultportresourcepath $path] != $right_path} {
-	   return "FAIL: wrong http res path"
+       return "FAIL: wrong http res path"
     }
     return "Default res path successful."
 } -result "Default res path successful."
@@ -543,10 +524,10 @@
     file copy -force $pwd/Portfile $pwd/porttree/cat2/fondu/Portfile
 
     proc test_proc {file} {
-	   global pwd res
-	   set fd [open ${pwd}/porttree/${file}/Portfile r]
-	   gets $fd line
-	   append res [lindex [split $line " "] 3]
+       global pwd res
+       set fd [open ${pwd}/porttree/${file}/Portfile r]
+       gets $fd line
+       append res [lindex [split $line " "] 3]
     }
 
     global res
@@ -554,7 +535,7 @@
 } -body {
     mporttraverse test_proc $pwd/porttree
     if {$res != "8547285472"} {
-	   return "FAIL: porttree not traversed"
+       return "FAIL: porttree not traversed"
     }
     return "Mport traverse successful."
 } -cleanup {
@@ -622,16 +603,16 @@
     close $fd
 } -body {
     if {[mportselect list group] != {file1 file2}} {
-	   return "FAIL: files not listed"
+       return "FAIL: files not listed"
     }
     if {[mportselect set group file1] != ""} {
-	   reutrn "FAIL: cannot set links"
+       reutrn "FAIL: cannot set links"
     }
     if {![file exists $macports::prefix/a]} {
-	   return "FAIL: link not created"
+       return "FAIL: link not created"
     }
     if {[mportselect show group] != "file1"} {
-	   return "FAIL: file not selected"
+       return "FAIL: file not selected"
     }
     return "Mport select successful."
 
@@ -646,11 +627,11 @@
     global env
     set env(TMPDIR) temporal
     if {[macports::gettmpdir] != "temporal"} {
-	   return "FAIL: set temp dir not detected"
+       return "FAIL: set temp dir not detected"
     }
     unset env(TMPDIR)
     if {[macports::gettmpdir] != "/tmp"} {
-	   return "FAIL: default value not set"
+       return "FAIL: default value not set"
     }
     return "Get tmp dir successful."
 } -result "Get tmp dir successful."
@@ -663,22 +644,22 @@
     set macports::os_arch i386
     set macports::os_platform darwin
     if {[macports::arch_runnable ppc1] != no} {
-	   return "FAIL: major:12 arch:i386 arch:ppc* not detected"
+       return "FAIL: major:12 arch:i386 arch:ppc* not detected"
     }
     if {[macports::arch_runnable ppc64] != no} {
-	   return "FAIL: major:12 arch:i386 arch:ppc64 not detected"
+       return "FAIL: major:12 arch:i386 arch:ppc64 not detected"
     }
     set macports::os_major 7
     set macports::os_arch i386
     set macports::os_platform darwin
     if {[macports::arch_runnable x86_64] != no} {
-	   return "FAIL: major:7 arch:i386 arch:x86_64 not detected"
+       return "FAIL: major:7 arch:i386 arch:x86_64 not detected"
     }
     set macports::os_major 12
     set macports::os_arch i386
     set macports::os_platform darwin
     if {[macports::arch_runnable x86_64] != yes} {
-	   return "FAIL: major:12 arch:i386 arch:x86_64 not detected"
+       return "FAIL: major:12 arch:i386 arch:x86_64 not detected"
     }
     return "Arch runnable successful."
 } -result "Arch runnable successful."
@@ -693,14 +674,14 @@
 } -body {
     set macports::applications_dir appdir
     if {[macports::path_is_in_prefix appdir/test/port] != yes} {
-	   return "FAIL: application dir not detected"
+       return "FAIL: application dir not detected"
     }
     set macports::prefix prefix
     if {[macports::path_is_in_prefix prefix/test/port] != yes} {
-	   return "FAIL: prefix not detected"
+       return "FAIL: prefix not detected"
     }
     if {[macports::path_is_in_prefix test/port] != no} {
-	   return "FAIL: no prefix detected"
+       return "FAIL: no prefix detected"
     }
     return "Path prefix successful."
 } -result "Path prefix successful."
@@ -711,11 +692,11 @@
 } -body {
     set res [macports::revupgrade_handle_special_paths fname test_path]
     if {$res != "test_path"} {
-	   return "FAIL: wrong path"
+       return "FAIL: wrong path"
     }
     set res [macports::revupgrade_handle_special_paths fname @loader_path/test_load]
     if {$res != "./test_load"} {
-	   return "FAIL: wrong load path"
+       return "FAIL: wrong load path"
     }
     return "Revupgrade handle special path successful."
 } -result "Revupgrade handle special path successful."
@@ -734,13 +715,13 @@
 
 } -body {
     if {[macports::get_pingtime macports.org] != "MacPorts"} {
-	   return "FAIL: wrong ping time"
+       return "FAIL: wrong ping time"
     }
     if {[macports::get_pingtime macports_blacklist] != -1} {
-	   return "FAIL: wrong time for blacklisted host"
+       return "FAIL: wrong time for blacklisted host"
     }
     if {[macports::get_pingtime macports_pref] != 1} {
-	   return "FAIL: wrong time for preferred host"
+       return "FAIL: wrong time for preferred host"
     }
     return "Get ping time successful."
 } -result "Get ping time successful."
@@ -751,7 +732,7 @@
 } -body {
     set macports::ping_cache(macports) {}
     if {[lindex [macports::set_pingtime macports 007] 0] != 007} {
-	   return "FAIL: ping time not set"
+       return "FAIL: ping time not set"
     }
     return "Set ping time successful."
 } -result "Set ping time successful."
@@ -772,15 +753,15 @@
 } -body {
     set res [macports::get_archive_sites_conf_values]
     if {[lindex [split $res " "] 1] != "macports.org:nosubdir"} {
-	   return "FAIL: name not set"
+       return "FAIL: name not set"
     }
     if {[lindex [split $res " "] 3] != "tgz"} {
-	   return "FAIL: wrong type set"
+       return "FAIL: wrong type set"
     }
 
     set macports::archive_sites_conf_values {a b c}
     if {[macports::get_archive_sites_conf_values] != {a b c}} {
-	   return "FAIL: wrong  result for bad conf file"
+       return "FAIL: wrong  result for bad conf file"
     }
     return "Get archive sites conf values successful."
 

Modified: trunk/base/src/macports1.0/tests/macports_dlist.test
===================================================================
--- trunk/base/src/macports1.0/tests/macports_dlist.test	2013-09-23 15:19:02 UTC (rev 111467)
+++ trunk/base/src/macports1.0/tests/macports_dlist.test	2013-09-23 15:19:23 UTC (rev 111468)
@@ -19,17 +19,17 @@
 } -setup {
     set mport [mportopen file://.]
     set crit {
-	   provides fondu
-	   porturl file://.
+       provides fondu
+       porturl file://.
     }
     set crit2 { provides fondu2 }
 
 } -body {
     if {[dlist_match_multi $mport $crit] != $mport} {
-	   return "FAIL: correct dlist not matched"
+       return "FAIL: correct dlist not matched"
     }
     if {[dlist_match_multi $mport $crit2] != ""} {
-	   return "FAIL: incorrect dlist matched"
+       return "FAIL: incorrect dlist matched"
     }
     return "dlist match successful."
 } -cleanup {
@@ -43,10 +43,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[dlist_search $mport provides fondu] != $mport} {
-	   return "FAIL: matching item not found"
+       return "FAIL: matching item not found"
     }
     if {[dlist_search $mport provides fondu2] != ""} {
-	   return "FAIL: wrong item detected"
+       return "FAIL: wrong item detected"
     }
     return "dlist successful."
 } -cleanup {
@@ -62,10 +62,10 @@
     lappend dlist $mport
 } -body {
     if {[dlist_delete dlist $mport] != ""} {
-	   return "FAIL: cannot run dlist_delete"
+       return "FAIL: cannot run dlist_delete"
     }
     if {$dlist != ""} {
-	   return "FAIL: port not removed from list"
+       return "FAIL: port not removed from list"
     }
     return "Dlist delete successful."
 } -cleanup {
@@ -79,10 +79,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[dlist_has_pending $mport fondu] != 1} {
-	   return "FAIL: not detected"
+       return "FAIL: not detected"
     }
     if {[dlist_has_pending $mport provides] != 0} {
-	   return "FAIL: incorrect detected"
+       return "FAIL: incorrect detected"
     }
     return "dlist pending successful."
 } -cleanup {
@@ -95,14 +95,14 @@
 } -setup {
     set mport [mportopen file://.]
     array set statusdict {
-	   vara 0
-	   varb 0
-	   varc 1
+       vara 0
+       varb 0
+       varc 1
     }
     set tokens {vara varb vard}
 } -body {
     if {[dlist_count_unmet $mport statusdict $tokens] != 3} {
-	   return "FAIL: wrong unmet number"
+       return "FAIL: wrong unmet number"
     }
     return "count unmet successful."
 } -cleanup {
@@ -120,10 +120,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[ditem_key $mport {provides}] != "fondu"} {
-	   return "FAIL: wrong key value"
+       return "FAIL: wrong key value"
     }
     if {[ditem_key $mport {wants}] != ""} {
-	   return "FAIL: wrong key detected"
+       return "FAIL: wrong key detected"
     }
     return "ditem key successful."
 } -cleanup {
@@ -143,7 +143,7 @@
     set result {fondu2}
 } -body {
     if {[dlist_append_dependents $mport provides $result] != {fondu2 provides}} {
-	   return "FAIL: wrong depends"
+       return "FAIL: wrong depends"
     }
     return "Append depends successful."
 } -cleanup {
@@ -158,7 +158,7 @@
     set dict {fondu}
 } -body {
     if {[dlist_get_next $mport $dict] != $mport} {
-	   return "FAIL: wrong dlist"
+       return "FAIL: wrong dlist"
     }
     return "dlist get next successful."
 } -cleanup {
@@ -171,16 +171,16 @@
 } -setup {
     set mport [mportopen file://.]
     proc cond {arg} {
-	   if {[string match "ditem_*" $arg] != 0} {
+       if {[string match "ditem_*" $arg] != 0} {
             return 0
-	   } else {
+       } else {
             return 1
-	   }
+       }
     }
     proc handler {arg} {}
 } -body {
     if {[dlist_eval $mport cond handler] != ""} {
-	   return "FAIL: wrong value returned"
+       return "FAIL: wrong value returned"
     }
     return "dlist eval successful."
 } -cleanup {
@@ -201,10 +201,10 @@
     set mport [mportopen file://.]
 } -body {
     if {[ditem_contains $mport provides] != 1} {
-	   return "FAIL: valid key not detected"
+       return "FAIL: valid key not detected"
     }
     if {[ditem_contains $mport wants] != 0} {
-	   return "FAIL: invalid key detected"
+       return "FAIL: invalid key detected"
     }
     return "ditem contains successful."
 } -cleanup {

Modified: trunk/base/src/macports1.0/tests/macports_util.test
===================================================================
--- trunk/base/src/macports1.0/tests/macports_util.test	2013-09-23 15:19:02 UTC (rev 111467)
+++ trunk/base/src/macports1.0/tests/macports_util.test	2013-09-23 15:19:23 UTC (rev 111468)
@@ -10,20 +10,20 @@
     Method wrap unit test.
 } -setup {
     proc test_proc {a} {
-	   if { $a == 1} {
-	       return -code error $a -errorcode 7
-	   } else {
+       if { $a == 1} {
+           return -code error $a -errorcode 7
+       } else {
             return $a
-	   }
+       }
     }
 
 } -body {
     macports_util::method_wrap test_proc
     if {[test_proc 1] != 7} {
-	   return "FAIL: no wrap around method"
+       return "FAIL: no wrap around method"
     }
     if {[test_proc arg] != "arg"} {
-	   return "FAIL: no wrap around method"
+       return "FAIL: no wrap around method"
     }
     return "Method wrap successful."
 } -result "Method wrap successful."
@@ -34,19 +34,19 @@
 } -body {
     set list {0 1 2 3}
     if {[ldindex list 1] != 1} {
-	   return "FAIL: element not poped"
+       return "FAIL: element not poped"
     }
     if {$list != {0 2 3}} {
-	   return "FAIL: wrong list remaining"
+       return "FAIL: wrong list remaining"
     }
     if {[catch {ldindex list 4}] != 1} {
-	   return "FAIL: error not detected"
+       return "FAIL: error not detected"
     }
     if {[ldindex list] != {0 2 3}} {
-	   return "FAIL: not all elements poped"
+       return "FAIL: not all elements poped"
     }
     if {$list != ""} {
-	   return "FAIL: list not emptied"
+       return "FAIL: list not emptied"
     }
     return "ldindex successful."
 } -result "ldindex successful."
@@ -57,10 +57,10 @@
 } -body {
     set list {0 1 2}
     if {[lpop list] != 2} {
-	   return "FAIL: element not poped"
+       return "FAIL: element not poped"
     }
     if {$list != {0 1}} {
-	   return "FAIL: wrong element poped"
+       return "FAIL: wrong element poped"
     }
     return "lpop successful."
 } -result "lpop successful."
@@ -71,13 +71,13 @@
 } -body {
     set list {0 1}
     if {[lpush list 2] != {0 1 2}} {
-	   return "FAIL: element not appended"
+       return "FAIL: element not appended"
     }
     if {[lpush list 3 4] != {0 1 2 3 4}} {
-	   return "FAIL: multiple elements not appended"
+       return "FAIL: multiple elements not appended"
     }
     if {[lpush list1 0] != 0} {
-	   return "FAIL: list not created"
+       return "FAIL: list not created"
     }
     return "lpop successful."
 } -result "lpop successful."
@@ -90,13 +90,13 @@
     set list1 {}
 
     if {[lshift list] != 0} {
-	   return "FAIL: wrong element poped"
+       return "FAIL: wrong element poped"
     }
     if {$list != {1 2}} {
-	   return "FAIL: wrong list remaining"
+       return "FAIL: wrong list remaining"
     }
     if {[lshift list1] != ""} {
-	   return "FAIL: empty list not detected"
+       return "FAIL: empty list not detected"
     }
     return "lshift successful."
 } -result "lshift successful."
@@ -108,13 +108,13 @@
     set list {3 4}
 
     if {[lunshift list 2] != {2 3 4}} {
-	   return "FAIL: element not inserted"
+       return "FAIL: element not inserted"
     }
     if {[lunshift list 0 1] != {0 1 2 3 4}} {
-	   return "FAIL: multiple elements not inserted"
+       return "FAIL: multiple elements not inserted"
     }
     if {[lunshift list2 0] != 0} {
-	   return "FAIL: list not created"
+       return "FAIL: list not created"
     }
     return "lunshift successful."
 } -result "lunshift successful."
@@ -125,15 +125,15 @@
     Throw unit test.
 } -setup {
     proc test_proc {arg} {
-	   catch {throw $arg} res
-	   return $res
+       catch {throw $arg} res
+       return $res
     }
 } -body {
     if {[test_proc {7 msg info}] != "error: 7 msg info"} {
-	   return "FAIL: wrong error returneed"
+       return "FAIL: wrong error returneed"
     }
     if {[catch {test_proc ""}] != 0} {
-	   return "FAIL: wrong value returned"
+       return "FAIL: wrong value returned"
     }
     return "throw successful."
 } -result "throw successful."
@@ -146,13 +146,13 @@
     proc test_proc2 {} {try {error "msg" "info" 3} catch * {return 6}}
 } -body {
     if {[test_proc] != 7} {
-	   return "FAIL: try clause not working"
+       return "FAIL: try clause not working"
     }
     if {[test_proc2] != 6} {
-	   reutrn "FAIL: catch clause not working"
+       reutrn "FAIL: catch clause not working"
     }
     if {[catch {try}] != 1} {
-	   return "FAIL: no args err not detected"
+       return "FAIL: no args err not detected"
     }
     return "try successful."
 } -result "try successful."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130923/6548ecdd/attachment-0001.html>


More information about the macports-changes mailing list