Skip to content
Snippets Groups Projects
Commit 9d20d9a0 authored by Administrator's avatar Administrator
Browse files

Add check to test library dependencies

Load a single library to check if there is some dependency missing.
parent 51bc79bf
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,10 @@ If($ENV{ctest_model} MATCHES Weekly)
Message("Additional long running Weekly tests")
EndIf()
# Test if all libraries can be loaded
GENERATE_TEST_SCRIPT(${CBMROOT_SOURCE_DIR}/scripts/checklibs.sh ${CBMROOT_BINARY_DIR}/macro/)
add_test(load_libraries ${CBMROOT_BINARY_DIR}/macro/checklibs.sh)
# Install in any case
Install(FILES KF/DecayConfig.C KF/registerGeantDecays.C KF/registerLightIons.C KF/registerPythiaDecays.C
KF/kf_kfparticle.C KF/kf_thermal_signal_generator.C KF/kf_transport.C
......
#/!bin/bash
# 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
Int_t loadlib(TString libname) {
Int_t retval = gSystem->Load(libname);
return retval;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment