Add bitbake-extra-tests to cover taskexp ncurses UI.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2024-02-18 12:41:00 +00:00
parent 932ae33773
commit 094714e502
3 changed files with 30 additions and 3 deletions

View File

@ -276,6 +276,10 @@
"step4" : { "step4" : {
"shortname" : "OEQA core tests", "shortname" : "OEQA core tests",
"EXTRACMDS" : ["oe-test core"] "EXTRACMDS" : ["oe-test core"]
},
"step5" : {
"shortname" : "Bitbake extra tests",
"EXTRACMDS" : ["DISPLAY=:1 xterm -geometry 90x30 -e ${SCRIPTSDIR}/bitbake-extra-tests; exit $(cat bbextratests-exitcode)"]
} }
}, },
"reproducible" : { "reproducible" : {

20
scripts/bitbake-extra-tests Executable file
View File

@ -0,0 +1,20 @@
#!/bin/bash
. ./oe-init-build-env
TERM=xterm-256color
TASK_EXP_UNIT_TEST=1 bitbake -g -u taskexp_ncurses zlib acl
if [ $? -ne 0 ]; then
echo 1 > bbextratests-exitcode
exit 1
fi
TASK_EXP_UNIT_TEST=1 bitbake -g -u taskexp_ncurses zlib acl foo
if [ $? -ne 1 ]; then
echo 1 > bbextratests-exitcode
exit 1
fi
TASK_EXP_UNIT_TEST_NOTERM=1 bitbake -g -u taskexp_ncurses quilt
if [ $? -ne 0 ]; then
echo 1 > bbextratests-exitcode
exit 1
fi
echo $? > bbextratests-exitcode
exit 0

View File

@ -125,7 +125,7 @@ if args.json_outputfile:
def addentry(name, description, phase): def addentry(name, description, phase):
jsonconfig.append({"name" : name, "bbname" : description[:46], "phase" : phase, "description" : description}) jsonconfig.append({"name" : name, "bbname" : description[:46], "phase" : phase, "description" : description})
def addstepentry(name, taskdesc, shortname, description, detail, phase): def addstepentry(name, taskdesc, shortname, description, detail, phase, usepty=False):
bbname = taskdesc bbname = taskdesc
if shortname: if shortname:
bbname = shortname + ": " + taskdesc bbname = shortname + ": " + taskdesc
@ -134,7 +134,7 @@ def addstepentry(name, taskdesc, shortname, description, detail, phase):
bbdesc = description bbdesc = description
if detail: if detail:
bbdesc = bbdesc + ": " + detail bbdesc = bbdesc + ": " + detail
jsonconfig.append({"name" : name, "bbname" : bbname[:46], "phase" : phase, "description" : bbdesc}) jsonconfig.append({"name" : name, "bbname" : bbname[:46], "phase" : phase, "description" : bbdesc, "usepty" : usepty})
if jcfg: if jcfg:
buildtools = utils.setup_buildtools_tarball(ourconfig, args.workername, None, checkonly=True) buildtools = utils.setup_buildtools_tarball(ourconfig, args.workername, None, checkonly=True)
@ -287,7 +287,10 @@ def handle_stepnum(stepnum):
cmds = utils.getconfiglist("EXTRACMDS", ourconfig, args.target, stepnum) cmds = utils.getconfiglist("EXTRACMDS", ourconfig, args.target, stepnum)
if jcfg: if jcfg:
if cmds: if cmds:
addstepentry("cmds", "Run cmds", shortdesc, desc, str(cmds), str(stepnum)) usepty = False
if utils.getconfigvar("USEPTY", ourconfig, args.target, stepnum):
usepty = True
addstepentry("cmds", "Run cmds", shortdesc, desc, str(cmds), str(stepnum), usepty=usepty)
elif args.stepname == "cmds": elif args.stepname == "cmds":
for cmd in cmds: for cmd in cmds:
hp.printheader("Step %s/%s: Running command %s" % (stepnum, maxsteps, cmd)) hp.printheader("Step %s/%s: Running command %s" % (stepnum, maxsteps, cmd))