Skip to content

Commit c058fcf

Browse files
committed
lib.sh: install func_exit_handler() from start_test()
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 #1169 This commit will make it possible NOT to use start_test(). Signed-off-by: Marc Herbert <marc.herbert@intel.com>
1 parent a7b9428 commit c058fcf

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

case-lib/hijack.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
SUDO_CMD=$(command -v sudo)
44

5-
trap 'func_exit_handler $?' EXIT
65
# Overwrite other functions' exit to perform environment cleanup
76
function func_exit_handler()
87
{

case-lib/lib.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ start_test()
7777
return 0
7878
}
7979

80+
# func_exit_handler() is in hijack.sh
81+
trap 'func_exit_handler $?' EXIT
82+
8083
if test -z "$MAX_WAIT_FW_LOADING"; then
8184
local _pltf; _pltf=$("$SCRIPT_HOME/tools/sof-dump-status.py" -p)
8285
case "$_pltf" in

0 commit comments

Comments
 (0)