command error
This commit is contained in:
+1
-6
@@ -162,7 +162,6 @@ function on_exit {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
failure_payload="${last_error}"
|
failure_payload="${last_error}"
|
||||||
miaou_debug "UNDEFINED last error=${last_error}"
|
|
||||||
regex="╟─⟶"
|
regex="╟─⟶"
|
||||||
if [[ "$last_error" =~ $regex ]]; then
|
if [[ "$last_error" =~ $regex ]]; then
|
||||||
last_trim=false # keep the last error for next stacktrace
|
last_trim=false # keep the last error for next stacktrace
|
||||||
@@ -174,11 +173,7 @@ function on_exit {
|
|||||||
stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell)"
|
stack_functions[0]="${stack_functions[0]} (hint: prefer source than subshell)"
|
||||||
[[ "${code}" == 128 ]] && failure_type='SUBSHELL_SOURCE_NOT_FOUND'
|
[[ "${code}" == 128 ]] && failure_type='SUBSHELL_SOURCE_NOT_FOUND'
|
||||||
else
|
else
|
||||||
failure_type='UNDEFINED'
|
failure_type='COMMAND_ERROR'
|
||||||
regex='^subshell term:'
|
|
||||||
if [[ "$last_error" =~ $regex ]]; then
|
|
||||||
failure_type='SUBSHELL_TERM2'
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ fail_type exit EXIT
|
|||||||
fail_type source_not_found SOURCE_NOT_FOUND
|
fail_type source_not_found SOURCE_NOT_FOUND
|
||||||
fail_type file_not_found FILE_NOT_FOUND
|
fail_type file_not_found FILE_NOT_FOUND
|
||||||
fail_type subshell_error COMMAND_NOT_FOUND '(hint: prefer source than subshell)'
|
fail_type subshell_error COMMAND_NOT_FOUND '(hint: prefer source than subshell)'
|
||||||
|
fail_type command_error COMMAND_ERROR
|
||||||
|
|
||||||
failed=$((TEST_COUNT - SUCCESS_COUNT))
|
failed=$((TEST_COUNT - SUCCESS_COUNT))
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ function blabla {
|
|||||||
|
|
||||||
function suite {
|
function suite {
|
||||||
command_not_found
|
command_not_found
|
||||||
echo $nope
|
grep nope nope
|
||||||
|
exit
|
||||||
exit 10 # youpi
|
exit 10 # youpi
|
||||||
|
echo $nope
|
||||||
return 7
|
return 7
|
||||||
return
|
return
|
||||||
exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blabla
|
blabla
|
||||||
|
|||||||
@@ -94,6 +94,11 @@ function do_subshell_error {
|
|||||||
"$BASEDIR/extra/library.bash"
|
"$BASEDIR/extra/library.bash"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function do_command_error {
|
||||||
|
>&2 echo nope is not defined!
|
||||||
|
grep nope nope
|
||||||
|
}
|
||||||
|
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
|
|
||||||
function call_function_which_will_exit {
|
function call_function_which_will_exit {
|
||||||
|
|||||||
Reference in New Issue
Block a user