<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/ddc26554e6ed49ce8501069b967284739fa6d34e">https://github.com/macports/macports-base/commit/ddc26554e6ed49ce8501069b967284739fa6d34e</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new ddc26554e Add built-in test phase for all ports
</span>ddc26554e is described below
<span style='display:block; white-space:pre;color:#808000;'>commit ddc26554e6ed49ce8501069b967284739fa6d34e
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sun Jan 1 23:15:19 2023 +1100
<span style='display:block; white-space:pre;color:#404040;'> Add built-in test phase for all ports
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> For now, there's just one test, which checks that the files in the
</span><span style='display:block; white-space:pre;color:#404040;'> destroot have the archs that the port is supposed to be building for.
</span><span style='display:block; white-space:pre;color:#404040;'> More can be added in future.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Running 'port test' on a port that doesn't set 'test.run yes' will no
</span><span style='display:block; white-space:pre;color:#404040;'> longer error, but will run the built-in tests only. Ports that do set
</span><span style='display:block; white-space:pre;color:#404040;'> test.run will run both the built-in tests and the ones defined by the
</span><span style='display:block; white-space:pre;color:#404040;'> Portfile.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/45010
</span>---
src/port1.0/porttest.tcl | 80 ++++++++++++++++++++++++++++++--
tests/test/arch-test/DESCRIPTION | 5 ++
tests/test/arch-test/Portfile | 36 +++++++++++++++
tests/test/arch-test/test.tcl | 98 ++++++++++++++++++++++++++++++++++++++++
tests/test/library.tcl.in | 2 +
5 files changed, 217 insertions(+), 4 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/porttest.tcl b/src/port1.0/porttest.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index c8ce4b62f..a2e9e2c30 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/porttest.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/porttest.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4,17 +4,18 @@
</span> package provide porttest 1.0
package require portutil 1.0
package require portprogress 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+package require machista 1.0
</span>
set org.macports.test [target_new org.macports.test porttest::test_main]
target_provides ${org.macports.test} test
<span style='display:block; white-space:pre;background:#ffe0e0;'>-target_requires ${org.macports.test} main fetch checksum extract patch configure build
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+target_requires ${org.macports.test} main fetch checksum extract patch configure build destroot
</span> target_prerun ${org.macports.test} porttest::test_start
namespace eval porttest {
}
# define options
<span style='display:block; white-space:pre;background:#ffe0e0;'>-options test.run test.target
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+options test.run test.target test.ignore_archs
</span> commands test
# Set defaults
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -22,9 +23,77 @@ default test.dir {${build.dir}}
</span> default test.cmd {${build.cmd}}
default test.pre_args {${test.target}}
default test.target test
<span style='display:block; white-space:pre;background:#e0ffe0;'>+default test.ignore_archs no
</span>
set_ui_prefix
<span style='display:block; white-space:pre;background:#e0ffe0;'>+proc porttest::get_file_archs {handle fpath} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set resultlist [machista::parse_file $handle $fpath]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set returncode [lindex $resultlist 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set result [lindex $resultlist 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$returncode != $machista::SUCCESS} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # fails on static libs, ignore
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$returncode != $machista::EMAGIC} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_warn "Error parsing file ${fpath}: [machista::strerror $returncode]"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return ""
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set ret [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set architecture [$result cget -mt_archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while {$architecture ne "NULL"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend ret [machista::get_arch_name [$architecture cget -mat_arch]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set architecture [$architecture cget -next]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $ret
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc porttest::test_archs {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[option os.platform] ne "darwin" || [option test.ignore_archs]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set handle [machista::create_handle]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$handle eq "NULL"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error "Error creating libmachista handle"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ array set file_archs {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set destrootlen [string length [option destroot]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ fs-traverse -depth fullpath [list [option destpath]] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[file type $fullpath] ne "file"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[fileIsBinary $fullpath]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set archs [get_file_archs $handle $fullpath]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$archs ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # not guaranteed to be listed in canonical order
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend file_archs([lsort -ascii $archs]) [string range $fullpath $destrootlen end]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set wanted_archs [get_canonical_archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set has_wanted_archs [info exists file_archs($wanted_archs)]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ unset -nocomplain file_archs($wanted_archs)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[array names file_archs] ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set msg "[option name] is configured to build "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$wanted_archs eq "noarch"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append msg "no architecture-specific files,"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append msg "for the architecture(s) '$wanted_archs',"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append msg " but installed Mach-O files built for the following archs:\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach a [array names file_archs] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append msg [join $a ,]:\n
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach f $file_archs($a) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append msg " $f\n"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_warn $msg
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {$wanted_archs ne "noarch" && !${has_wanted_archs}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ui_warn "[option name] is configured to build for the architecture(s) '$wanted_archs',\
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ but did not install any Mach-O files."
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ machista::destroy_handle $handle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> proc porttest::test_start {args} {
global UI_PREFIX subport
ui_notice "$UI_PREFIX [format [msgcat::mc "Testing %s"] ${subport}]"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,10 +101,13 @@ proc porttest::test_start {args} {
</span>
proc porttest::test_main {args} {
global subport test.run
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # built-in tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ porttest::test_archs
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # tests defined by the Portfile
</span> if {[tbool test.run]} {
command_exec -callback portprogress::target_progress_callback test
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- return -code error [format [msgcat::mc "%s has no tests turned on. see 'test.run' in portfile(7)"] $subport]
</span> }
return 0
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/arch-test/DESCRIPTION b/tests/test/arch-test/DESCRIPTION
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..125d3fdaa
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tests/test/arch-test/DESCRIPTION
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+This test checks that the architecture checks in the test phase work
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+correctly. The portfile is tested with each combination of its
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variants, which make it declare itself noarch and install no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+architecture-specific files. Two combinations should produce warnings,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+the other two should not.
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/arch-test/Portfile b/tests/test/arch-test/Portfile
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..49920bb9e
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tests/test/arch-test/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,36 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+PortSystem 1.0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+name arch-test
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+version 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+categories test
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+maintainers nomaintainer
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+description Test port for architecture tests
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+homepage https://www.macports.org/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.cxx_stdlib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+long_description {*}${description}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+distfiles
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+use_configure no
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant declare_noarch description {Declare the port noarch} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ supported_archs noarch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant be_noarch description {Install noarch files} {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {[variant_isset be_noarch]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system "touch ${destroot}${prefix}/share/${name}"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ build {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${workpath} "echo 'int main(void) { return 0; }' > exe.c"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ system -W ${workpath} "${configure.cc} ${configure.cc_archflags} -o exe exe.c"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ destroot {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ xinstall ${workpath}/exe ${destroot}${prefix}/bin/exe
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/tests/test/arch-test/test.tcl b/tests/test/arch-test/test.tcl
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 000000000..edac9ef0d
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tests/test/arch-test/test.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,98 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+package require tcltest 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+namespace import tcltest::*
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+source [file dirname $argv0]/../library.tcl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+makeFile "" $output_file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+makeDirectory $work_dir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set path [file dirname [file normalize $argv0]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Initial setup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+load_variables $path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set_dir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+port_index
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc noarch_good_test {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global output_file path portsrc bindir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port_clean $path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set string "export PORTSRC=${portsrc}; "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append string "${bindir}/port -q test +declare_noarch +be_noarch"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exec -ignorestderr sh -c $string > /dev/null 2> $output_file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set line [get_line $path/$output_file "*Mach-O files*"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $line
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc noarch_bad_test {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global output_file path portsrc bindir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port_clean $path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set string "export PORTSRC=${portsrc}; "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append string "${bindir}/port -q test +declare_noarch"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exec -ignorestderr sh -c $string > /dev/null 2> $output_file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set line [get_line $path/$output_file "*Mach-O files*"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $line
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc arch_good_test {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global output_file path portsrc bindir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port_clean $path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set string "export PORTSRC=${portsrc}; "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append string "${bindir}/port -q test"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exec -ignorestderr sh -c $string > /dev/null 2> $output_file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set line [get_line $path/$output_file "*Mach-O files*"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $line
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc arch_bad_test {} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ global output_file path portsrc bindir
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port_clean $path
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set string "export PORTSRC=${portsrc}; "
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ append string "${bindir}/port -q test +be_noarch"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ exec -ignorestderr sh -c $string > /dev/null 2> $output_file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set line [get_line $path/$output_file "*Mach-O files*"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return $line
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+test envvariables {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Regression test for architecture mismatch tests.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} -body {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set output [noarch_good_test]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$output != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "correct noarch port got warning:"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "fail"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set output [noarch_bad_test]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$output == -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "port mislabelled as noarch got no warning"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "fail"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set output [arch_good_test]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$output != -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "correct non-noarch port got warning:"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $output
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "fail"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set output [arch_bad_test]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$output == -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "port incorrectly not labelled as noarch got no warning"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "fail"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "ok"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} -result "ok"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cleanup
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cleanupTests
</span><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 714f4d21e..a395e0df0 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;'>@@ -142,6 +142,7 @@ proc port_uninstall {{name "current"}} {
</span> # from a given file, or -1 if nothing is found.
proc get_line {filename lookup} {
set fp [open $filename r]
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set lookup [string tolower $lookup]
</span>
while {[gets $fp line] != -1} {
set line [string tolower $line]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -151,6 +152,7 @@ proc get_line {filename lookup} {
</span> return $line
}
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ close $fp
</span> return -1
}
</pre><pre style='margin:0'>
</pre>