diff options
Diffstat (limited to 'packages/Python/lldbsuite/test/dotest.py')
-rw-r--r-- | packages/Python/lldbsuite/test/dotest.py | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/packages/Python/lldbsuite/test/dotest.py b/packages/Python/lldbsuite/test/dotest.py index 7d739acba9525..d28c5ef069b7b 100644 --- a/packages/Python/lldbsuite/test/dotest.py +++ b/packages/Python/lldbsuite/test/dotest.py @@ -51,6 +51,8 @@ from ..support import seven def is_exe(fpath): """Returns true if fpath is an executable.""" + if fpath == None: + return False return os.path.isfile(fpath) and os.access(fpath, os.X_OK) @@ -299,12 +301,21 @@ def parseOptionsAndInitTestdirs(): configuration.compiler = candidate break + if args.dsymutil: + os.environ['DSYMUTIL'] = args.dsymutil + elif platform_system == 'Darwin': + os.environ['DSYMUTIL'] = seven.get_command_output( + 'xcrun -find -toolchain default dsymutil') + if args.channels: lldbtest_config.channels = args.channels if args.log_success: lldbtest_config.log_success = args.log_success + if args.out_of_tree_debugserver: + lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver + # Set SDKROOT if we are using an Apple SDK if platform_system == 'Darwin' and args.apple_sdk: os.environ['SDKROOT'] = seven.get_command_output( @@ -332,7 +343,7 @@ def parseOptionsAndInitTestdirs(): configuration.categoriesList = [] if args.skipCategories: - configuration.skipCategories = test_categories.validate( + configuration.skipCategories += test_categories.validate( args.skipCategories, False) if args.E: @@ -472,6 +483,8 @@ def parseOptionsAndInitTestdirs(): configuration.lldb_platform_url = args.lldb_platform_url if args.lldb_platform_working_dir: configuration.lldb_platform_working_dir = args.lldb_platform_working_dir + if args.test_build_dir: + configuration.test_build_dir = args.test_build_dir if args.event_add_entries and len(args.event_add_entries) > 0: entries = {} @@ -621,6 +634,12 @@ def setupSysPath(): os.environ["LLDB_TEST"] = scriptPath + # Set up the root build directory. + builddir = configuration.test_build_dir + if not configuration.test_build_dir: + raise Exception("test_build_dir is not set") + os.environ["LLDB_BUILD"] = os.path.abspath(configuration.test_build_dir) + # Set up the LLDB_SRC environment variable, so that the tests can locate # the LLDB source code. os.environ["LLDB_SRC"] = lldbsuite.lldb_root @@ -1085,6 +1104,39 @@ def checkLibcxxSupport(): print("Libc++ tests will not be run because: " + reason) configuration.skipCategories.append("libc++") +def canRunLibstdcxxTests(): + from lldbsuite.test import lldbplatformutil + + platform = lldbplatformutil.getPlatform() + if platform == "linux": + return True, "libstdcxx always present" + return False, "Don't know how to build with libstdcxx on %s" % platform + +def checkLibstdcxxSupport(): + result, reason = canRunLibstdcxxTests() + if result: + return # libstdcxx supported + if "libstdcxx" in configuration.categoriesList: + return # libstdcxx category explicitly requested, let it run. + print("libstdcxx tests will not be run because: " + reason) + configuration.skipCategories.append("libstdcxx") + +def checkDebugInfoSupport(): + import lldb + + platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] + compiler = configuration.compiler + skipped = [] + for cat in test_categories.debug_info_categories: + if cat in configuration.categoriesList: + continue # Category explicitly requested, let it run. + if test_categories.is_supported_on_platform(cat, platform, compiler): + continue + configuration.skipCategories.append(cat) + skipped.append(cat) + if skipped: + print("Skipping following debug info categories:", skipped) + def run_suite(): # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults # does not exist before proceeding to running the test suite. @@ -1117,7 +1169,6 @@ def run_suite(): signal.signal(signal.SIGINT, signal.SIG_IGN) setupSysPath() - configuration.setupCrashInfoHook() # # If '-l' is specified, do not skip the long running tests. @@ -1174,22 +1225,30 @@ def run_suite(): configuration.lldb_platform_working_dir, 448) # 448 = 0o700 if error.Fail(): raise Exception("making remote directory '%s': %s" % ( - remote_test_dir, error)) + configuration.lldb_platform_working_dir, error)) if not lldb.remote_platform.SetWorkingDirectory( configuration.lldb_platform_working_dir): - raise Exception("failed to set working directory '%s'" % remote_test_dir) + raise Exception("failed to set working directory '%s'" % configuration.lldb_platform_working_dir) lldb.DBG.SetSelectedPlatform(lldb.remote_platform) else: lldb.remote_platform = None configuration.lldb_platform_working_dir = None configuration.lldb_platform_url = None + # Set up the working directory. + # Note that it's not dotest's job to clean this directory. + import lldbsuite.test.lldbutil as lldbutil + build_dir = configuration.test_build_dir + lldbutil.mkdir_p(build_dir) + target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2] checkLibcxxSupport() + checkLibstdcxxSupport() + checkDebugInfoSupport() - # Don't do debugserver tests on everything except OS X. + # Don't do debugserver tests on anything except OS X. configuration.dont_do_debugserver_test = "linux" in target_platform or "freebsd" in target_platform or "windows" in target_platform # Don't do lldb-server (llgs) tests on anything except Linux. |