Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Mock getportresourcepath for portmpkg.test
  • Loading branch information
jmroot committed Feb 16, 2017
1 parent c340033 commit 90893e5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/package1.0/tests/portmpkg.test
Expand Up @@ -18,6 +18,11 @@ package require portpkg 1.0
source ./library.tcl
macports_worker_init

# mock getportresourcepath, tests should be able to operate without a ports tree
proc getportresourcepath {url {path {}} {fallback yes}} {
global pwd
return [file join $pwd $path]
}

test mpkg_main {
Port mpkg main unit test.
Expand All @@ -26,12 +31,13 @@ test mpkg_main {
} -setup {
global os.platform os.major os.arch destpath package.destpath configure.build_arch \
subport version revision package.flat maintainers description categories \
supported_archs porturl
supported_archs porturl pwd
env_init

file mkdir $destpath
close [open $destpath/fondu-060102_1.pkg w+]

file mkdir ${pwd}/port1.0/package
close [open ${pwd}/port1.0/package/background.tiff w+]
} -body {
if {[portmpkg::mpkg_main] != 0} {
return "FAIL: cannot create pkg"
Expand All @@ -52,7 +58,8 @@ test mpkg_main {

} -cleanup {
file delete -force $destpath

global pwd
file delete -force ${pwd}/port1.0
} -result "Package mpkg successful."


Expand Down

0 comments on commit 90893e5

Please sign in to comment.