[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] testsuite: Enable selection of tests using env var TESTS
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] testsuite: Enable selection of tests using env var TESTS |
Date: |
Thu, 13 Jan 2022 23:49:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Mohammad.
Thanks for the patch.
I like this, but this needs documentation in HACKING.
> This patch enables user to choose specific tests to run. Test harness
> selects tests based on pattern of TESTS environment variable.
>
> 2022-01-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
>
> * testsuite/lib/poke.exp (tests_pattern): New variable.
> (tests_pattern_pk): Likewise.
> * testsuite/poke.cmd/cmd.exp: Use `tests_pattern`.
> * testsuite/poke.map/map.exp: Likewise.
> * testsuite/poke.pickles/pickles.exp: Likewise.
> * testsuite/poke.pkl/pkl.exp: Likewise.
> * testsuite/poke.pktest/pktest.exp: Likewise.
> * testsuite/poke.std/std.exp: Likewise.
> * testsuite/poke.time/time.exp: Likewise.
> ---
> ChangeLog | 12 ++++++++++++
> testsuite/lib/poke.exp | 9 +++++++++
> testsuite/poke.cmd/cmd.exp | 2 +-
> testsuite/poke.map/map.exp | 2 +-
> testsuite/poke.pickles/pickles.exp | 2 +-
> testsuite/poke.pkl/pkl.exp | 2 +-
> testsuite/poke.pktest/pktest.exp | 2 +-
> testsuite/poke.std/std.exp | 2 +-
> testsuite/poke.time/time.exp | 2 +-
> 9 files changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 1cbbf1ae..d9d122ed 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,15 @@
> +2022-01-14 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
> +
> + * testsuite/lib/poke.exp (tests_pattern): New variable.
> + (tests_pattern_pk): Likewise.
> + * testsuite/poke.cmd/cmd.exp: Use `tests_pattern`.
> + * testsuite/poke.map/map.exp: Likewise.
> + * testsuite/poke.pickles/pickles.exp: Likewise.
> + * testsuite/poke.pkl/pkl.exp: Likewise.
> + * testsuite/poke.pktest/pktest.exp: Likewise.
> + * testsuite/poke.std/std.exp: Likewise.
> + * testsuite/poke.time/time.exp: Likewise.
> +
> 2022-01-13 Jose E. Marchesi <jemarch@gnu.org>
>
> * libpoke/libpoke.h (pk_array_elem_value): Rename from
> diff --git a/testsuite/lib/poke.exp b/testsuite/lib/poke.exp
> index ce7a2425..c911ac9d 100644
> --- a/testsuite/lib/poke.exp
> +++ b/testsuite/lib/poke.exp
> @@ -35,6 +35,15 @@ if ![info exists POKE] {
> set POKE ${objdir}/../poke/poke
> }
>
> +# Pattern for selection of tests.
> +
> +set tests_pattern {*.pk}
> +set tests_pattern_pk {*-test.pk}
> +if [info exists env(TESTS)] {
> + set tests_pattern $env(TESTS)
> + set tests_pattern_pk $env(TESTS)
> +}
> +
> # prompt is the poke prompt to expect from the program. As this can
> # change we can put it in a variable that can be easily modified later.
>
> diff --git a/testsuite/poke.cmd/cmd.exp b/testsuite/poke.cmd/cmd.exp
> index f160e69c..8a08b9d9 100644
> --- a/testsuite/poke.cmd/cmd.exp
> +++ b/testsuite/poke.cmd/cmd.exp
> @@ -18,5 +18,5 @@
>
> load_lib ${tool}-dg.exp
> dg-init
> -dg-runtest [lsort [glob -nocomplain $srcdir/poke.cmd/*.pk]] {} {}
> +dg-runtest [lsort [glob -nocomplain $srcdir/poke.cmd/$tests_pattern]] {} {}
> dg-finish
> diff --git a/testsuite/poke.map/map.exp b/testsuite/poke.map/map.exp
> index f9104f1a..6b300831 100644
> --- a/testsuite/poke.map/map.exp
> +++ b/testsuite/poke.map/map.exp
> @@ -18,5 +18,5 @@
>
> load_lib ${tool}-dg.exp
> dg-init
> -dg-runtest [lsort [glob -nocomplain $srcdir/poke.map/*.pk]] {} {}
> +dg-runtest [lsort [glob -nocomplain $srcdir/poke.map/$tests_pattern]] {} {}
> dg-finish
> diff --git a/testsuite/poke.pickles/pickles.exp
> b/testsuite/poke.pickles/pickles.exp
> index b0d70a58..902fdd20 100644
> --- a/testsuite/poke.pickles/pickles.exp
> +++ b/testsuite/poke.pickles/pickles.exp
> @@ -18,4 +18,4 @@
>
> load_lib "poke-pk.exp"
>
> -pk-runtest [lsort [glob -nocomplain $srcdir/poke.pickles/*-test.pk]]
> +pk-runtest [lsort [glob -nocomplain $srcdir/poke.pickles/$tests_pattern_pk]]
> diff --git a/testsuite/poke.pkl/pkl.exp b/testsuite/poke.pkl/pkl.exp
> index c4a7fbf4..9954c20f 100644
> --- a/testsuite/poke.pkl/pkl.exp
> +++ b/testsuite/poke.pkl/pkl.exp
> @@ -18,5 +18,5 @@
>
> load_lib ${tool}-dg.exp
> dg-init
> -dg-runtest [lsort [glob -nocomplain $srcdir/poke.pkl/*.pk]] {} {}
> +dg-runtest [lsort [glob -nocomplain $srcdir/poke.pkl/$tests_pattern]] {} {}
> dg-finish
> diff --git a/testsuite/poke.pktest/pktest.exp
> b/testsuite/poke.pktest/pktest.exp
> index da27b095..c6c3e7e3 100644
> --- a/testsuite/poke.pktest/pktest.exp
> +++ b/testsuite/poke.pktest/pktest.exp
> @@ -18,5 +18,5 @@
>
> load_lib ${tool}-dg.exp
> dg-init
> -dg-runtest [lsort [glob -nocomplain $srcdir/poke.pktest/*.pk]] {} {}
> +dg-runtest [lsort [glob -nocomplain $srcdir/poke.pktest/$tests_pattern]] {}
> {}
> dg-finish
> diff --git a/testsuite/poke.std/std.exp b/testsuite/poke.std/std.exp
> index ba0aae37..f26ad0b8 100644
> --- a/testsuite/poke.std/std.exp
> +++ b/testsuite/poke.std/std.exp
> @@ -18,4 +18,4 @@
>
> load_lib "poke-pk.exp"
>
> -pk-runtest [lsort [glob -nocomplain $srcdir/poke.std/*-test.pk]]
> +pk-runtest [lsort [glob -nocomplain $srcdir/poke.std/$tests_pattern_pk]]
> diff --git a/testsuite/poke.time/time.exp b/testsuite/poke.time/time.exp
> index e895f1bf..eb7b5b70 100644
> --- a/testsuite/poke.time/time.exp
> +++ b/testsuite/poke.time/time.exp
> @@ -18,5 +18,5 @@
>
> load_lib ${tool}-dg.exp
> dg-init
> -dg-runtest [lsort [glob -nocomplain $srcdir/poke.time/*.pk]] {} {}
> +dg-runtest [lsort [glob -nocomplain $srcdir/poke.time/$tests_pattern]] {} {}
> dg-finish