Skip to content

Commit fdf3f63

Browse files
committed
test: handle spaces in paths better on macOS tests
Ensure that we quote the path to the SDKROOT which may contain spaces. Failure to so will break the path into multiple components (split on spaces) and generate an invalid command.
1 parent 887464b commit fdf3f63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/lit.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ if kIsWindows:
435435
config.swift_test_options,
436436
config.swift_driver_test_options)) )
437437
else:
438-
config.substitutions.append( ('%swift_driver', "env SDKROOT=%s %r %s %s %s" % (config.variant_sdk, config.swift, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
439-
config.substitutions.append( ('%swiftc_driver', "env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s" % (config.variant_sdk, config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
438+
config.substitutions.append( ('%swift_driver', "env SDKROOT=%s %r %s %s %s" % (shell_quote(config.variant_sdk), config.swift, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
439+
config.substitutions.append( ('%swiftc_driver', "env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s" % (shell_quote(config.variant_sdk), config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options)) )
440440
config.substitutions.append( ('%sil-opt', "%r %s %s" % (config.sil_opt, mcp_opt, config.sil_test_options)) )
441441
config.substitutions.append( ('%sil-func-extractor', "%r %s" % (config.sil_func_extractor, mcp_opt)) )
442442
config.substitutions.append( ('%sil-llvm-gen', "%r %s" % (config.sil_llvm_gen, mcp_opt)) )

0 commit comments

Comments
 (0)