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

Simon Glass sjg at chromium.org
Tue Jun 11 22:07:26 CEST 2024


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.

Regards,
Simon


More information about the U-Boot mailing list