Skip to content
Snippets Groups Projects
  • Administrator's avatar
    099ec8bc
    Fix script · 099ec8bc
    Administrator authored and Florian Uhlig's avatar Florian Uhlig committed
    With the latest change not all libraries were found any longer such
    that not all libraries were tested.
    The outcome of the test was such not reliable.
    099ec8bc
    History
    Fix script
    Administrator authored and Florian Uhlig's avatar Florian Uhlig committed
    With the latest change not all libraries were found any longer such
    that not all libraries were tested.
    The outcome of the test was such not reliable.
checklibs.sh 1.04 KiB
#!/bin/bash
# Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
# SPDX-License-Identifier: GPL-3.0-only
# First commited by Florian Uhlig

# 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 -o -type l | 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