Newer
Older
#!bin/bash
# Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
# SPDX-License-Identifier: GPL-3.0-only
# First commited by Florian Uhlig
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
41
42
43
# check if the libraries have the proper dependencies
# load a single library in root and check the return value
# Allow to run the script in th test suite without parameters
# or from the command line passing the proper parameters
SCRIPTDIR=${1:-$VMCWORKDIR/scripts}
LIBDIR=${2:-../lib}
# find all libs
# libraries are real files with the extensions .so and for macosx .dylib
all_libs=$(find $LIBDIR -type f | grep -e \.dylib -e \.so)
tmpfile=$(mktemp)
ok=true
for lib in $all_libs; do
echo "Loading the library $lib"
root -l -q -b $SCRIPTDIR/loadlib.C\(\"$lib\"\) &> $tmpfile
retval=$?
if [[ retval -ne 0 ]]; then
echo ""
echo "Problem loading the library $lib"
cat $tmpfile
echo ""
okay=false
fi
done
rm $tmpfile
if [[ "$okay" = "false" ]]; then
echo ""
echo "Not all libraries could be loaded"
echo "Test failed"
exit 1
else
exit 0
fi