Changeset 146710 for trunk/base


Ignore:
Timestamp:
Mar 15, 2016, 4:53:03 PM (4 years ago)
Author:
raimue@…
Message:

macports1.0/tests: Move initialization of custom prefix to library

Location:
trunk/base/src/macports1.0/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/macports1.0/tests/library.tcl

    r111468 r146710  
    6464    # automatically handled correctly.
    6565}
     66
     67# Set up a custom environment with its own configuration
     68proc init_tmp_prefix {srcpath dstpath} {
     69    global env
     70
     71    # use custom macports.conf and sources.conf
     72    makeDirectory $dstpath
     73    makeDirectory $dstpath/share
     74    makeDirectory $dstpath/var/macports/registry
     75    set fd [open $dstpath/macports.conf w+]
     76    puts $fd "portdbpath $dstpath/var/macports"
     77    puts $fd "prefix $dstpath"
     78    puts $fd "variants_conf $dstpath/variants.conf"
     79    puts $fd "sources_conf $srcpath/sources.conf"
     80    puts $fd "applications_dir $dstpath/Applications"
     81    puts $fd "frameworks_dir $dstpath/Library/Frameworks"
     82    close $fd
     83    file link -symbolic $dstpath/share/macports $macports::autoconf::prefix/share/macports
     84    close [open $dstpath/variants.conf w+]
     85
     86    set env(PORTSRC) $dstpath/macports.conf
     87}
  • trunk/base/src/macports1.0/tests/macports.test

    r146696 r146710  
    1313
    1414package require macports 1.0
     15package require Thread
     16
     17source ./library.tcl
    1518
    1619# clean leftovers from interrupted tests
    1720file delete -force $pwd/tmpdir
    18 
    19 # use custom macports.conf and sources.conf
    20 makeDirectory $pwd/tmpdir
    21 makeDirectory $pwd/tmpdir/share
    22 makeDirectory $pwd/tmpdir/var/macports/registry
    23 set fd [open $pwd/tmpdir/macports.conf w+]
    24 puts $fd "portdbpath $pwd/tmpdir/var/macports"
    25 puts $fd "prefix $pwd/tmpdir"
    26 puts $fd "variants_conf $pwd/tmpdir/variants.conf"
    27 puts $fd "sources_conf $pwd/sources.conf"
    28 puts $fd "applications_dir $pwd/tmpdir/Applications"
    29 puts $fd "frameworks_dir $pwd/tmpdir/Library/Frameworks"
    30 close $fd
    31 set env(PORTSRC) $pwd/tmpdir/macports.conf
    32 file link -symbolic $pwd/tmpdir/share/macports $macports::autoconf::prefix/share/macports
    33 close [open $pwd/tmpdir/variants.conf w+]
     21# use a local, temporary prefix for testing
     22init_tmp_prefix $pwd $pwd/tmpdir
    3423
    3524# Debug options
     
    3827#set ui_options(ports_verbose) yes
    3928mportinit ui_options
    40 
    41 package require Thread
    42 source ./library.tcl
    4329
    4430
Note: See TracChangeset for help on using the changeset viewer.