Skip to content

Commit c87b411

Browse files
committed
Add backtrace to installation test (shell script)
1 parent cd28653 commit c87b411

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tests/installation/installation-scripts.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@
7979
# (3) Parse the usage information (default usage file name: current file's name with -usage appended).
8080
# (4) Parse the command line using the usage information.
8181

82+
set -o errtrace
83+
84+
# requires `set -o errtrace`
85+
__b3bp_err_report() {
86+
local error_code
87+
error_code=${?}
88+
error "Error in ${__file} in function ${1} on line ${2}"
89+
exit ${error_code}
90+
}
91+
# Uncomment the following line for always providing an error backtrace
92+
trap '__b3bp_err_report "${FUNCNAME:-.}" ${LINENO}' ERR
93+
8294
### Start of boilerplate -- do not edit this block #######################
8395
export OPENCOARRAYS_SRC_DIR="${OPENCOARRAYS_SRC_DIR:-${PWD%/}/../../..}"
8496
if [[ ! -f "${OPENCOARRAYS_SRC_DIR}/src/libcaf.h" ]]; then

0 commit comments

Comments
 (0)