[u-boot-test-hooks PATCH 1/2] Create a common file for test scripts

Tom Rini trini at konsulko.com
Wed Jun 12 18:00:44 CEST 2024


On Tue, Jun 11, 2024 at 02:07:26PM -0600, Simon Glass wrote:
> Hi Tom,
> 
> On Tue, 11 Jun 2024 at 10:07, Tom Rini <trini at konsulko.com> wrote:
> >
> > On Mon, Jun 10, 2024 at 04:27:42PM -0600, Simon Glass wrote:
> >
> > > The top part of each of the u-boot-test-* files is common. Put it in
> > > a common script file to avoid duplication and to allow it to be
> > > replaced for the Labgrid integration.
> > >
> > > Signed-off-by: Simon Glass <sjg at chromium.org>
> > [snip]
> > > +++ b/bin/u-boot-test-common
> > [snip]
> > > +bin_dir="`dirname $0`"
> >
> > So we always set bin_dir here...
> >
> > > +board_type="$1"
> > > +board_ident="$2"
> > > +hostname="`hostname`"
> > > +
> > > +. "${bin_dir}/${hostname}/conf.${board_type}_${board_ident}"
> > > diff --git a/bin/u-boot-test-console b/bin/u-boot-test-console
> > > index 0b6b4ac..ad90040 100755
> > > --- a/bin/u-boot-test-console
> > > +++ b/bin/u-boot-test-console
> > > @@ -20,12 +20,7 @@
> > >  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> > >  # DEALINGS IN THE SOFTWARE.
> > >
> > > -set -e
> > > -
> > >  bin_dir="`dirname $0`"
> >
> > But never remove it from the other files.
> 
> Yes that was my intent, but then I realised that it is used in
> u-boot-test-console, then wasn't sure it was a win...
> 
> Perhaps I could do this in each script?
> 
> . "$(dirname $0)/u-boot-test-common"
> 
> and that would allow removing bin_dir. The above is pretty clear.

If that works, yes, otherwise just drop it from the common file.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240612/591f908e/attachment.sig>


More information about the U-Boot mailing list