Ticket #33943: test-destroot-cmd-against-gmake.patch
File test-destroot-cmd-against-gmake.patch, 2.8 KB (added by j-macports@…, 13 years ago) |
---|
-
src/port1.0/portdestroot.tcl
92 92 proc portdestroot::destroot_getargs {args} { 93 93 if {(([option build.type] == "default" && [option os.platform] != "freebsd") || \ 94 94 ([option build.type] == "gnu")) \ 95 && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option build.cmd]]} {95 && [regexp "^(/\\S+/|)(g|gnu|)make(\\s+.*|)$" [option destroot.cmd]]} { 96 96 # Print "Entering directory" lines for better log debugging 97 97 return "-w [option destroot.target]" 98 98 } -
src/port1.0/tests/portdestroot.tcl
1 package require macports 2 mportinit 3 4 source [file dirname [info script]]/../portdestroot.tcl 5 source [file dirname [info script]]/common.tcl 6 7 namespace eval tests { 8 9 proc "when destroot cmd is not gmake no -w argument is added" {} { 10 global build.type build.cmd destroot.cmd destroot.target 11 12 set build.type "gnu" 13 set build.cmd "gmake" 14 set destroot.cmd "_destroot_cmd_" 15 set destroot.target "_target_" 16 17 test_equal {[portdestroot::destroot_getargs]} "_target_" 18 } 19 20 proc "when destroot cmd is gmake a -w argument is added" {} { 21 global build.type build.cmd destroot.cmd destroot.target 22 23 set build.type "gnu" 24 set build.cmd "_build_cmd_" 25 set destroot.cmd "gmake" 26 set destroot.target "_target_" 27 28 test_equal {[portdestroot::destroot_getargs]} "-w _target_" 29 } 30 31 32 # run all tests 33 foreach proc [info procs *] { 34 puts "* ${proc}" 35 $proc 36 } 37 38 # namespace eval tests 39 } -
src/port1.0/tests/common.tcl
1 proc test_equal {statement value} { 2 uplevel 1 "\ 3 puts -nonewline {checking if $statement == \"$value\"... } 4 if {\[catch { 5 set actual $statement 6 if {\$actual == \[subst {$value}\]} { \n\ 7 puts yes 8 } else { \n\ 9 puts \"no (was \$actual)\" \n\ 10 exit 1 \n\ 11 } \n\ 12 } msg\]} { \n\ 13 puts \"caught error: \$msg\" \n\ 14 exit 1 \n\ 15 }" 16 } 17 18 -
src/port1.0/Makefile
33 33 34 34 test:: 35 35 ${TCLSH} tests/portutil.tcl ${macports_tcl_dir} 36 ${TCLSH} tests/portdestroot.tcl