Gentoo Archives: gentoo-dev

From: "Hanno Böck" <hanno@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code
Date: Sat, 02 May 2020 17:03:47
Message-Id: 20200502190256.44e108fb@computer
Due to an update of dev-erlang/fast_tls I noticed an issue in the rebar
eclass with tests.

It seems the way the eclass currently works it is running tests with
the library installed in the system, not the code just compiled.

This is obviously not what we want and it also obviously can fail if
the new tests use features that aren't present in the old version in
the system.

The patch below fixes this and runs tests with libs from the current
directory.

Closes: https://bugs.gentoo.org/720448
Signed-off-by: Hanno Böck <hanno@g.o>
---

diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass
index 92dd16b08..f9849f0ff 100644
--- a/eclass/rebar.eclass
+++ b/eclass/rebar.eclass
@@ -105,6 +105,9 @@ erebar() {
 	(( $# > 0 )) || die "erebar: at least one target is required"
 
 	local -x ERL_LIBS="${EPREFIX}$(get_erl_libs)"
+	if [ "$1" = "eunit" ]; then
+		local -x ERL_LIBS="."
+	fi
 	rebar -v skip_deps=true "$@" || die -n "rebar $@ failed"
 }
 


-- 
Hanno Böck
https://hboeck.de/

Replies

Subject Author
Re: [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code David Seifert <soap@g.o>