Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unit test for checking import ROOT openat calls #43596

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Utilities/General/test/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<use name="google-benchmark-main"/>
</bin>

<test name="test-import-root-openat" command="test-import-root-openat.sh">
<use name="root_interface"/>
</test>

<iftool name="cuda-gcc-support">
<test name="CudaGCCSupport" command="echo Supported GCC version"/>
<else/>
Expand Down
14 changes: 14 additions & 0 deletions Utilities/General/test/test-import-root-openat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash -ex

strace -z -f -o log1.txt -e trace=openat python3 -c 'import ROOT;print(ROOT.gErrorIgnoreLevel);'
if [ $(grep libFWCoreVersion.so log1.txt | wc -l) -gt 0 ] ; then
echo "ERROR: CMSSW libraries loaded by import ROOT"
exit 1
fi
strace -z -f -o log2.txt -e trace=openat python3 -c 'import ROOT;print(ROOT.gErrorIgnoreLevel);print(ROOT.kError);'
RUN1_OPENAT=$(grep openat log1.txt | wc -l)
RUN2_OPENAT=$(grep openat log2.txt | wc -l)
if [ ${RUN1_OPENAT} -ne ${RUN2_OPENAT} ] ; then
echo "ERROR: Some symbol search did not work. Two calls to ROOT loaded extra libraries."
exit 1
fi