i was able to try your new patch, using ubuntu14.04
the patch behaves well for both clang3.5 and clang3.6, but only if i use a
custom test rig called runtest.py.
the patch behaves poorly for both clang3.5 and clang3.6 if i use the
standard test method "ninja check-lldb"
generally, runtest.py and "ninja check-lld" produce the same results, so
the problem is probably something subtle
with runtest.py, i get the following message for both compilers:
Test: TestMemoryHistory.py found in functionalities/asan
UNSUPPORTED: LLDB (/usr/bin/clang-x86_64) :: test_with_dsym
(TestMemoryHistory.AsanTestCase) (requires Darwin)
UNSUPPORTED: LLDB (/usr/bin/clang-x86_64) :: test_with_dwarf
(TestMemoryHistory.AsanTestCase) (skipping because compiler doesn't support
AddressSanitizer)
----------------------------------------------------------------------
Ran 2 tests in 0.071s
OK (skipped=2)
with "ninja check-lldb", i get the following messages for both compilers:
[1/1] Testing LLDB (with a separate subprocess per test)
FAILED: cd /media/psf/Raid0/projects/tot/build/tools/lldb/test &&
/usr/bin/python /media/psf/Raid0/projects/tot/llvm/tools/lldb/test/dosep.py
-o "-q --arch=x86_64 --executable
/media/psf/Raid0/projects/tot/build/bin/lldb -s
/media/psf/Raid0/projects/tot/build/lldb-test-traces -u CXXFLAGS -u CFLAGS
-C clang\ -Qunused-arguments\ -fcolor-diagnostics"
UNSUPPORTED: LLDB (clang -Qunused-arguments -fcolor-diagnostics-x86_64) ::
test_with_dsym (TestMemoryHistory.AsanTestCase) (requires Darwin)
FAIL: LLDB (clang -Qunused-arguments -fcolor-diagnostics-x86_64) ::
test_with_dwarf (TestMemoryHistory.AsanTestCase)
======================================================================
ERROR: test_with_dwarf (TestMemoryHistory.AsanTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 524, in
wrapper
func(*args, **kwargs)
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 506, in
wrapper
if skip_fn(self):
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 689, in
fn
return not self.compilerSupportsAddressSanitizer()
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 1462, in
compilerSupportsAddressSanitizer
if self.expectedCompilerVersion(["<", "3.6.0"]):
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 1257, in
expectedCompilerVersion
return self.getCompilerVersion() < version
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 1228, in
getCompilerVersion
version_output = system([[which(compiler), "-v"]])[1]
File "/media/psf/Raid0/projects/tot/lldb/test/lldbtest.py", line 265, in
system
commandList = [' '.join(x) for x in commands]
TypeError: sequence item 0: expected string, NoneType found
Config=x86_64-clang -Qunused-arguments -fcolor-diagnostics
----------------------------------------------------------------------
Ran 2 tests in 0.061s
FAILED (errors=1, skipped=1)
Ran 1 tests.
Failing Tests (1)
FAIL: LLDB (suite) :: TestMemoryHistory.py (Linux ubuntu 3.13.0-29-generic
#53-Ubuntu SMP Wed Jun 4 21:00:20 UTC 2014 x86_64 x86_64)
ninja: build stopped: subcommand failed.
in case someone wants to try running runtest.py on ubuntu, i have attached
runtest.py
to run the test with runtest.py:
copy runtest.py to the folder that contains lldb
type: ./runtest.py -c -p functionalities/asan/TestMemoryHistory.py
doug
On Sat, Nov 15, 2014 at 2:19 PM, Kuba Brecka <[email protected]> wrote:
> Updating the patch to only perform the ASan tests for clang version >=
> 3.6.0. The older versions do not have the new ASan debugging API. Doug,
> could you try the patch now?
>
> http://reviews.llvm.org/D6272
>
> Files:
> test/functionalities/asan/Makefile
> test/functionalities/asan/TestMemoryHistory.py
> test/functionalities/asan/TestReportData.py
> test/lldbtest.py
>
#!/usr/bin/env python
#---------------------------------------------------------------------
# This allows you to run a specific unit test or all the unit tests
# under a specified directory. Unit tests are run under a temporary
# cache directory in order to not conflict with multiple unit tests
# found in a single directory.
#---------------------------------------------------------------------
import os, sys, imp, platform
from optparse import OptionParser
CURRENT_DIR = os.getcwd()
# Defined directories
PROJECT_DIR = CURRENT_DIR + "/"
TEST_DIR = PROJECT_DIR + "lldb/test/"
BUILD_DIR = PROJECT_DIR + "build/"
# Verify that the defined directory paths are valid
if (os.path.isdir(PROJECT_DIR) == False) :
sys.exit("Invalid project directory defined in script")
if (os.path.isdir(TEST_DIR) == False) :
sys.exit("Invalid root test directory defined in script")
# Options
parser = OptionParser(usage="Usage: %prog [options] -p path \n Try: %prog -h for more options")
parser.add_option("-c", action="store_true", dest="compiler", help="Sets the compiler to be clang (default is gcc)")
parser.add_option("--ccache", action="store_true", dest="ccache", help="Use ccache")
parser.add_option("-d", action="store_true", dest="debug", help="Enable pudb Python debugger")
parser.add_option("-p", action="store", type="string", dest="inputpath", help="Specifies path location of test or group of tests")
parser.add_option("-b", action="store", type="string", dest="builddir", help="Specifies path location of where lldb was built")
(options, args) = parser.parse_args()
# If no flags are set but we're given a path, accept that as valid input to set the path location of the test
if options.compiler is None and options.debug is None and options.inputpath is None :
if len(sys.argv) > 1 and sys.argv[1] :
options.inputpath = sys.argv[1]
# Set which compiler we're using
if options.compiler :
if options.ccache :
CCOMPILER = "\'-C /usr/bin/ccache /usr/bin/clang\'"
#CCOMPILER = "\'-C /usr/bin/ccache "+BUILD_DIR+"bin/clang\'"
else :
CCOMPILER = "-C/usr/bin/clang"
#CCOMPILER = "-C"+BUILD_DIR+"bin/clang"
#CCOMPILER = "-C"+PROJECT_DIR+"lldb/llvm-build/Release+Asserts/x86_64/Release+Asserts/bin/clang"
PATH_CLANG = "clang"
else :
if options.ccache :
CCOMPILER = "\'-C /usr/bin/ccache /usr/bin/gcc\'"
else :
CCOMPILER = "-C/usr/bin/gcc"
PATH_CLANG = ""
# Define the command to launch the debugger. Report back if the debugger is not installed
if options.debug :
DEBUGGER = "-m pudb "
try:
imp.find_module('pudb')
except ImportError:
sys.exit("Python debugger pudb not found. Try typing:\nsudo apt-get install python-pudb")
else :
DEBUGGER = ""
# Take the path passed in at run time and append it to the project and test path
if options.inputpath is None:
parser.error('Input path required')
else:
path = TEST_DIR + options.inputpath
if (os.path.isdir(path) == False and not path.endswith(".py")) :
sys.exit("Invalid path location of test or group of tests")
# Take the path passed in at run time to define the build directory for lldb
if options.builddir is not None:
BUILD_DIR = PROJECT_DIR + options.builddir + "/"
if (os.path.isdir(BUILD_DIR) == False) :
sys.exit("Invalid path location of build directory for lldb")
if platform.system() == "Darwin" :
LLDB_EXE = PROJECT_DIR + "lldb/DerivedData/lldb/Build/Products/Debug/lldb"
else :
LLDB_EXE = BUILD_DIR + "bin/lldb"
# Find all the test python scripts that begin with Test and end in .py
def find(path):
scriptFile = []
scriptDir = []
for root, dirs, files in os.walk(path):
for name in files:
if name.startswith("Test") and name.endswith(".py"):
scriptFile.append(name)
scriptDir.append(root.replace(path,''))
return (scriptFile, scriptDir)
if path.endswith(".py") :
testScripts = [os.path.basename(path)]
basepath = os.path.dirname(path)
basepath = basepath.replace(TEST_DIR,'')
options.inputpath = ''
path = TEST_DIR
testDirs = [basepath]
else :
testScripts, testDirs = find(path)
# For each script we found, run the test
for index, script in enumerate(testScripts):
print("##############################################################################")
print ("Test: " + script + " found in " + options.inputpath + testDirs[index])
import sys; sys.stdout.flush()
# Make a temporary cache directory based on the name of the script. Since the Makefile
# specifies a specific depth from the root, we place this temp cache directory parallel
# to the directory that hosts the unit test python script
os.system("mkdir -p " + path + testDirs[index] + "/../temp" + script[:-3] + PATH_CLANG)
# Copy the contents of the directory including sub directories and hidden files to
# the temp cache directory
os.system("cp -a " + path + testDirs[index] + "/. " + path + testDirs[index] + "/../temp" + script[:-3] + PATH_CLANG)
# Run the unit test
os.system("/usr/bin/python " + DEBUGGER + TEST_DIR + "dotest.py -q --executable " + LLDB_EXE + " -s " + BUILD_DIR + "lldb-test-traces -u CXXFLAGS -u CFLAGS " + CCOMPILER + " -p " + script + " " + path + testDirs[index] + "/../temp" + script[:-3] + PATH_CLANG)
# Clean up the temporary cache directory
os.system("rm -rf " + path + testDirs[index] + "/../temp" + script[:-3] + PATH_CLANG)
print ("\n")
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits