commit:     8e0e6163545ce31c7a59651fdab122b45e4b747c
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  6 14:17:22 2022 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Thu Oct  6 14:27:36 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e0e6163

dev-lang/boogie: enable tests

Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 dev-lang/boogie/boogie-2.15.8-r2.ebuild | 37 +++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/dev-lang/boogie/boogie-2.15.8-r2.ebuild 
b/dev-lang/boogie/boogie-2.15.8-r2.ebuild
index e1dc3d6dcd95..7324430f8146 100644
--- a/dev-lang/boogie/boogie-2.15.8-r2.ebuild
+++ b/dev-lang/boogie/boogie-2.15.8-r2.ebuild
@@ -13,12 +13,12 @@ SRC_URI="
        https://github.com/boogie-org/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
        https://dev.gentoo.org/~xgqt/distfiles/deps/${P}-deps.tar.xz
 "
-S="${S}"/Source
 
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="debug"
+IUSE="debug test"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
        dev-libs/icu
@@ -28,6 +28,12 @@ RDEPEND="
        ${BDEPEND}
        sci-mathematics/z3
 "
+BDEPEND+="
+       test? (
+               dev-python/lit
+               dev-python/OutputCheck
+       )
+"
 
 # Generated by dotnet.
 QA_PREBUILT="/usr/share/boogie/BoogieDriver"
@@ -40,10 +46,29 @@ src_prepare() {
        export NUGET_PACKAGES="${S}"/nuget_packages
 
        default
+
+       # Remove bad tests.
+       local bad_tests=(
+               civl/inductive-sequentialization/BroadcastConsensus.bpl
+               livevars/bla1.bpl
+               prover/cvc5.bpl
+               test0/MaxKeepGoingSplits.bpl
+               test15/CaptureInlineUnroll.bpl
+               test15/CaptureState.bpl
+               test15/CommonVariablesPruning.bpl
+       )
+       local bad_test
+       for bad_test in ${bad_tests[@]} ; do
+               rm "${S}"/Test/${bad_test} || die
+       done
+
+       # Update the boogieBinary variable.
+       sed "/^boogieBinary/s|= .*|= '${DOTNET_OUTPUT}/BoogieDriver.dll'|" \
+               -i "${S}"/Test/lit.site.cfg || die "failed to update 
lit.site.cfg"
 }
 
 src_configure() {
-       edob dotnet restore -p:TargetFramework=net${DOTNET_COMPAT}
+       edob dotnet restore -p:TargetFramework=net${DOTNET_COMPAT} "${S}"/Source
 }
 
 src_compile() {
@@ -56,7 +81,11 @@ src_compile() {
                -consoleLoggerParameters:ErrorsOnly
                -maxCpuCount:$(makeopts_jobs)
        )
-       edob dotnet build ${myopts[@]}
+       edob dotnet build ${myopts[@]} "${S}"/Source
+}
+
+src_test() {
+       lit "${S}"/Test || die "tests failed"
 }
 
 src_install() {

Reply via email to