Skip to content

Commit

Permalink
lib.sh: install func_exit_handler() from start_test()
Browse files Browse the repository at this point in the history
func_exit_handler() makes sense only when used with start_test()

start_test() is a "mandatory" right now because it's invoked from
lib.sh. But this is wrong because it should be possible to import lib.sh
functions without actually running anything and it's causing various
issues like sof_remove.sh depending on the firmware being loaded, see
discussion in thesofproject#1169

This commit will make it possible NOT to use start_test().

Signed-off-by: Marc Herbert <[email protected]>
  • Loading branch information
marc-hb committed Apr 5, 2024
1 parent 0831bbc commit 28e1868
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion case-lib/hijack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

SUDO_CMD=$(command -v sudo)

trap 'func_exit_handler $?' EXIT
# Overwrite other functions' exit to perform environment cleanup
function func_exit_handler()
{
Expand Down
3 changes: 3 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ start_test()
return 0
}

# func_exit_handler() is in hijack.sh
trap 'func_exit_handler $?' EXIT

if test -z "$MAX_WAIT_FW_LOADING"; then
local _pltf; _pltf=$("$SCRIPT_HOME/tools/sof-dump-status.py" -p)
case "$_pltf" in
Expand Down

0 comments on commit 28e1868

Please sign in to comment.