public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code
@ 2020-05-02 17:02 Hanno Böck
  2020-05-02 17:31 ` David Seifert
  0 siblings, 1 reply; 3+ messages in thread
From: Hanno Böck @ 2020-05-02 17:02 UTC (permalink / raw
  To: gentoo-dev

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@gentoo.org>
---

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/


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code
  2020-05-02 17:02 [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code Hanno Böck
@ 2020-05-02 17:31 ` David Seifert
  2020-05-02 18:42   ` Hanno Böck
  0 siblings, 1 reply; 3+ messages in thread
From: David Seifert @ 2020-05-02 17:31 UTC (permalink / raw
  To: gentoo-dev

On Sat, 2020-05-02 at 19:02 +0200, Hanno Böck wrote:
> 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@gentoo.org>
> ---
> 
> 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"
>  }
>  
> 
> 

Please use proper bash brackets and shorten everything to

[[ ${1} == eunit ]] && local -x ERL_LIBS="."




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code
  2020-05-02 17:31 ` David Seifert
@ 2020-05-02 18:42   ` Hanno Böck
  0 siblings, 0 replies; 3+ messages in thread
From: Hanno Böck @ 2020-05-02 18:42 UTC (permalink / raw
  To: David Seifert; +Cc: gentoo-dev

On Sat, 02 May 2020 19:31:10 +0200
David Seifert <soap@gentoo.org> wrote:

> Please use proper bash brackets and shorten everything to
> 
> [[ ${1} == eunit ]] && local -x ERL_LIBS="."

Looks good, will do.

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-02 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-02 17:02 [gentoo-dev] [PATCH] rebar.eclass: Run tests with new code Hanno Böck
2020-05-02 17:31 ` David Seifert
2020-05-02 18:42   ` Hanno Böck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox