From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:5530 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726043AbgHRJDh (ORCPT ); Tue, 18 Aug 2020 05:03:37 -0400 From: Marc Hartmayer Subject: Re: [kvm-unit-tests RFC v2 3/4] run_tests/mkstandalone: add arch dependent function to `for_each_unittest` In-Reply-To: <20200814132957.szwmbw6w26fhkroo@kamzik.brq.redhat.com> References: <20200812092705.17774-1-mhartmay@linux.ibm.com> <20200812092705.17774-4-mhartmay@linux.ibm.com> <20200813083000.e4bscohuhgl3jdv4@kamzik.brq.redhat.com> <87h7t51in7.fsf@linux.ibm.com> <20200814132957.szwmbw6w26fhkroo@kamzik.brq.redhat.com> Date: Tue, 18 Aug 2020 11:03:27 +0200 Message-ID: <87ft8k497k.fsf@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-s390-owner@vger.kernel.org List-ID: To: Andrew Jones , Marc Hartmayer Cc: kvm@vger.kernel.org, Thomas Huth , David Hildenbrand , Janosch Frank , Cornelia Huck , Paolo Bonzini , Christian Borntraeger , linux-s390@vger.kernel.org On Fri, Aug 14, 2020 at 03:29 PM +0200, Andrew Jones w= rote: > On Fri, Aug 14, 2020 at 03:06:36PM +0200, Marc Hartmayer wrote: >> On Thu, Aug 13, 2020 at 10:30 AM +0200, Andrew Jones wrote: >> > On Wed, Aug 12, 2020 at 11:27:04AM +0200, Marc Hartmayer wrote: >> >> This allows us, for example, to auto generate a new test case based on >> >> an existing test case. >> >>=20 >> >> Signed-off-by: Marc Hartmayer >> >> --- >> >> run_tests.sh | 2 +- >> >> scripts/common.bash | 13 +++++++++++++ >> >> scripts/mkstandalone.sh | 2 +- >> >> 3 files changed, 15 insertions(+), 2 deletions(-) >> >>=20 >> >> diff --git a/run_tests.sh b/run_tests.sh >> >> index 24aba9cc3a98..23658392c488 100755 >> >> --- a/run_tests.sh >> >> +++ b/run_tests.sh >> >> @@ -160,7 +160,7 @@ trap "wait; exit 130" SIGINT >> >> # preserve stdout so that process_test_output output can write TA= P to it >> >> exec 3>&1 >> >> test "$tap_output" =3D=3D "yes" && exec > /dev/null >> >> - for_each_unittest $config run_task >> >> + for_each_unittest $config run_task arch_cmd >> > >> > Let's just require that arch cmd hook be specified by the "$arch_cmd" >> > variable. Then we don't need to pass it to for_each_unittest. >>=20 >> Where is it then specified? > > Just using it that way in the source is enough. We should probably call > it $ARCH_CMD to indicate that it's a special variable. Also, we could > return it from a $(arch_cmd) function, which is how $(migration_cmd) and > $(timeout_cmd) work. My first approach was different=E2=80=A6 First we source the (common) functions that could be overridden by architecture dependent code, and then source the architecture dependent code. But I=E2=80=99m not sure which approach is cleaner - if you prefer yo= ur proposed solution with the global variables I can change it. Thanks for the feedback! [=E2=80=A6snip] --=20 Kind regards / Beste Gr=C3=BC=C3=9Fe Marc Hartmayer IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Gregor Pillen=20 Gesch=C3=A4ftsf=C3=BChrung: Dirk Wittkopp Sitz der Gesellschaft: B=C3=B6blingen Registergericht: Amtsgericht Stuttgart, HRB 243294