On 14/10/2020 21.14, Andrew Jones wrote: > If we don't save BASH_REMATCH before calling another function, > and that other function also uses [[...]], then we'll lose the > test. > > Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx> > --- > scripts/common.bash | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/scripts/common.bash b/scripts/common.bash > index a6044b7c6c35..7b983f7d6dd6 100644 > --- a/scripts/common.bash > +++ b/scripts/common.bash > @@ -13,15 +13,17 @@ function for_each_unittest() > local check > local accel > local timeout > + local rematch > > exec {fd}<"$unittests" > > while read -r -u $fd line; do > if [[ "$line" =~ ^\[(.*)\]$ ]]; then > + rematch=${BASH_REMATCH[1]} > if [ -n "${testname}" ]; then > $(arch_cmd) "$cmd" "$testname" "$groups" "$smp" "$kernel" "$opts" "$arch" "$check" "$accel" "$timeout" > fi > - testname=${BASH_REMATCH[1]} > + testname=$rematch > smp=1 > kernel="" > opts="" > Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>