<pre style='margin:0'>
Rainer Müller (raimue) pushed a commit to branch release-2.4
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/4a9604b66827e8c6cf08cef941fe9b44d424c6c8">https://github.com/macports/macports-base/commit/4a9604b66827e8c6cf08cef941fe9b44d424c6c8</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 4a9604b66827e8c6cf08cef941fe9b44d424c6c8
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Mon Mar 12 17:00:41 2018 +0100
<span style='display:block; white-space:pre;color:#404040;'> tests: Fix test failure due to missing SVN command
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Remove the dependency on the SVN command for the svn-and-patchsites
</span><span style='display:block; white-space:pre;color:#404040;'> regression test by setting svn.cmd to true.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Additionally, do not fetch vim patchfiles from a remote location, but
</span><span style='display:block; white-space:pre;color:#404040;'> just use a file:// URL for the patchfiles.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Refactor the test to show the error output immediately if it fails,
</span><span style='display:block; white-space:pre;color:#404040;'> rather than a string indicating that there was an error without the
</span><span style='display:block; white-space:pre;color:#404040;'> actual output.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> (cherry picked from commit ea77eb50b06f009629afb95321f0d5cd932c070b)
</span>---
tests/test/library.tcl.in | 4 ----
tests/test/svn-and-patchsites/Portfile | 25 ++++++++++---------------
tests/test/svn-and-patchsites/patch | 0
tests/test/svn-and-patchsites/test.tcl | 25 ++++++++++---------------
4 files changed, 20 insertions(+), 34 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/library.tcl.in b/tests/test/library.tcl.in
</span><span style='display:block; white-space:pre;color:#808080;'>index 21f843e..e06a748 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tests/test/library.tcl.in
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tests/test/library.tcl.in
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,10 +9,6 @@ set work_dir "work"
</span> # constraint indicating whether the platform supports trace mode
::tcltest::testConstraint tracemode_support [expr {@TRACEMODE_SUPPORT@ != 0}]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# constraint for tests that use svn
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# system svn can't be used on darwin < 10
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-::tcltest::testConstraint has_svn [expr {"@SVN@" ne "" && (@OS_MAJOR@ >= 10 || "@OS_PLATFORM@" ne "darwin")}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> # Set of procs used for testing.
# Sets $bindir variable from autoconf
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/svn-and-patchsites/Portfile b/tests/test/svn-and-patchsites/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 793d1dc..41abb2a 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tests/test/svn-and-patchsites/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tests/test/svn-and-patchsites/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -13,22 +13,17 @@ homepage https://www.macports.org/
</span> description Test port for svn+distant patchfiles functionalities
long_description ${description}
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# use a MacPorts svn URL so we don't ping a remote SVN server every time the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# tests are run
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# taken from the mpvim port
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Set svn.cmd to true to avoid a dependency on the SVN binary, reset
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# depends_fetch to avoid the automatically added SVN dependency
</span> fetch.type svn
<span style='display:block; white-space:pre;background:#ffe0e0;'>-svn.url https://svn.macports.org/repository/macports/contrib/mpvim
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# use a MacPorts distfiles server to avoid hitting a remote server every time
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# the tests are run (and possibly causing failures when the server is down)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# taken from the vim port
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patch_sites http://distfiles.macports.org/vim/7.4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles 7.4.001 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 7.4.002 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 7.4.003
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums 7.4.001 md5 f234692c9ab5265ba6ba6f55c0f81764 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 7.4.002 md5 a03e1a5ad3722f2011751dda977641af \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 7.4.003 md5 e6d070f592bb6da4d8cf2f7f134425e5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+svn.cmd true
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+svn.url file://[pwd]/svn/repository
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+depends_fetch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Use a local file to avoid hitting the network
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patch_sites file://[pwd]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums patch md5 d41d8cd98f00b204e9800998ecf8427e
</span>
# disable the patch phase because the patches would never apply
patch {}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/svn-and-patchsites/patch b/tests/test/svn-and-patchsites/patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..e69de29
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/svn-and-patchsites/test.tcl b/tests/test/svn-and-patchsites/test.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 7eee8c1..9533d78 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tests/test/svn-and-patchsites/test.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tests/test/svn-and-patchsites/test.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,4 +1,5 @@
</span> package require tcltest 2
<span style='display:block; white-space:pre;background:#e0ffe0;'>+package require lambda
</span> namespace import tcltest::*
source [file dirname $argv0]/../library.tcl
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -6,27 +7,21 @@ set path [file dirname [file normalize $argv0]]
</span>
initial_setup
<span style='display:block; white-space:pre;background:#ffe0e0;'>-proc svn-patch {} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- global output_file path
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set svn "error*"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set line [get_line $path/$output_file $svn]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$line == -1} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return "No error found."
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set ret "Errors found in output file:\n"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- append ret [exec -ignorestderr cat $path/$output_file]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return $ret
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+customMatch notGlob [lambda {needle haystack} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts "string match -nocase $needle"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[string match -nocase $needle $haystack]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}]
</span>
test svn-patchsites {
Regression test for svn-and-patchsites.
} -constraints {
has_svn
} -body {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- svn-patch
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-} -result "No error found."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return [exec -ignorestderr cat $path/$output_file]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} -result "error*" -match notGlob
</span>
cleanup
</pre><pre style='margin:0'>
</pre>