[111299] branches/gsoc13-tests
marius at macports.org
marius at macports.org
Wed Sep 18 11:47:46 PDT 2013
Revision: 111299
https://trac.macports.org/changeset/111299
Author: marius at macports.org
Date: 2013-09-18 11:47:46 -0700 (Wed, 18 Sep 2013)
Log Message:
-----------
package1.0: use correct macports_fastload.tcl file; added package_test_autoconf file
Modified Paths:
--------------
branches/gsoc13-tests/configure
branches/gsoc13-tests/configure.ac
branches/gsoc13-tests/src/package1.0/tests/portarchivefetch.test
branches/gsoc13-tests/src/package1.0/tests/portdmg.test
branches/gsoc13-tests/src/package1.0/tests/portdpkg.test
branches/gsoc13-tests/src/package1.0/tests/portmdmg.test
branches/gsoc13-tests/src/package1.0/tests/portmpkg.test
branches/gsoc13-tests/src/package1.0/tests/portpkg.test
branches/gsoc13-tests/src/package1.0/tests/test.tcl
Added Paths:
-----------
branches/gsoc13-tests/src/package1.0/package_test_autoconf.tcl.in
Removed Paths:
-------------
branches/gsoc13-tests/src/package1.0/tests/portrpm.test
branches/gsoc13-tests/src/package1.0/tests/portsrpm.test
Modified: branches/gsoc13-tests/configure
===================================================================
--- branches/gsoc13-tests/configure 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/configure 2013-09-18 18:47:46 UTC (rev 111299)
@@ -10107,7 +10107,7 @@
# Output
-ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/base.mtree doc/prefix.mtree doc/macosx.mtree doc/macports.conf doc/pubkeys.conf portmgr/freebsd/Makefile 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/port1.0/port_test_autoconf.tcl src/registry2.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl setupenv.bash"
+ac_config_files="$ac_config_files Doxyfile Makefile Mk/macports.autoconf.mk doc/base.mtree doc/prefix.mtree doc/macosx.mtree doc/macports.conf doc/pubkeys.conf portmgr/freebsd/Makefile 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/port1.0/port_test_autoconf.tcl src/package1.0/package_test_autoconf.tcl src/registry2.0/registry_autoconf.tcl src/programs/Makefile src/macports1.0/macports_fastload.tcl setupenv.bash"
ac_config_files="$ac_config_files src/pkg_mkindex.sh"
@@ -10820,6 +10820,7 @@
"src/macports1.0/macports_test_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/macports1.0/macports_test_autoconf.tcl" ;;
"src/port1.0/port_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/port1.0/port_autoconf.tcl" ;;
"src/port1.0/port_test_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/port1.0/port_test_autoconf.tcl" ;;
+ "src/package1.0/package_test_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/package1.0/package_test_autoconf.tcl" ;;
"src/registry2.0/registry_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/registry2.0/registry_autoconf.tcl" ;;
"src/programs/Makefile") CONFIG_FILES="$CONFIG_FILES src/programs/Makefile" ;;
"src/macports1.0/macports_fastload.tcl") CONFIG_FILES="$CONFIG_FILES src/macports1.0/macports_fastload.tcl" ;;
Modified: branches/gsoc13-tests/configure.ac
===================================================================
--- branches/gsoc13-tests/configure.ac 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/configure.ac 2013-09-18 18:47:46 UTC (rev 111299)
@@ -403,6 +403,7 @@
src/macports1.0/macports_test_autoconf.tcl
src/port1.0/port_autoconf.tcl
src/port1.0/port_test_autoconf.tcl
+ src/package1.0/package_test_autoconf.tcl
src/registry2.0/registry_autoconf.tcl
src/programs/Makefile
src/macports1.0/macports_fastload.tcl
Added: branches/gsoc13-tests/src/package1.0/package_test_autoconf.tcl.in
===================================================================
--- branches/gsoc13-tests/src/package1.0/package_test_autoconf.tcl.in (rev 0)
+++ branches/gsoc13-tests/src/package1.0/package_test_autoconf.tcl.in 2013-09-18 18:47:46 UTC (rev 111299)
@@ -0,0 +1,37 @@
+# -*- 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@"
+ variable prefix "@prefix@"
+}
Modified: branches/gsoc13-tests/src/package1.0/tests/portarchivefetch.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portarchivefetch.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portarchivefetch.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -4,19 +4,22 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../package_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
+package require macports 1.0
-package require macports 1.0
-mportinit
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
source ./library.tcl
macports_worker_init
-#source ../../port1.0/port_autoconf.tcl
-#set portutil::autoconf::openssl_path "/usr/bin/openssl"
package require portarchivefetch 1.0
-#source ../portarchivefetch.tcl
namespace eval portutil {
namespace eval autoconf {
- variable openssl_path "/usr/bin/openssl"
+ variable openssl_path "/usr/bin/openssl"
}
}
@@ -33,7 +36,7 @@
} -body {
if {[portarchivefetch::filter_sites] != "http://www.fondu.sourceforge.net/:tgz"} {
- return "FAIL: couldn't fetch file"
+ return "FAIL: couldn't fetch file"
}
return "Filter sites successful."
@@ -55,13 +58,13 @@
} -body {
if {[catch {portarchivefetch::checkarchivefiles $urls}] != 0} {
- return "FAIL: cannot run checkarchivefiles"
+ return "FAIL: cannot run checkarchivefiles"
}
if {[lindex $all_archive_files 0] != "fondu-060102_1var1.darwin_9.noarch.zip"} {
- return "FAIL: invalid archive file name"
+ return "FAIL: invalid archive file name"
}
if {[lindex $all_archive_files 1] != "fondu-060102_1var1.darwin_9.noarch.tgz"} {
- return "FAIL: invalid archive file name"
+ return "FAIL: invalid archive file name"
}
return "Check archive files successful."
} -result "Check archive files successful."
@@ -72,7 +75,9 @@
test fetchfiles {
- Fetch files unit test. Fails to verify signature.
+ Fetch files unit test.
+} -constraints {
+ root
} -setup {
global os.platform os.major os.arch epoch destpath package.destpath configure.build_arch
global subport version revision package.flat maintainers description categories
@@ -80,25 +85,38 @@
env_init
array set ::portfetch::urlmap {
- fondu http://packages.macports.org/fondu/
- archive_sites www.google.com
+ fondu http://packages.macports.org/fondu/
}
set portarchivefetch::archivefetch_urls {fondu fondu-060102_1.darwin_12.x86_64.tbz2}
+ set target_state_fd [open $pwd/target w+]
+ set mport [mportopen file://.]
+ set workername [ditem_key $mport workername]
+ set macportsuser macports
+
} -body {
- set macportsuser macports
+ set archivefetch.pubkeys $pwd
+ if {[catch {portarchivefetch::fetchfiles}] != 0} {
+ return "FAIL: cannot fetch archive"
+ }
+ if {[file exists ${archivefetch.fulldestpath}/fondu-060102_1.darwin_12.x86_64.tbz2]} {
+ return "FAIL: unverified archive not discarded"
+ }
+
+ set archivefetch.pubkeys ${macports::prefix}/share/macports/macports-pubkey.pem
if {[portarchivefetch::fetchfiles] != 0} {
- return "FAIL: cannot fetch port"
+ return "FAIL: cannot fetch archive"
}
- #if {![file exists ${archivefetch.fulldestpath}/fondu_src-060102.tgz.TMP]} {
- #return "FAIL: missing fetched archive"
- #}
- #if {![file exists ${archivefetch.fulldestpath}/fondu_src-060102.tgz.rmd160]} {
- #return "FAIL: missing fetched archive rmd"
- #}
+ if {![file exists ${archivefetch.fulldestpath}/fondu-060102_1.darwin_12.x86_64.tbz2]} {
+ return "FAIL: verified archive deleted"
+ }
+
return "Fetch files successful."
} -cleanup {
+ close $target_state_fd
+ file delete -force $target_state_fd
+ mportclose $mport
file delete -force $portdbpath
} -result "Fetch files successful."
Modified: branches/gsoc13-tests/src/package1.0/tests/portdmg.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portdmg.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portdmg.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -4,16 +4,22 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../package_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
+source ./library.tcl
+macports_worker_init
+
source ../portdmg.tcl
source ../../port1.0/port_autoconf.tcl
-source ./library.tcl
-macports_worker_init
-
# test dmg_main
Modified: branches/gsoc13-tests/src/package1.0/tests/portdpkg.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portdpkg.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portdpkg.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -4,20 +4,26 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../package_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
+source ./library.tcl
+macports_worker_init
+
source ../portdpkg.tcl
source ../../port1.0/port_autoconf.tcl
-source ./library.tcl
-macports_worker_init
-
test main {
Port dpkg main unit test.
-} -constraints {
- [catch {exec which dpkg-deb}] == 0
+} -constraints { ![catch {exec which dpkg-deb}]
+
} -setup {
set os.platform darwin
set os.major 10
@@ -39,10 +45,10 @@
} -body {
if {[catch {portdpkg::main}] != 0} {
- return "FAIL: cannot create dmg"
+ return "FAIL: cannot create dmg"
}
if {![file exists $pwd/pkg/fondu_060102-1_all.deb]} {
- return "FAIL: missing .deb file"
+ return "FAIL: missing .deb file"
}
return "Package deb successful."
@@ -59,8 +65,8 @@
set version 060102
set revision 1
} -body {
- if {[portdpkg::make_dependency_list $subport] != "fondu/060102"} {
- return "FAIL: could not make dependency list"
+ if {[portdpkg::make_dependency_list $subport] != ""} {
+ return "FAIL: could not make dependency list"
}
return "Make dependency list successful."
} -result "Make dependency list successful."
Modified: branches/gsoc13-tests/src/package1.0/tests/portmdmg.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portmdmg.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portmdmg.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -4,17 +4,23 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../package_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
+source ./library.tcl
+macports_worker_init
+
source ../portmdmg.tcl
source ../portmpkg.tcl
source ../../port1.0/port_autoconf.tcl
-source ./library.tcl
-macports_worker_init
-
# test dmg_main
@@ -36,13 +42,13 @@
} -body {
if {[portmdmg::package_mdmg $subport $portepoch $version $revision] != 0} {
- return "FAIL: cannot create mdmg"
+ return "FAIL: cannot create mdmg"
}
if {![file exists $pwd/pkg/fondu-060102-1.dmg]} {
- return "FAIL: missing .dmg file"
+ return "FAIL: missing .dmg file"
}
if {![file exists $pwd/pkg/fondu-060102-1/fondu-i386_060102_1.mpkg]} {
- return "FAIL: invalid package.destpath"
+ return "FAIL: invalid package.destpath"
}
return "Package dmg successful."
Modified: branches/gsoc13-tests/src/package1.0/tests/portmpkg.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portmpkg.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portmpkg.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -4,14 +4,22 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../package_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
-package require portmpkg 1.0
-package require portpkg 1.0
+
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
source ./library.tcl
macports_worker_init
+package require portmpkg 1.0
+package require portpkg 1.0
+
test mpkg_main {
Port mpkg main unit test.
} -setup {
@@ -25,19 +33,19 @@
} -body {
if {[portmpkg::mpkg_main] != 0} {
- return "FAIL: cannot create pkg"
+ return "FAIL: cannot create pkg"
}
if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/PkgInfo]} {
- return "FAIL: missing PkgInfo file"
+ return "FAIL: missing PkgInfo file"
}
if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/Info.plist]} {
- return "FAIL: missing Info.plist file"
+ return "FAIL: missing Info.plist file"
}
if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/Resources]} {
- return "FAIL: missing Resources dir"
+ return "FAIL: missing Resources dir"
}
if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/Packages/fondu-1_060102_1.pkg]} {
- return "FAIL: missing pkg file"
+ return "FAIL: missing pkg file"
}
return "Package mpkg successful."
@@ -59,7 +67,7 @@
} -body {
set res [portmpkg::make_dependency_list $subport $destination]
if { $res != "{fondu 0 060102 1 ditem_4}" } {
- return "FAIL: invalid dependency list"
+ return "FAIL: invalid dependency list"
}
return "Dependency list successful."
Modified: branches/gsoc13-tests/src/package1.0/tests/portpkg.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portpkg.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portpkg.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -4,14 +4,22 @@
set pwd [file normalize $argv0]
set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
+source ../package_test_autoconf.tcl
+source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
package require macports 1.0
-mportinit
-package require portmpkg 1.0
-package require portpkg 1.0
+
+array set ui_options {}
+#set ui_options(ports_debug) yes
+#set ui_options(ports_verbose) yes
+mportinit ui_options
+
source ./library.tcl
macports_worker_init
+package require portmpkg 1.0
+package require portpkg 1.0
+
test pkg_main {
Port pkg main unit test.
} -setup {
Deleted: branches/gsoc13-tests/src/package1.0/tests/portrpm.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portrpm.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portrpm.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -1,42 +0,0 @@
-package require tcltest 2
-namespace import tcltest::*
-
-set pwd [file normalize $argv0]
-set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
-
-package require macports 1.0
-mportinit
-package require portrpm 1.0
-source ./library.tcl
-macports_worker_init
-
-
-test rpm_main {
- Rpm pkg unit test.
-} -constraints {
- ![catch {exec which rpmbuild}]
-} -setup {
- global os.platform os.major os.arch epoch destpath package.destpath configure.build_arch
- global subport version revision package.flat maintainers description categories
- global supported_archs portname porturl portdbpath workpath license
- env_init
-
-} -body {
- set mport [mportopen file://.]
- set workername [ditem_key $mport workername]
-
- #set res [$workername eval eval_targets rpm]
- #puts $res
-
- #if {![file exists /opt/local/src/macports/RPMS/x86_64/fondu-060102-1.x86_64.rpm]} {}
-
- return "Rpm pkg successful."
-} -result "Rpm pkg successful."
-
-
-# Covered by rpm_main
-# test make_dependency_list
-# test word_wrap
-# test write_spec
-
-cleanupTests
Deleted: branches/gsoc13-tests/src/package1.0/tests/portsrpm.test
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/portsrpm.test 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/portsrpm.test 2013-09-18 18:47:46 UTC (rev 111299)
@@ -1,45 +0,0 @@
-package require tcltest 2
-namespace import tcltest::*
-
-set pwd [file normalize $argv0]
-set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
-
-package require macports 1.0
-mportinit
-package require portsrpm 1.0
-source ./library.tcl
-macports_worker_init
-
-
-test srpm_main {
- Srpm pkg unit test.
-} -setup {
- if {[catch {exec which rpmbuild}] != 0} {
- return "FAIL: missing rpm package. try 'port install rpm'"
- }
-
- global os.platform os.major os.arch epoch destpath package.destpath configure.build_arch
- global subport version revision package.flat maintainers description categories
- global supported_archs portname porturl portdbpath portpath workpath distname filespath license
- env_init
-
- file mkdir $workpath
- file mkdir $portdbpath
-
-} -body {
- #set res [portsrpm::srpm_main]
-
- return "Srpm pkg successful."
-} -cleanup {
- file delete -force $workpath
- file delete -force $portdbpath
-} -result "Srpm pkg successful."
-
-
-# Covered by rpm_main
-# test srpm_pkg
-# test make_dependency_list
-# test word_wrap
-# test write_port_spec
-
-cleanupTests
Modified: branches/gsoc13-tests/src/package1.0/tests/test.tcl
===================================================================
--- branches/gsoc13-tests/src/package1.0/tests/test.tcl 2013-09-18 18:39:44 UTC (rev 111298)
+++ branches/gsoc13-tests/src/package1.0/tests/test.tcl 2013-09-18 18:47:46 UTC (rev 111299)
@@ -81,11 +81,16 @@
foreach test $test_suite {
set result [eval exec $tcl $test $arguments]
- set lastline [lindex [split $result "\n"] end]
+ set lastline [lindex [split $result "\n"] end]
if {[lrange [split $lastline "\t"] 1 1] != "Total"} {
- set lastline [lindex [split $result "\n"] end-2]
- set errmsg [lindex [split $result "\n"] end]
+ if {[lrange [split $lastline "\t"] 1 1] == ""} {
+ set lastline [lindex [split $result "\n"] 0]
+ set errmsg [lindex [split $result "\n"] 2]
+ } else {
+ set lastline [lindex [split $result "\n"] end-2]
+ set errmsg [lindex [split $result "\n"] end]
+ }
}
set splitresult [split $lastline "\t"]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130918/962cd858/attachment-0001.html>
More information about the macports-changes
mailing list