Changeset 111299


Ignore:
Timestamp:
Sep 18, 2013, 6:47:46 PM (7 years ago)
Author:
marius@…
Message:

package1.0: use correct macports_fastload.tcl file; added package_test_autoconf file

Location:
branches/gsoc13-tests
Files:
1 added
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • branches/gsoc13-tests/configure

    r111105 r111299  
    1010810108
    1010910109# Output
    10110 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"
     10110ac_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"
    1011110111
    1011210112
     
    1082110821    "src/port1.0/port_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/port1.0/port_autoconf.tcl" ;;
    1082210822    "src/port1.0/port_test_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/port1.0/port_test_autoconf.tcl" ;;
     10823    "src/package1.0/package_test_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/package1.0/package_test_autoconf.tcl" ;;
    1082310824    "src/registry2.0/registry_autoconf.tcl") CONFIG_FILES="$CONFIG_FILES src/registry2.0/registry_autoconf.tcl" ;;
    1082410825    "src/programs/Makefile") CONFIG_FILES="$CONFIG_FILES src/programs/Makefile" ;;
  • branches/gsoc13-tests/configure.ac

    r111105 r111299  
    404404        src/port1.0/port_autoconf.tcl
    405405        src/port1.0/port_test_autoconf.tcl
     406        src/package1.0/package_test_autoconf.tcl
    406407        src/registry2.0/registry_autoconf.tcl
    407408        src/programs/Makefile
  • branches/gsoc13-tests/src/package1.0/tests/portarchivefetch.test

    r110590 r111299  
    55set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
    66
     7source ../package_test_autoconf.tcl
     8source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
     9package require macports 1.0
    710
    8 package require macports 1.0
    9 mportinit
     11array set ui_options {}
     12#set ui_options(ports_debug)   yes
     13#set ui_options(ports_verbose) yes
     14mportinit ui_options
     15
    1016source ./library.tcl
    1117macports_worker_init
    1218
    13 #source ../../port1.0/port_autoconf.tcl
    14 #set portutil::autoconf::openssl_path "/usr/bin/openssl"
    1519package require portarchivefetch 1.0
    16 #source ../portarchivefetch.tcl
    1720namespace eval portutil {
    1821    namespace eval autoconf {
    19         variable openssl_path "/usr/bin/openssl"
     22        variable openssl_path "/usr/bin/openssl"
    2023    }
    2124}
     
    3437} -body {
    3538    if {[portarchivefetch::filter_sites] != "http://www.fondu.sourceforge.net/:tgz"} {
    36         return "FAIL: couldn't fetch file"
     39        return "FAIL: couldn't fetch file"
    3740    }
    3841
     
    5659} -body {
    5760    if {[catch {portarchivefetch::checkarchivefiles $urls}] != 0} {
    58         return "FAIL: cannot run checkarchivefiles"
     61        return "FAIL: cannot run checkarchivefiles"
    5962    }
    6063    if {[lindex $all_archive_files 0] != "fondu-060102_1var1.darwin_9.noarch.zip"} {
    61         return "FAIL: invalid archive file name"
     64        return "FAIL: invalid archive file name"
    6265    }
    6366    if {[lindex $all_archive_files 1] != "fondu-060102_1var1.darwin_9.noarch.tgz"} {
    64         return "FAIL: invalid archive file name"
     67        return "FAIL: invalid archive file name"
    6568    }
    6669    return "Check archive files successful."
     
    7376
    7477test fetchfiles {
    75     Fetch files unit test. Fails to verify signature.
     78    Fetch files unit test.
     79} -constraints {
     80    root
    7681} -setup {
    7782    global os.platform os.major os.arch epoch destpath package.destpath configure.build_arch
     
    8186
    8287    array set ::portfetch::urlmap {
    83         fondu http://packages.macports.org/fondu/
    84         archive_sites www.google.com
     88        fondu http://packages.macports.org/fondu/
    8589    }
    8690    set portarchivefetch::archivefetch_urls {fondu fondu-060102_1.darwin_12.x86_64.tbz2}
     91    set target_state_fd [open $pwd/target w+]
     92
     93    set mport [mportopen file://.]
     94    set workername [ditem_key $mport workername]
     95    set macportsuser macports
    8796
    8897} -body {
    89     set macportsuser macports
     98    set archivefetch.pubkeys $pwd
     99    if {[catch {portarchivefetch::fetchfiles}] != 0} {
     100        return "FAIL: cannot fetch archive"
     101    }
     102    if {[file exists ${archivefetch.fulldestpath}/fondu-060102_1.darwin_12.x86_64.tbz2]} {
     103        return "FAIL: unverified archive not discarded"
     104    }
     105
     106    set archivefetch.pubkeys ${macports::prefix}/share/macports/macports-pubkey.pem
    90107    if {[portarchivefetch::fetchfiles] != 0} {
    91         return "FAIL: cannot fetch port"
     108        return "FAIL: cannot fetch archive"
    92109    }
    93     #if {![file exists ${archivefetch.fulldestpath}/fondu_src-060102.tgz.TMP]} {
    94         #return "FAIL: missing fetched archive"
    95     #}
    96     #if {![file exists ${archivefetch.fulldestpath}/fondu_src-060102.tgz.rmd160]} {
    97         #return "FAIL: missing fetched archive rmd"
    98     #}
     110    if {![file exists ${archivefetch.fulldestpath}/fondu-060102_1.darwin_12.x86_64.tbz2]} {
     111        return "FAIL: verified archive deleted"
     112    }
     113
    99114    return "Fetch files successful."
    100115
    101116} -cleanup {
     117    close $target_state_fd
     118        file delete -force $target_state_fd
     119    mportclose $mport
    102120    file delete -force $portdbpath
    103121
  • branches/gsoc13-tests/src/package1.0/tests/portdmg.test

    r108985 r111299  
    55set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
    66
     7source ../package_test_autoconf.tcl
     8source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    79package require macports 1.0
    8 mportinit
     10
     11array set ui_options {}
     12#set ui_options(ports_debug)   yes
     13#set ui_options(ports_verbose) yes
     14mportinit ui_options
     15
     16source ./library.tcl
     17macports_worker_init
    918
    1019source ../portdmg.tcl
    1120source ../../port1.0/port_autoconf.tcl
    12 source ./library.tcl
    13 
    14 macports_worker_init
    1521
    1622
  • branches/gsoc13-tests/src/package1.0/tests/portdpkg.test

    r110590 r111299  
    55set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
    66
     7source ../package_test_autoconf.tcl
     8source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    79package require macports 1.0
    8 mportinit
     10
     11array set ui_options {}
     12#set ui_options(ports_debug)   yes
     13#set ui_options(ports_verbose) yes
     14mportinit ui_options
     15
     16source ./library.tcl
     17macports_worker_init
    918
    1019source ../portdpkg.tcl
    1120source ../../port1.0/port_autoconf.tcl
    12 source ./library.tcl
    13 
    14 macports_worker_init
    1521
    1622
    1723test main {
    1824    Port dpkg main unit test.
    19 } -constraints {
    20     [catch {exec which dpkg-deb}] == 0
     25} -constraints { ![catch {exec which dpkg-deb}]
     26
    2127} -setup {
    2228    set os.platform darwin
     
    4046} -body {
    4147    if {[catch {portdpkg::main}] != 0} {
    42         return "FAIL: cannot create dmg"
     48                return "FAIL: cannot create dmg"
    4349    }
    4450    if {![file exists $pwd/pkg/fondu_060102-1_all.deb]} {
    45         return "FAIL: missing .deb file"
     51                return "FAIL: missing .deb file"
    4652    }
    4753    return "Package deb successful."
     
    6066    set revision 1
    6167} -body {
    62     if {[portdpkg::make_dependency_list $subport] != "fondu/060102"} {
    63         return "FAIL: could not make dependency list"
     68    if {[portdpkg::make_dependency_list $subport] != ""} {
     69                return "FAIL: could not make dependency list"
    6470    }
    6571    return "Make dependency list successful."
  • branches/gsoc13-tests/src/package1.0/tests/portmdmg.test

    r108985 r111299  
    55set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
    66
     7source ../package_test_autoconf.tcl
     8source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    79package require macports 1.0
    8 mportinit
     10
     11array set ui_options {}
     12#set ui_options(ports_debug)   yes
     13#set ui_options(ports_verbose) yes
     14mportinit ui_options
     15
     16source ./library.tcl
     17macports_worker_init
    918
    1019source ../portmdmg.tcl
    1120source ../portmpkg.tcl
    1221source ../../port1.0/port_autoconf.tcl
    13 source ./library.tcl
    14 
    15 macports_worker_init
    1622
    1723
     
    3743} -body {
    3844    if {[portmdmg::package_mdmg $subport $portepoch $version $revision] != 0} {
    39         return "FAIL: cannot create mdmg"
     45                return "FAIL: cannot create mdmg"
    4046    }
    4147    if {![file exists $pwd/pkg/fondu-060102-1.dmg]} {
    42         return "FAIL: missing .dmg file"
     48                return "FAIL: missing .dmg file"
    4349    }
    4450    if {![file exists $pwd/pkg/fondu-060102-1/fondu-i386_060102_1.mpkg]} {
    45         return "FAIL: invalid package.destpath"
     51                return "FAIL: invalid package.destpath"
    4652    }
    4753    return "Package dmg successful."
  • branches/gsoc13-tests/src/package1.0/tests/portmpkg.test

    r108985 r111299  
    55set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
    66
     7source ../package_test_autoconf.tcl
     8source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    79package require macports 1.0
    8 mportinit
     10
     11array set ui_options {}
     12#set ui_options(ports_debug)   yes
     13#set ui_options(ports_verbose) yes
     14mportinit ui_options
     15
     16source ./library.tcl
     17macports_worker_init
     18
    919package require portmpkg 1.0
    1020package require portpkg 1.0
    11 source ./library.tcl
    12 macports_worker_init
    1321
    1422
     
    2634} -body {
    2735    if {[portmpkg::mpkg_main] != 0} {
    28         return "FAIL: cannot create pkg"
     36                return "FAIL: cannot create pkg"
    2937    }
    3038    if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/PkgInfo]} {
    31         return "FAIL: missing PkgInfo file"
     39                return "FAIL: missing PkgInfo file"
    3240    }
    3341    if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/Info.plist]} {
    34         return "FAIL: missing Info.plist file"
     42                return "FAIL: missing Info.plist file"
    3543    }
    3644    if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/Resources]} {
    37         return "FAIL: missing Resources dir"
     45                return "FAIL: missing Resources dir"
    3846    }
    3947    if {![file exists $destpath/fondu-1_060102_1.mpkg/Contents/Packages/fondu-1_060102_1.pkg]} {
    40         return "FAIL: missing pkg file"
     48                return "FAIL: missing pkg file"
    4149    }
    4250    return "Package mpkg successful."
     
    6068    set res [portmpkg::make_dependency_list $subport $destination]
    6169    if { $res != "{fondu 0 060102 1 ditem_4}" } {
    62         return "FAIL: invalid dependency list"
     70                return "FAIL: invalid dependency list"
    6371    }
    6472    return "Dependency list successful."
  • branches/gsoc13-tests/src/package1.0/tests/portpkg.test

    r108985 r111299  
    55set pwd [eval file join {*}[lrange [file split $pwd] 0 end-1]]
    66
     7source ../package_test_autoconf.tcl
     8source $macports::autoconf::macports_tcl_dir/macports1.0/macports_fastload.tcl
    79package require macports 1.0
    8 mportinit
     10
     11array set ui_options {}
     12#set ui_options(ports_debug)   yes
     13#set ui_options(ports_verbose) yes
     14mportinit ui_options
     15
     16source ./library.tcl
     17macports_worker_init
     18
    919package require portmpkg 1.0
    1020package require portpkg 1.0
    11 source ./library.tcl
    12 macports_worker_init
    1321
    1422
  • branches/gsoc13-tests/src/package1.0/tests/test.tcl

    r110590 r111299  
    8282    foreach test $test_suite {
    8383        set result [eval exec $tcl $test $arguments]
    84         set lastline [lindex [split $result "\n"] end]
     84                set lastline [lindex [split $result "\n"] end]
    8585
    8686        if {[lrange [split $lastline "\t"] 1 1] != "Total"} {
    87             set lastline [lindex [split $result "\n"] end-2]
    88             set errmsg [lindex [split $result "\n"] end]
     87                if {[lrange [split $lastline "\t"] 1 1] == ""} {
     88                        set lastline [lindex [split $result "\n"] 0]
     89                set errmsg [lindex [split $result "\n"] 2]
     90                } else {
     91                set lastline [lindex [split $result "\n"] end-2]
     92                set errmsg [lindex [split $result "\n"] end]
     93                }
    8994        }
    9095
Note: See TracChangeset for help on using the changeset viewer.