Skip to content

Commit

Permalink
runtests: avoid dependency check failure due to uncompiled app situation
Browse files Browse the repository at this point in the history
It could avoid the check failure due to uncompiled app situation, and
give the remind for this situation.

Signed-off-by: Pengfei Xu <[email protected]>
  • Loading branch information
xupengfe authored and ysun committed May 11, 2024
1 parent 3236fff commit 54b75c9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion BM/runtests
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,21 @@ init_dep_log() {
check_dep_cmd() {
local dep_info=$1
local dep=$2
local dep_cmd dep_reason
local dep_cmd dep_reason dep_app app

dep_cmd=$(echo "$dep_info" | awk -F "@" '{print $1}')
dep_reason=$(echo "$dep_info" | awk -F "@" '{print $2}')

# Avoid dependency check failure due to uncompiled app
dep_app=$(echo "$dep_info" | awk -F " " '{print $1}')
[[ "$dep_app" == *".sh" ]] || {
app=$(which "$dep_app" 2>/dev/null)
[[ -z "$app" ]] && {
REASON="The dependent app:$dep_app was not found and needs to be compiled first!"
return "$BLOCK_CODE"
}
}

# Execute ret not zero, will return below error code as failed
eval "$dep_cmd" 1>/dev/null || {
if [[ -z "$dep_reason" ]]; then
Expand Down

0 comments on commit 54b75c9

Please sign in to comment.