Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: fix bug: lack of option sof-logger in tests #1251

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -949,11 +949,21 @@ is_ipc4()
return 1
}

set_default_param_for_sof_logger()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what problem this function solves. Is there some other code looking at OPT_VAL['s']? There shouldn't be.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I know at this moment no. But I didn't want add setting options in logger_disabled function. IMO it is more readable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure the OPT_NAME and OPT_DESC definitions here are never going to be used, so it's quite confusing to find them defined here. OPT_NAME and OPT_DESC are only used by the option parser and the option parser is never going to be run twice.

{
OPT_NAME['s']='sof-logger'
OPT_DESC['s']="Open sof-logger trace the data will store at $LOG_ROOT"
OPT_HAS_ARG['s']=0
OPT_VAL['s']=1
}

logger_disabled()
{
# Disable logging when available...
if [ ${OPT_VAL['s']} -eq 0 ]; then
return 0
if [ -n "${OPT_VAL['s']}" ]; then
[ "${OPT_VAL['s']}" -eq 0 ] && return 0
else
set_default_param_for_sof_logger
fi

# ... across all tests at once.
Expand Down
Loading