[110050] branches/gsoc13-tests
marius at macports.org
marius at macports.org
Sun Aug 25 09:59:43 PDT 2013
Revision: 110050
https://trac.macports.org/changeset/110050
Author: marius at macports.org
Date: 2013-08-25 09:59:43 -0700 (Sun, 25 Aug 2013)
Log Message:
-----------
macports1.0: Added macports_test_autoconf file and source macports_fastload in all tests
Modified Paths:
--------------
branches/gsoc13-tests/configure.ac
branches/gsoc13-tests/src/macports1.0/tests/macports.test
branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test
branches/gsoc13-tests/src/macports1.0/tests/macports_index.test
branches/gsoc13-tests/src/macports1.0/tests/macports_util.test
Added Paths:
-----------
branches/gsoc13-tests/src/macports1.0/macports_test_autoconf.tcl.in
Modified: branches/gsoc13-tests/configure.ac
===================================================================
--- branches/gsoc13-tests/configure.ac 2013-08-25 16:55:54 UTC (rev 110049)
+++ branches/gsoc13-tests/configure.ac 2013-08-25 16:59:43 UTC (rev 110050)
@@ -400,6 +400,7 @@
src/Makefile
src/machista1.0/Makefile
src/macports1.0/macports_autoconf.tcl
+ src/macports1.0/macports_test_autoconf.tcl
src/port1.0/port_autoconf.tcl
src/registry2.0/registry_autoconf.tcl
src/programs/Makefile
Added: branches/gsoc13-tests/src/macports1.0/macports_test_autoconf.tcl.in
===================================================================
--- branches/gsoc13-tests/src/macports1.0/macports_test_autoconf.tcl.in (rev 0)
+++ branches/gsoc13-tests/src/macports1.0/macports_test_autoconf.tcl.in 2013-08-25 16:59:43 UTC (rev 110050)
@@ -0,0 +1,36 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# macports-autoconf.tcl.in
+# $Id: macports_autoconf.tcl.in 90070 2012-02-20 21:54:35Z jberry at macports.org $
+#
+# Copyright (c) 2006 - 2009, 2011 The MacPorts Project
+# Copyright (c) 2002 - 2003 Apple Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple Inc. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+namespace eval macports::autoconf {
+ variable macports_tcl_dir "@macports_tcl_dir@"
+}
Modified: branches/gsoc13-tests/src/macports1.0/tests/macports.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports.test 2013-08-25 16:55:54 UTC (rev 110049)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports.test 2013-08-25 16:59:43 UTC (rev 110050)
@@ -5,8 +5,11 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../macports_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
+package require macports 1.0
+
# Debug options
-package require macports 1.0
array set ui_options {}
#set ui_options(ports_debug) yes
#set ui_options(ports_verbose) yes
@@ -43,6 +46,36 @@
}
+
+test mportclose {
+ Mport close unit test.
+} -body {
+ set mport [mportopen file://.]
+ if {[catch {mportclose $mport}] != 0} {
+ return "FAIL: cannot run mportclose"
+ }
+ if {[ditem_key $mport workername] != ""} {
+ return "FAIL: port not closed"
+ }
+ return "Mport close successful."
+} -result "Mport close successful."
+
+
+test mportinfo {
+ Mport info uni test.
+} -setup {
+ set mport [mportopen file://.]
+} -body {
+ set res [mportinfo $mport]
+ if {[lindex $res 2] != "canonical_active_variants"} {
+ return "FAIL: cannot get ::PortInfo"
+ }
+ return "Mport info successful."
+} -cleanup {
+ mportclose $mport
+} -result "Mport info successful."
+
+
test mportopen_installed {
Mport installed unit test.
} -constraints {
@@ -172,8 +205,9 @@
Init logging unit test.
} -constraints {
root
+} -setup {
+ set mport [mportopen file://.]
} -body {
- set mport [mportopen file://.]
if {[macports::init_logging $mport] != 0} {
return "FAIL: incorrect channels"
}
@@ -183,8 +217,9 @@
if {$macports::channels(debug) != "debuglog"} {
return "FAIL: incorrect channels(debug)"
}
+ return "Init logging successful."
+} -cleanup {
mportclose $mport
- return "Init logging successful."
} -result "Init logging successful."
@@ -221,9 +256,9 @@
Push log unit test.
} -constraints {
root
+} -setup {
+ set mport [mportopen file://.]
} -body {
- set mport [mportopen file://.]
-
set ::logenabled 1
if {[catch {macports::push_log $mport}] != 0} {
return "FAIL: cannot push log"
@@ -231,8 +266,9 @@
if {[lindex $::logstack 0] != [list $::debuglog $::debuglogname]} {
return "FAIL: incorrect logstack"
}
+ return "Push log successful."
+} -cleanup {
mportclose $mport
- return "Push log successful."
} -result "Push log successful."
@@ -422,23 +458,9 @@
# test get_tar_flags
+# test fetch_port
-test fetch_port {
- Fetch port unit test.
-} -body {
- set macports::portdbpath $pwd/portdbpath
- set url "http://packages.macports.org/fondu/fondu-060102_1.darwin_12.x86_64.tbz2"
-
- #if {[macports::fetch_port $url 0] != "${macports::portdbpath}/portdirs/fondu-060102_1"} {
- #return "FAIL: cannot fetch archive"
- #}
- return "Fetch port successful."
-} -cleanup {
- file delete -force $macports::portdbpath
-} -result "Fetch port successful."
-
-
test getprotocol {
Get protocol unit test.
} -body {
@@ -449,21 +471,9 @@
} -result "Get protocol successful."
-test getportdir {
- Get port dir unit test.
-} -body {
- set macports::portdbpath $pwd/portdbpath
- set url "http://packages.macports.org/fondu/fondu-060102_1.darwin_12.x86_64.tbz2"
+# test getportdir
- #if {[macports::getportdir $url .] != "${macports::portdbpath}/portdirs/fondu-060102_1"} {
- #return "FAIL: wrong path"
- #}
- return "Get port dir successful."
-} -cleanup {
- file delete -force $macports::portdbpath
-} -result "Get port dir successful."
-
test getportresourcepath {
Get port resource path. Doesn't check for 'file' protocol.
} -body {
@@ -585,9 +595,12 @@
# test mportlistall
# test _mports_load_quickindex
# test mports_generate_quickindex
-# test mportinfo
-# test mportclose
+
+
+
+
+
# test _mportkey
# test mportdepends
# test _mport_supports_archs
Modified: branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test 2013-08-25 16:55:54 UTC (rev 110049)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports_dlist.test 2013-08-25 16:59:43 UTC (rev 110050)
@@ -1,8 +1,16 @@
package require tcltest 2
namespace import tcltest::*
+source ../macports_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
+
+# Debug options
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
source ../macports_dlist.tcl
Modified: branches/gsoc13-tests/src/macports1.0/tests/macports_index.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports_index.test 2013-08-25 16:55:54 UTC (rev 110049)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports_index.test 2013-08-25 16:59:43 UTC (rev 110050)
@@ -4,6 +4,8 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../macports_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
Modified: branches/gsoc13-tests/src/macports1.0/tests/macports_util.test
===================================================================
--- branches/gsoc13-tests/src/macports1.0/tests/macports_util.test 2013-08-25 16:55:54 UTC (rev 110049)
+++ branches/gsoc13-tests/src/macports1.0/tests/macports_util.test 2013-08-25 16:59:43 UTC (rev 110050)
@@ -1,8 +1,11 @@
package require tcltest 2
namespace import tcltest::*
+source ../macports_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
+
test method_wrap {
Method wrap unit test.
} -setup {
@@ -30,7 +33,6 @@
Ldindex unit test.
} -body {
set list {0 1 2 3}
-
if {[ldindex list 1] != 1} {
return "FAIL: element not poped"
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130825/712c77a6/attachment-0001.html>
More information about the macports-changes
mailing list