Skip to content

Commit

Permalink
meson: enable test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
kencu committed Feb 24, 2019
1 parent 26de0bb commit 03bd08a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions devel/meson/Portfile
Expand Up @@ -50,3 +50,27 @@ post-destroot {
ln -s ${python_prefix}/bin/meson ${destroot}${prefix}/bin/meson
ln -s ${python_prefix}/share/man/man1/meson.1 ${destroot}${prefix}/share/man/man1
}

# the following block avoids requiring users to 'sudo port select python3 python37'
# doing a file test for ${prefix}/bin/python3 and requiring this
# to be honest would have been much simpler, but not the "MacPorts way"
pre-test {
reinplace "s|/usr/bin/env python3|/usr/bin/env python3.7|" \
${worksrcpath}/run_tests.py \
${worksrcpath}/run_cross_test.py \
${worksrcpath}/run_meson_command_tests.py \
${worksrcpath}/run_project_tests.py \
${worksrcpath}/run_unittests.py

set testpath "${worksrcpath}/test\\ cases"
fs-traverse f ${testpath} {
if { [string match *.py ${f}] } {
reinplace "s|/usr/bin/env python3|/usr/bin/env python3.7|" ${f}
}
}
}

test.run yes
test.env-append configure.env{*}
test.cmd ./run_tests.py
test.target

0 comments on commit 03bd08a

Please sign in to comment.