[111471] trunk/base/src/port1.0/tests
marius at macports.org
marius at macports.org
Mon Sep 23 08:58:50 PDT 2013
Revision: 111471
https://trac.macports.org/changeset/111471
Author: marius at macports.org
Date: 2013-09-23 08:58:50 -0700 (Mon, 23 Sep 2013)
Log Message:
-----------
port1.0: removed tabs, added modeline
Modified Paths:
--------------
trunk/base/src/port1.0/tests/portactivate.test
trunk/base/src/port1.0/tests/portchecksum.test
trunk/base/src/port1.0/tests/portclean.test
trunk/base/src/port1.0/tests/portdeactivate.test
trunk/base/src/port1.0/tests/portdepends.test
trunk/base/src/port1.0/tests/portdistcheck.test
trunk/base/src/port1.0/tests/portinstall.test
trunk/base/src/port1.0/tests/portload.test
trunk/base/src/port1.0/tests/portmain.test
trunk/base/src/port1.0/tests/portpatch.test
trunk/base/src/port1.0/tests/porttest.test
trunk/base/src/port1.0/tests/portuninstall.test
trunk/base/src/port1.0/tests/portutil.test
Modified: trunk/base/src/port1.0/tests/portactivate.test
===================================================================
--- trunk/base/src/port1.0/tests/portactivate.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portactivate.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,11 +14,11 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portactivate 1.0
+package require registry 1.0
source ./library.tcl
macports_worker_init
-package require portactivate 1.0
-package require registry 1.0
test activate_start {
Activate start unit test.
@@ -74,18 +76,18 @@
set macports::channels(notice) {}
if {[$workername eval eval_targets install] != 0} {
- return "FAIL: port install failed"
+ return "FAIL: port install failed"
}
} -body {
if {[$workername eval eval_targets activate] != 0} {
- return "FAIL: cannot activate port after install"
+ return "FAIL: cannot activate port after install"
}
if {[$workername eval eval_targets deactivate] != 0} {
return "FAIL: cannot deactivate port"
}
if {[$workername eval eval_targets activate] != 0} {
- return "FAIL: cannot activate port after deactivate"
+ return "FAIL: cannot activate port after deactivate"
}
return "Port activate successful."
Modified: trunk/base/src/port1.0/tests/portchecksum.test
===================================================================
--- trunk/base/src/port1.0/tests/portchecksum.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portchecksum.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -3,10 +5,16 @@
set pwd [file dirname [file normalize $argv0]]
+source ../port_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
-source ../portchecksum.tcl
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+package require portchecksum 1.0
+
test parse_checksum {
Parse checksum unit test.
Modified: trunk/base/src/port1.0/tests/portclean.test
===================================================================
--- trunk/base/src/port1.0/tests/portclean.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portclean.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,11 +14,11 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portclean 1.0
+source ../port_autoconf.tcl
source ./library.tcl
macports_worker_init
-package require portclean 1.0
-source ../port_autoconf.tcl
test clean_start {
Clean start unit test.
@@ -26,7 +28,7 @@
set prefix /opt/local
seteuid 333
if {[catch {clean_start args}] != 1} {
- return "FAIL: couldn't elevate privileges"
+ return "FAIL: couldn't elevate privileges"
}
seteuid 0
return "Clean_start successful."
@@ -71,22 +73,22 @@
portclean::clean_dist
if {[file exists $distpath/dist_file]} {
- return "FAIL: distfile not removed"
+ return "FAIL: distfile not removed"
}
if {[file exists $distpath/dist_file2]} {
- return "FAIL: distfile not removed"
+ return "FAIL: distfile not removed"
}
if {[file exists $altprefix$distpath/dist_file2]} {
- return "FAIL: alt distfile not removed"
+ return "FAIL: alt distfile not removed"
}
if {[file exists $patchpath/patch_file2]} {
- return "FAIL: patchfile not removed"
+ return "FAIL: patchfile not removed"
}
if {[file exists $altprefix$patchpath/patch_file2]} {
- return "FAIL: alt patchfile not removed"
+ return "FAIL: alt patchfile not removed"
}
if {[file exists $portdbpath/distfiles/$dist_subdir]} {
- return "FAIL: distfiles dir not removed"
+ return "FAIL: distfiles dir not removed"
}
return "Clean distfiles successful."
@@ -122,16 +124,16 @@
portclean::clean_work
if {[file exists $subbuildpath]} {
- return "FAIL: buildpath not removed"
+ return "FAIL: buildpath not removed"
}
if {[file exists $altprefix/subbuild]} {
- return "FAIL: subbuild not removed"
+ return "FAIL: subbuild not removed"
}
if {[file exists $worksymlink]} {
- return "FAIL: symlink not removed"
+ return "FAIL: symlink not removed"
}
if {[file exists $altprefix$portpath]} {
- return "FAIL: port dir in alt prefix not removed"
+ return "FAIL: port dir in alt prefix not removed"
}
return "Clean work successful."
@@ -160,7 +162,7 @@
portclean::clean_logs
if {[file exists $subport]} {
- return "FAIL: log dir not removed"
+ return "FAIL: log dir not removed"
}
return "Clean logs successful."
@@ -190,13 +192,13 @@
portclean::clean_archive
if {[file exists $portdbpath/incoming/subport-1_0.0.0.0.TMP]} {
- return "FAIL: .TMP file not removed"
+ return "FAIL: .TMP file not removed"
}
if {![file exists $portdbpath/incoming/test.clean]} {
- return "FAIL: removed unrelated file"
+ return "FAIL: removed unrelated file"
}
if {[file exists $portdbpath/incoming/subport-2_0.0.0.0.zip]} {
- return "FAIL: zip archive not removed"
+ return "FAIL: zip archive not removed"
}
return "Clean archive successful."
Modified: trunk/base/src/port1.0/tests/portdeactivate.test
===================================================================
--- trunk/base/src/port1.0/tests/portdeactivate.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portdeactivate.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,11 +14,11 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portdeactivate 1.0
+package require registry 1.0
source ./library.tcl
macports_worker_init
-package require portdeactivate 1.0
-package require registry 1.0
test activate_start {
Deactivate start unit test.
@@ -74,28 +76,28 @@
set macports::channels(notice) {}
if {[$workername eval eval_targets install] != 0} {
- return "FAIL: port install failed"
+ return "FAIL: port install failed"
}
} -body {
if {[$workername eval eval_targets activate] != 0} {
- return "FAIL: cannot activate port after install"
+ return "FAIL: cannot activate port after install"
}
if {[$workername eval eval_targets deactivate] != 0} {
- return "FAIL: cannot deactivate port after activate"
+ return "FAIL: cannot deactivate port after activate"
}
- return "Port deactivate successful."
+ return "Port deactivate successful."
} -cleanup {
- if {[$workername eval eval_targets uninstall] != 0} {
- return "FAIL: uninstall failed"
- }
- if {[$workername eval eval_targets clean] != 0} {
- return "FAIL: clean failed"
- }
- array set macports::channels $oldchannels
+ if {[$workername eval eval_targets uninstall] != 0} {
+ return "FAIL: uninstall failed"
+ }
+ if {[$workername eval eval_targets clean] != 0} {
+ return "FAIL: clean failed"
+ }
+ array set macports::channels $oldchannels
- mportclose $mport
+ mportclose $mport
} -result "Port deactivate successful."
Modified: trunk/base/src/port1.0/tests/portdepends.test
===================================================================
--- trunk/base/src/port1.0/tests/portdepends.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portdepends.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,7 +14,7 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
-source ../portdepends.tcl
+package require portdepends 1.0
test validate_depends_options {
Modified: trunk/base/src/port1.0/tests/portdistcheck.test
===================================================================
--- trunk/base/src/port1.0/tests/portdistcheck.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portdistcheck.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,12 +14,11 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portdistcheck 1.0
source ./library.tcl
macports_worker_init
-source ../portdistcheck.tcl
-
test distcheck_main {
Distcheck main unit test.
} -setup {
@@ -32,14 +33,14 @@
set extract.suffix .tar.bz2
} -body {
- set fetch.type standard
- set distcheck.type moddate
+ set fetch.type standard
+ set distcheck.type moddate
if {[portdistcheck::distcheck_main] != ""} {
- return "FAIL: unable to download or check file, type moddate"
+ return "FAIL: unable to download or check file, type moddate"
}
- set distcheck.type filesize
+ set distcheck.type filesize
if {[portdistcheck::distcheck_main] != ""} {
- return "FAIL: unable to download or check file, type filesize"
+ return "FAIL: unable to download or check file, type filesize"
}
return "Distcheck main successful."
Modified: trunk/base/src/port1.0/tests/portinstall.test
===================================================================
--- trunk/base/src/port1.0/tests/portinstall.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portinstall.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,12 +14,12 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portinstall 1.0
+source ../../registry2.0/portuninstall.tcl
+source ../port_autoconf.tcl
source ./library.tcl
macports_worker_init
-source ../portinstall.tcl
-source ../../registry2.0/portuninstall.tcl
-source ../port_autoconf.tcl
# Set env vars
set os.platform darwin
@@ -45,7 +47,7 @@
} -body {
if {[catch {portinstall::install_start}] != 0} {
- return "FAIL: problem with install start"
+ return "FAIL: problem with install start"
}
return "Install start successful."
} -result "Install start successful."
@@ -54,15 +56,15 @@
test create_archive {
Create archive unit test.
} -constraints {
- root
+ root
} -setup {
- set destpath $pwd/work/destroot
- set portbuildpath $pwd
- set portdbpath $pwd/dbpath
- set portpath $pwd
- set create /dev/null
+ set destpath $pwd/work/destroot
+ set portbuildpath $pwd
+ set portdbpath $pwd/dbpath
+ set portpath $pwd
+ set create /dev/null
- # destroot setup
+ # destroot setup
file mkdir $pwd/$subport
set mport [mportopen file://.]
@@ -71,36 +73,36 @@
# run destroot
if {[$workername eval eval_targets destroot] != 0} {
- return "FAIL: destroot failed"
- }
+ return "FAIL: destroot failed"
+ }
- # portinstall setup
- interp alias {} _cd {} cd
+ # portinstall setup
+ interp alias {} _cd {} cd
- # hide all output. Deactivate this for debugging!
- set oldchannels [array get macports::channels]
- set macports::channels(msg) {}
- set macports::channels(notice) {}
+ # hide all output. Deactivate this for debugging!
+ set oldchannels [array get macports::channels]
+ set macports::channels(msg) {}
+ set macports::channels(notice) {}
- if {[$workername eval eval_targets install] != 0} {
- return "FAIL: port install failed"
- }
+ if {[$workername eval eval_targets install] != 0} {
+ return "FAIL: port install failed"
+ }
} -body {
if {[catch {$workername eval portinstall::create_archive $create tgz}] != 0} {
- return "FAIL: cannot create archive"
+ return "FAIL: cannot create archive"
}
return "Create archive successful."
} -cleanup {
- if {[$workername eval eval_targets uninstall] != 0} {
- return "FAIL: uninstall failed"
- }
- if {[$workername eval eval_targets clean] != 0} {
- return "FAIL: clean failed"
- }
- array set macports::channels $oldchannels
- mportclose $mport
+ if {[$workername eval eval_targets uninstall] != 0} {
+ return "FAIL: uninstall failed"
+ }
+ if {[$workername eval eval_targets clean] != 0} {
+ return "FAIL: clean failed"
+ }
+ array set macports::channels $oldchannels
+ mportclose $mport
file delete -force $pwd/$subport
file delete -force $portdbpath
@@ -115,21 +117,21 @@
test install_main {
Install main unit test.
} -constraints {
- root
+ root
} -setup {
- set workpath $pwd/work
+ set workpath $pwd/work
set portpath $pwd
set portdbpath $pwd/dbpath
set portbuildpath $pwd
set destpath $pwd/work/destroot
- set portvariants {+var1}
-
- set epoch i386
- set compiler.cpath /usr/bin/gcc
- set compiler.library_path /usr/lib
+ set portvariants {+var1}
+
+ set epoch i386
+ set compiler.cpath /usr/bin/gcc
+ set compiler.library_path /usr/lib
- # destroot setup
+ # destroot setup
file mkdir $pwd/$subport
set mport [mportopen file://.]
@@ -143,33 +145,33 @@
# run destroot
if {[$workername eval eval_targets destroot] != 0} {
- return "FAIL: destroot failed"
- }
+ return "FAIL: destroot failed"
+ }
- # portinstall setup
- interp alias {} _cd {} cd
+ # portinstall setup
+ interp alias {} _cd {} cd
- # hide all output. Deactivate this for debugging!
- set oldchannels [array get macports::channels]
- set macports::channels(msg) {}
- set macports::channels(notice) {}
+ # hide all output. Deactivate this for debugging!
+ set oldchannels [array get macports::channels]
+ set macports::channels(msg) {}
+ set macports::channels(notice) {}
} -body {
if {[$workername eval eval_targets install] != 0} {
- return "FAIL: cannot install port"
+ return "FAIL: cannot install port"
}
return "Install main successful."
} -cleanup {
- if {[$workername eval eval_targets uninstall] != 0} {
- return "FAIL: uninstall failed"
- }
- if {[$workername eval eval_targets clean] != 0} {
- return "FAIL: clean failed"
- }
- array set macports::channels $oldchannels
+ if {[$workername eval eval_targets uninstall] != 0} {
+ return "FAIL: uninstall failed"
+ }
+ if {[$workername eval eval_targets clean] != 0} {
+ return "FAIL: clean failed"
+ }
+ array set macports::channels $oldchannels
- mportclose $mport
+ mportclose $mport
file delete -force $pwd/$subport
file delete -force $portdbpath
Modified: trunk/base/src/port1.0/tests/portload.test
===================================================================
--- trunk/base/src/port1.0/tests/portload.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portload.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,14 +14,14 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
-source ../portload.tcl
+package require portload 1.0
source ../port_autoconf.tcl
test load_main {
Load main unit test.
} -constraints {
- root
+ root
} -setup {
set path /Library/test/files
@@ -45,7 +47,7 @@
set startupitem.plist files/file.plist
if {[portload::load_main] != ""} {
- return "FAIL: unable to load plist"
+ return "FAIL: unable to load plist"
}
return "Load successful."
Modified: trunk/base/src/port1.0/tests/portmain.test
===================================================================
--- trunk/base/src/port1.0/tests/portmain.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portmain.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -14,9 +16,9 @@
source ./library.tcl
macports_worker_init
-
package require portmain 1.0
+
# Set testing vars
set os_platform darwin
set macosx_version 10.8
@@ -31,7 +33,7 @@
} -body {
set portpath path/port/subport
if {[portmain::get_default_subport] != "subport"} {
- return "FAIL: wrong subport"
+ return "FAIL: wrong subport"
}
return "Get default subport successful."
} -result "Get default subport successful."
@@ -42,7 +44,7 @@
} -body {
set portpath path/port/subport
if {[portmain::get_subbuildpath] != "./build/subport"} {
- return "FAIL: wrong subbuildpath"
+ return "FAIL: wrong subbuildpath"
}
return "Get subbuild path successful."
} -result "Get subbuild path successful."
Modified: trunk/base/src/port1.0/tests/portpatch.test
===================================================================
--- trunk/base/src/port1.0/tests/portpatch.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portpatch.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,19 +14,18 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portpatch
+source ../port_autoconf.tcl
source ./library.tcl
macports_worker_init
-package require portpatch
-source ../port_autoconf.tcl
-
test build_getpatchtype {
Get patch type unit test.
} -body {
set res [portpatch::build_getpatchtype]
if {$res != $portutil::autoconf::patch_path} {
- return "FAIL: wrong path"
+ return "FAIL: wrong path"
}
return "Get patch type successful."
} -result "Get patch type successful."
Modified: trunk/base/src/port1.0/tests/porttest.test
===================================================================
--- trunk/base/src/port1.0/tests/porttest.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/porttest.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -14,7 +16,6 @@
source ./library.tcl
macports_worker_init
-
package require port 1.0
package require registry 1.0
@@ -45,22 +46,22 @@
set macports::channels(notice) {}
if {[$workername eval eval_targets install] != 0} {
- return "FAIL: port install failed"
+ return "FAIL: port install failed"
}
} -body {
if {[$workername eval eval_targets test] != 0} {
- return "FAIL: test target failed"
+ return "FAIL: test target failed"
}
return "Test main successful."
} -cleanup {
if {[$workername eval eval_targets uninstall] != 0} {
- return "FAIL: uninstall failed"
+ return "FAIL: uninstall failed"
}
if {[$workername eval eval_targets clean] != 0} {
- return "FAIL: clean failed"
+ return "FAIL: clean failed"
}
file delete -force $pwd/work
Modified: trunk/base/src/port1.0/tests/portuninstall.test
===================================================================
--- trunk/base/src/port1.0/tests/portuninstall.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portuninstall.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -12,13 +14,12 @@
#set ui_options(ports_verbose) yes
mportinit ui_options
+package require portinstall 1.0
+source ../../registry2.0/portuninstall.tcl
+source ../port_autoconf.tcl
source ./library.tcl
macports_worker_init
-source ../portinstall.tcl
-source ../../registry2.0/portuninstall.tcl
-source ../port_autoconf.tcl
-
set subport fondu
set version 3.0
set revision 2
@@ -30,60 +31,60 @@
test uninstall_main {
Uninstall main unit test.
} -constraints {
- root
+ root
} -setup {
- set workpath $pwd/work
- set portpath $pwd
- set portdbpath $pwd/dbpath
- set portbuildpath $pwd
- set destpath $pwd/work/destroot
- set portvariants {+var1}
+ set workpath $pwd/work
+ set portpath $pwd
+ set portdbpath $pwd/dbpath
+ set portbuildpath $pwd
+ set destpath $pwd/work/destroot
+ set portvariants {+var1}
- set epoch i386
- set compiler.cpath /usr/bin/gcc
- set compiler.library_path /usr/lib
+ set epoch i386
+ set compiler.cpath /usr/bin/gcc
+ set compiler.library_path /usr/lib
- # destroot setup
- file mkdir $pwd/$subport
- set mport [mportopen file://.]
+ # destroot setup
+ file mkdir $pwd/$subport
+ set mport [mportopen file://.]
- if {[eval_variants variations] != 0} {
- mportclose $mport
- error "Error evaluating variants"
- }
+ if {[eval_variants variations] != 0} {
+ mportclose $mport
+ error "Error evaluating variants"
+ }
- # set $version var
- set workername [ditem_key $mport workername]
+ # set $version var
+ set workername [ditem_key $mport workername]
- # run destroot
- if {[$workername eval eval_targets destroot] != 0} {
- return "FAIL: destroot failed"
- }
+ # run destroot
+ if {[$workername eval eval_targets destroot] != 0} {
+ return "FAIL: destroot failed"
+ }
- # portinstall setup
- interp alias {} _cd {} cd
+ # portinstall setup
+ interp alias {} _cd {} cd
- # hide all output. Deactivate this for debugging!
- set oldchannels [array get macports::channels]
- set macports::channels(msg) {}
- set macports::channels(notice) {}
-
- if {[$workername eval eval_targets install] != 0} {
- return "FAIL: cannot install port"
+ # hide all output. Deactivate this for debugging!
+ set oldchannels [array get macports::channels]
+ set macports::channels(msg) {}
+ set macports::channels(notice) {}
+
+ if {[$workername eval eval_targets install] != 0} {
+ return "FAIL: cannot install port"
}
} -body {
- if {[$workername eval eval_targets uninstall] != 0} {
- return "FAIL: uninstall failed"
- }
+ if {[$workername eval eval_targets uninstall] != 0} {
+ return "FAIL: uninstall failed"
+ }
return "Uninstall main successful."
} -cleanup {
- if {[$workername eval eval_targets clean] != 0} {
- return "FAIL: clean failed"
- }
-
+ if {[$workername eval eval_targets clean] != 0} {
+ return "FAIL: clean failed"
+ }
+
file delete -force $pwd/$subport
file delete -force $portdbpath
file delete -force $pwd/work
Modified: trunk/base/src/port1.0/tests/portutil.test
===================================================================
--- trunk/base/src/port1.0/tests/portutil.test 2013-09-23 15:24:07 UTC (rev 111470)
+++ trunk/base/src/port1.0/tests/portutil.test 2013-09-23 15:58:50 UTC (rev 111471)
@@ -1,3 +1,5 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+
package require tcltest 2
namespace import tcltest::*
@@ -55,18 +57,18 @@
set mport [mportopen file://.]
proc getportbuildpath {id {portname ""}} {
- global portdbpath
- regsub {://} $id {.} port_path
- regsub -all {/} $port_path {_} port_path
- return [file join $portdbpath build $port_path $portname]
+ global portdbpath
+ regsub {://} $id {.} port_path
+ regsub -all {/} $port_path {_} port_path
+ return [file join $portdbpath build $port_path $portname]
}
proc getportworkpath_from_buildpath {portbuildpath} {
- return [file join $portbuildpath work]
+ return [file join $portbuildpath work]
}
proc getportworkpath_from_portdir {portpath {portname ""}} {
- return [getportworkpath_from_buildpath [getportbuildpath $portpath $portname]]
+ return [getportworkpath_from_buildpath [getportbuildpath $portpath $portname]]
}
source $pwd/../portutil.tcl
@@ -158,10 +160,10 @@
test handle_option-strsed {
Handle_option strsed unit test.
} -body {
- unset user_options
+ unset user_options
array set user_options { opt options }
if {[handle_option-strsed opt b] != ""} {return "FAIL: invalid result"}
- return "Handle_option-strsed successful."
+ return "Handle_option-strsed successful."
} -result "Handle_option-strsed successful."
@@ -284,7 +286,7 @@
catch {set f [open $file r]}
set cont [read -nonewline $f]
if { $cont != "MacPorts reinplace unit test?" } {
- return "FAIL: reinplace no args."
+ return "FAIL: reinplace no args."
}
close $f
@@ -292,7 +294,7 @@
catch {set f [open $file r]}
set cont [read -nonewline $f]
if { $cont != "MacPorts reinplace unit testing?" } {
- return "FAIL: reinplace (-E) extended regex."
+ return "FAIL: reinplace (-E) extended regex."
}
close $f
@@ -300,7 +302,7 @@
catch {set f [open $second/file r]}
set cont [read -nonewline $f]
if { $cont != "MP reinplace unit test?" } {
- return "FAIL: reinplace (-W) relative path."
+ return "FAIL: reinplace (-W) relative path."
}
close $f
@@ -308,7 +310,7 @@
catch {set f [open $file r]}
set cont [read -nonewline $f]
if { $cont != "" } {
- return "FAIL: reinplace (-n) suppress output."
+ return "FAIL: reinplace (-n) suppress output."
}
close $f
@@ -416,34 +418,34 @@
ln -s dir $root/b
ln -s a $root/b
if {[catch {file type $root/dir/a}] || [file type $root/dir/a] ne "link"} {
- return "FAIL: directory ln failed."
+ return "FAIL: directory ln failed."
}
file delete $root/dir/a
ln -s -f -h a $root/b
if {[catch {file type $root/b}] || [file type $root/b] ne "link" || [file readlink $root/b] ne "a"} {
- return "FAIL: readlink error."
+ return "FAIL: readlink error."
}
cd $root/dir
ln -s ../c
if {[catch {file type $root/dir/c}] || [file type $root/dir/c] ne "link"} {
- return "FAIL: ln failed."
+ return "FAIL: ln failed."
}
ln -s foobar $root/d
if {[catch {file type $root/d}] || [file type $root/d] ne "link" || [file readlink $root/d] ne "foobar"} {
- return "FAIL: readlink error."
+ return "FAIL: readlink error."
}
ln -s -f -h z $root/dir
if {[catch {file type $root/dir/z}] || [file type $root/dir/z] ne "link"} {
- return "FAIL: ln failed."
+ return "FAIL: ln failed."
}
ln -sf q $root/dir
if {[catch {file type $root/dir/q}] || [file type $root/dir/q] ne "link"} {
- return "FAIL: error combined ln flags."
+ return "FAIL: error combined ln flags."
}
return "Files successfully linked."
@@ -475,16 +477,16 @@
} -body {
set list { port }
if { [unobscure_maintainers $list] != "port at macports.org" } {
- return "FAIL: invalid maintainer name"
+ return "FAIL: invalid maintainer name"
}
set list { google.com:port }
if { [unobscure_maintainers $list] != "port at google.com" } {
- return "FAIL: invalid maintainer name"
+ return "FAIL: invalid maintainer name"
}
set list { port at google.com }
if { [unobscure_maintainers $list] != "port at google.com" } {
- return "FAIL: invalid maintainer name"
+ return "FAIL: invalid maintainer name"
}
return "unobscure_maintainers successful."
} -result "unobscure_maintainers successful."
@@ -498,17 +500,17 @@
Evaluate targets unit test.
} -setup {
init_eval_targets
- set patchfiles {file.diff}
+ set patchfiles {file.diff}
- file mkdir $filespath
+ file mkdir $filespath
set fd [open $filespath/file.diff w+]
puts $fd "first line should get to the workpath"
close $fd
# sets up PortInfo array
if {[eval_variants variations] != 0} {
- mportclose $mport
- error "Error evaluating variants"
+ mportclose $mport
+ error "Error evaluating variants"
}
set epoch $PortInfo(epoch)
@@ -519,10 +521,10 @@
} -body {
if {[$workername eval catch {eval_targets macport}] != 1} {
- return "FAIL: invalid target detected"
+ return "FAIL: invalid target detected"
}
if {[$workername eval eval_targets checksum] != 0} {
- return "FAIL: valid target not detected"
+ return "FAIL: valid target not detected"
}
return "Eval_targets successful."
@@ -542,7 +544,7 @@
set res [catch {get_statefile_value target $fd result}]
if {$res != 0 || $result != "org.macports.fetch"} {
- return "FAIL: invalid value"
+ return "FAIL: invalid value"
}
return "Get statefile value successful."
} -result "Get statefile value successful."
@@ -581,15 +583,15 @@
Check statefile unit test.
} -setup {
array set variations {
- target org.macports.fetch
- target org.macports.checksum
+ target org.macports.fetch
+ target org.macports.checksum
}
array set oldvariations {
- target org.macports.fetch
- target org.macports.checksum
+ target org.macports.fetch
+ target org.macports.checksum
}
array set oldvariations_fail {
- target org.macports.patch
+ target org.macports.patch
}
set fd [open $pwd/statefile r]
@@ -615,15 +617,15 @@
} -body {
set res [choose_variants $mport variations]
if {[lindex $res 1] != "" && [lindex $res 0] != "ditem_1"} {
- return "FAIL: invalid variations"
+ return "FAIL: invalid variations"
}
set res [choose_variants $mport variations_neg]
if {[lindex $res 0] != "" && [lindex $res 1] != "ditem_1"} {
- return "FAIL: invalid variations"
+ return "FAIL: invalid variations"
}
set res [choose_variants $mport variations_not]
if {[lindex $res 0] != "" && [lindex $res 1] != ""} {
- return "FAIL: invalid variations"
+ return "FAIL: invalid variations"
}
return "Choose variant successful."
} -result "Choose variant successful."
@@ -632,13 +634,13 @@
test variant_run {
Variant run unit test. Executes proc with same name as variant.
} -setup {
- proc variant-var {} { set var test }
+ proc variant-var {} { set var test }
set ditem [variant_new var]
set name [ditem_key $ditem name]
} -body {
if {[catch {variant_run $ditem}] != 0} {
- return "FAIL: unable to run variant name proc"
+ return "FAIL: unable to run variant name proc"
}
return "Variant run successful."
} -cleanup {
@@ -652,10 +654,10 @@
} -body {
set arr {c + b - d +}
if {[canonicalize_variants $arr +] != "+c+d"} {
- return "FAIL: incorrect string"
+ return "FAIL: incorrect string"
}
if {[canonicalize_variants $arr -] != "-b"} {
- return "FAIL: incorrect string"
+ return "FAIL: incorrect string"
}
return "Canonicalize variants successful."
} -result "Canonicalize variants successful."
@@ -672,7 +674,7 @@
set ditem [variant_new new-variant]
if {[catch {universal_setup}] != 0} {
- return "FAIL: universal variant not set"
+ return "FAIL: universal variant not set"
}
return "Universal_setup successful."
} -result "Universal_setup successful."
@@ -696,7 +698,7 @@
} -body {
set ditem [variant_new new-variant]
if {[ditem_key $ditem name] != "new-variant"} {
- return "FAIL: error building new variant"
+ return "FAIL: error building new variant"
}
return "Variant new successful."
} -result "Variant new successful."
@@ -706,16 +708,16 @@
Handle default variants unit test.
} -body {
array set variations {
- target.run org.macports.checksum
+ target.run org.macports.checksum
}
set res [handle_default_variants target set {+org -org2}]
if {[lindex $PortInfo(vinfo) 0] != "org" || [lindex $PortInfo(vinfo) 1] != "is_default +"} {
- return "FAIL: default variant not set"
+ return "FAIL: default variant not set"
}
if {[lindex $PortInfo(vinfo) 2] != "org2" || [lindex $PortInfo(vinfo) 3] != "is_default -"} {
- return "FAIL: nondefault variant not set"
+ return "FAIL: nondefault variant not set"
}
return "Handle default variant successful."
@@ -736,7 +738,7 @@
file mkdir $pwd/test.dir
file copy -force $pwd/statefile $pwd/test.dir
if {[dirSize $pwd/test.dir] != 155} {
- return "FAIL: wrong dir size"
+ return "FAIL: wrong dir size"
}
return "Directory size calculated successfully."
@@ -751,6 +753,7 @@
set env(UI_PREFIX) MacPorts
set_ui_prefix
if {$UI_PREFIX != "MacPorts"} {return "FAIL: incorrect prefix"}
+
unset env(UI_PREFIX)
set_ui_prefix
if {$UI_PREFIX != "---> "} {return "FAIL; default prefix not set"}
@@ -764,19 +767,19 @@
test get_portimage_name {
Get portimage name unit test.
} -body {
- set os.platform darwin
+ set os.platform darwin
set version 1.0
set os.major 10
- set revision 2
+ set revision 2
set configure.build_arch no
set portarchivetype tgz
set subport testport
- set portvariants {var1}
- set supported_archs {}
+ set portvariants {var1}
+ set supported_archs {}
set res [get_portimage_name]
if {$res != "testport-1.0_2var1.darwin_10.no.tgz"} {
- return "FAIL: invalid portimage_name"
+ return "FAIL: invalid portimage_name"
}
return "Get portimage_name successful."
} -result "Get portimage_name successful."
@@ -785,16 +788,16 @@
test get_portimage_path {
Get portimage path unit test. Calls get_portimage_name.
} -body {
- set os.platform darwin
+ set os.platform darwin
set portdbpath dbpath
set subport subport
- set revision 2
- set portvariants {var1}
- set supported_archs {}
+ set revision 2
+ set portvariants {var1}
+ set supported_archs {}
set res [get_portimage_path]
if {$res != "dbpath/software/subport/subport-1.0_2var1.darwin_10.no.tgz"} {
- return "FAIL: invalid portimage_path"
+ return "FAIL: invalid portimage_path"
}
return "Get portimage_path successful."
} -result "Get portimage_path successful."
@@ -807,15 +810,15 @@
set archives [supportedArchiveTypes]
foreach archive $archives {
- if {$archive == "xar" && ![file exists ${portutil::autoconf::xar_path}]} {
- return "FAIL: xar detected but inexistent"
- }
- if {$archive == "zip" && ![file exists ${portutil::autoconf::zip_path}]} {
- return "FAIL: zip detected but inexistent"
- }
- if {$archive == "cpio" && ![file exists ${portutil::autoconf::cpio_path}]} {
- return "FAIL: cpio detected but inexistent"
- }
+ if {$archive == "xar" && ![file exists ${portutil::autoconf::xar_path}]} {
+ return "FAIL: xar detected but inexistent"
+ }
+ if {$archive == "zip" && ![file exists ${portutil::autoconf::zip_path}]} {
+ return "FAIL: zip detected but inexistent"
+ }
+ if {$archive == "cpio" && ![file exists ${portutil::autoconf::cpio_path}]} {
+ return "FAIL: cpio detected but inexistent"
+ }
}
return "Supported archives successful."
} -result "Supported archives successful."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130923/b1503012/attachment-0001.html>
More information about the macports-changes
mailing list