forked from bovulpes/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-root-macro.sh.in
More file actions
executable file
·41 lines (27 loc) · 926 Bytes
/
Copy pathtest-root-macro.sh.in
File metadata and controls
executable file
·41 lines (27 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash -e
# script to test the loading and possibly compilation of a Root macro
# within a controlled environment
#
MACRO=$1
COMPILE=$2
INCPATH=$3
LIBPATH=$4
LIBPATH=@CMAKE_LIBRARY_OUTPUT_DIRECTORY@:@LD_LIBRARY_PATH@:${LIBPATH}
LIBPATH=${LIBPATH//::/:}
[[ -z "$INCPATH" ]] && INCPATH=$ROOT_INCLUDE_PATH
if [[ ! -f ${MACRO} ]]; then
echo "Could not find macro ${MACRO}"
exit 64
fi
ROOTCMD=".L ${MACRO}"
[[ ${COMPILE} -eq 1 ]] && ROOTCMD="${ROOTCMD}++"
ERRVARNAME="test_root_macro_sh_in_err"
CMD="Int_t ${ERRVARNAME}; gROOT->ProcessLine(\"${ROOTCMD}\",&${ERRVARNAME});
std::cout << \"Exit code=\" << ${ERRVARNAME} << \"\n\"; gSystem->Exit(${ERRVARNAME});"
echo "ROOT_INCLUDE_PATH to be used:"
echo ${INCPATH} | tr ":" "\n"
echo "LD_LIBRARY_PATH to be used:"
echo ${LIBPATH} | tr ":" "\n"
env ROOT_INCLUDE_PATH=${INCPATH} LD_LIBRARY_PATH=${LIBPATH} @ROOT_root_CMD@ -n -b -l -q -e "${CMD}"
RV=$?
exit $RV