Skip to content
Merged
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
17 changes: 17 additions & 0 deletions lldb/packages/Python/lldbsuite/test/dotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ def parseOptionsAndInitTestdirs():
# Set SDKROOT if we are using an Apple SDK
if args.sysroot:
configuration.sdkroot = args.sysroot
if sys.platform == "win32":
os.environ["SDKROOT"] = args.sysroot
elif platform_system == "Darwin" and args.apple_sdk:
configuration.sdkroot = seven.get_command_output(
'xcrun --sdk "%s" --show-sdk-path 2> /dev/null' % (args.apple_sdk)
Expand Down Expand Up @@ -352,6 +354,21 @@ def parseOptionsAndInitTestdirs():
if args.swiftcompiler:
configuration.swiftCompiler = args.swiftcompiler

# On Windows, the Swift runtime DLLs (swiftCore.dll etc.) live alongside
# swiftc. Add that directory to the inferior's PATH so that Swift test
# binaries can find them at launch.
if sys.platform == "win32":
swift_bin_dir = os.path.dirname(
os.path.abspath(configuration.swiftCompiler)
)
path = f"{swift_bin_dir};{os.environ['PATH']}".replace('"', '\\"')
path_entry = f'PATH="{path}"'

if lldbtest_config.inferior_env is None:
lldbtest_config.inferior_env = path_entry
else:
lldbtest_config.inferior_env += " " + path_entry

if args.xfail_categories:
configuration.xfail_categories += test_categories.validate(
args.xfail_categories, False
Expand Down