Opened 6 years ago

Last modified 6 years ago

#56016 new defect

make test uses the installed version of MacPorts, not the just-built one

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.4.99
Keywords: Cc: neverpanic (Clemens Lang)
Port:

Description

make test uses some combination of the already installed MacPorts and the just-built one. This can cause tests to fail if the installed version doesn't have the same capabilities as the built version.

For example, when I had MacPorts 2.4.2 installed, and then cloned master and ran ./configure and make and make test (without running sudo make install), the "Sed in place" test failed, saying it can't read "portutil::autoconf::sed_ext_flag": no such variable. portutil::autoconf::sed_ext_flag was removed in [209e78f57a3886d1091948c17948fcd4928c855c/macports-base] and no remnant of it remains in master, so it must have gotten that from the installed copy of MacPorts 2.4.2.

==== reinplace Reinplace  unit test. "Sed in place" functionality. FAILED
==== Contents of test case:

    reinplace s/Macports/MacPorts/1 $file
    catch {set f [open $file r]}
    set cont [read -nonewline $f]
    if { $cont != "MacPorts reinplace unit test?" } {
        return "FAIL: reinplace no args."
    }
    close $f

    reinplace -E s/test?/testing/1 $file
    catch {set f [open $file r]}
    set cont [read -nonewline $f]
    if { $cont != "MacPorts reinplace unit testing?" } {
        return "FAIL: reinplace (-E) extended regex."
    }
    close $f

    reinplace -W $second s/Macports/MP/1 file
    catch {set f [open $second/file r]}
    set cont [read -nonewline $f]
    if { $cont != "MP reinplace unit test?" } {
        return "FAIL: reinplace (-W) relative path."
    }
    close $f

    reinplace -n s/unit/testing/1 $file
    catch {set f [open $file r]}
    set cont [read -nonewline $f]
    if { $cont != "" } {
        return "FAIL: reinplace (-n) suppress output."
    }
    close $f

    return "Reinplace successful."


---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: can't read "portutil::autoconf::sed_ext_flag": no such variable
    while executing
"if {$portutil::autoconf::sed_ext_flag eq "N/A"} {
                ui_debug "sed extended regexp not available"
                return -code error "rei..."
    (procedure "reinplace" line 80)
    invoked from within
"reinplace -E s/test?/testing/1 $file"
    ("uplevel" body line 10)
    invoked from within
"uplevel 1 $script"
---- errorCode: NONE
==== reinplace FAILED

Change History (2)

comment:1 Changed 6 years ago by neverpanic (Clemens Lang)

Yes, I'm well aware of that. Unfortunately it's hard to test a non-installed version of MacPorts. I have not yet found a good solution.

comment:2 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

I figured we knew about it since the buildbot installs before testing.

Is there a way we could check in make test if make install has been run, and if not, error out an tell the user to install? Would be better than failing in weird ways.

Note: See TracTickets for help on using tickets.