Commit a5e1cc28 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

test for bug #87340 to work also from build directory (CMake)

From: Marco Clemencic <marco.clemencic@cern.ch>


git-svn-id: svn+ssh://svn.cern.ch/reps/gaudi/Gaudi/trunk@6978 53ecefc3-a64d-0410-9bdf-b8581fa3287e
parent 48112914
......@@ -5,6 +5,8 @@ Package manager : Marco Clemencic
- Modified ConfigurableDb.py to search for *_merged_confDb.py in all the dirs
of PYTHONPATH and not only in the InstallArea.
It is needed to be able to run the tests from the build directory (CMake).
- Modified the test for bug #87340 to work without the installation of
libGaudiKernel.so (CMake).
! 2012-07-13 - Marco Clemencic
- Fixed a problem with symbols visibility.
......
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>nm</text></argument>
<argument name="args"><set>
<text>-C</text>
<text>$GAUDIKERNELROOT/../InstallArea/$CMTCONFIG/lib/libGaudiKernel.so</text>
</set></argument>
<argument name="validator"><text>
import re
signature = re.compile(r"MsgStream&amp; operator&lt;&lt; &lt;char \[\d+\]&gt;")
lines = filter(signature.search, stdout.splitlines())
if lines:
# test failed
causes.append("MsgStream operator&lt;&lt; specialization")
# replace the reported standard output
result["ExecTest.stdout"] = result.Quote("\n".join(lines))
</text></argument>
<argument name="unsupported_platforms"><set><text>win</text></set></argument>
<argument name="program"><text>scripts/test_bug_87340.py</text></argument>
<argument name="unsupported_platforms"><set><text>win</text><text>mac</text></set></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
</extension>
#!/usr/bin/env python
"""
Test that the there is no signature for MsgStream operator<< <char []> in
GaudiKernel.
See https://savannah.cern.ch/bugs?87340
"""
import os
import sys
import re
from subprocess import Popen, PIPE
# find libGaudiKernel.so in the LD_LIBRARY_PATH
libname = 'libGaudiKernel.so'
searchpath = [os.path.curdir, 'lib']
# The day we can run the test on other platforms we can do this:
#varname = {'darwin': 'DYLD_LIBRARY_PATH',
# 'win32': 'PATH'}.get(sys.platform, 'LD_LIBRARY_PATH')
varname = 'LD_LIBRARY_PATH'
searchpath.extend(os.environ.get(varname, "").split(os.pathsep))
try:
lib = (p
for p in (os.path.join(n, libname)
for n in searchpath)
if os.path.exists(p)).next()
except StopIteration:
print >> sys.stderr, 'FAILURE: Cannot find', repr(libname), 'in', searchpath
sys.exit(2)
nm = Popen(["nm", '-C', lib], stdout=PIPE)
output, _ = nm.communicate()
if nm.returncode:
print output
print >> sys.stderr, 'FAILURE: nm call failed'
sys.exit(nm.returncode)
signature = re.compile(r"MsgStream&amp; operator&lt;&lt; &lt;char \[\d+\]&gt;")
lines = filter(signature.search, output.splitlines())
if lines:
print "\n".join(lines)
print >> sys.stderr, "FAILURE: found MsgStream operator<< specialization"
sys.exit(1)
else:
print "SUCCESS: no MsgStream operator<< specialization found"
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment