diff --git a/test/ScanDependencies/can_import_with_map.swift b/test/ScanDependencies/can_import_with_map.swift index 42bd4d1c38efc..e21bf826fe038 100644 --- a/test/ScanDependencies/can_import_with_map.swift +++ b/test/ScanDependencies/can_import_with_map.swift @@ -12,11 +12,11 @@ // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"Swift\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%stdlib_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/stdlib_module\"" >> %/t/inputs/map.json // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"SwiftOnoneSupport\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%ononesupport_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/ononesupport_module\"" >> %/t/inputs/map.json // RUN: echo "}]" >> %/t/inputs/map.json // RUN: %target-swift-frontend -typecheck %s -explicit-swift-module-map-file %t/inputs/map.json -disable-implicit-swift-modules diff --git a/test/ScanDependencies/explicit-module-map-forwarding-module.swift b/test/ScanDependencies/explicit-module-map-forwarding-module.swift index 1e2a7ec047661..5d3c3cfa82c60 100644 --- a/test/ScanDependencies/explicit-module-map-forwarding-module.swift +++ b/test/ScanDependencies/explicit-module-map-forwarding-module.swift @@ -22,11 +22,11 @@ // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"Swift\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%stdlib_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/stdlib_module\"" >> %/t/inputs/map.json // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"SwiftOnoneSupport\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%ononesupport_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/ononesupport_module\"" >> %/t/inputs/map.json // RUN: echo "}]" >> %/t/inputs/map.json // RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s diff --git a/test/ScanDependencies/explicit-module-map.swift b/test/ScanDependencies/explicit-module-map.swift index 401014da2d894..821a6cfdc847f 100644 --- a/test/ScanDependencies/explicit-module-map.swift +++ b/test/ScanDependencies/explicit-module-map.swift @@ -13,11 +13,11 @@ // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"Swift\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%stdlib_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/stdlib_module\"" >> %/t/inputs/map.json // RUN: echo "}," >> %/t/inputs/map.json // RUN: echo "{" >> %/t/inputs/map.json // RUN: echo "\"moduleName\": \"SwiftOnoneSupport\"," >> %/t/inputs/map.json -// RUN: echo "\"modulePath\": \"%ononesupport_module\"," >> %/t/inputs/map.json +// RUN: echo "\"modulePath\": \"%/ononesupport_module\"" >> %/t/inputs/map.json // RUN: echo "}]" >> %/t/inputs/map.json // RUN: %target-swift-ide-test -print-module-comments -module-to-print=Foo -enable-swiftsourceinfo -source-filename %s -explicit-swift-module-map-file %t/inputs/map.json | %FileCheck %s diff --git a/test/lit.cfg b/test/lit.cfg index e6973ebf5ae1e..e15dbbf6b77a7 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -1440,24 +1440,28 @@ config.substitutions.append(('%module-target-future', target_future)) config.substitutions.append(('%target-sdk-name', config.target_sdk_name)) # Add 'stdlib_dir' as the path to the stdlib resource directory -stdlib_dir = config.swift_lib_dir + "/swift/" -if platform.system() == 'Linux': - stdlib_dir += config.target_sdk_name + "/" + run_cpu +stdlib_dir = os.path.join(config.swift_lib_dir, "swift") +if platform.system() == 'Linux' or platform.system() == 'Windows': + stdlib_dir = os.path.join(stdlib_dir, config.target_sdk_name, run_cpu) else: - stdlib_dir += config.target_sdk_name + stdlib_dir = os.path.join(stdlib_dir, config.target_sdk_name) config.substitutions.append(('%stdlib_dir', stdlib_dir)) # Add 'stdlib_module' as the path to the stdlib .swiftmodule file -stdlib_module = stdlib_dir + "/Swift.swiftmodule" +stdlib_module = os.path.join(stdlib_dir, "Swift.swiftmodule") if platform.system() == 'Darwin': - stdlib_module += "/" + target_specific_module_triple + ".swiftmodule" + stdlib_module = os.path.join(stdlib_module, target_specific_module_triple + ".swiftmodule") config.substitutions.append(('%stdlib_module', stdlib_module)) +config.substitutions.append(('%/stdlib_module', + '/'.join(os.path.normpath(stdlib_module).split(os.sep)))) # Add 'ononesupport_module' as the path to the SwiftOnoneSupport .swiftmodule file -ononesupport_module = stdlib_dir + "/SwiftOnoneSupport.swiftmodule" +ononesupport_module = os.path.join(stdlib_dir, "SwiftOnoneSupport.swiftmodule") if platform.system() == 'Darwin': - ononesupport_module += "/" + target_specific_module_triple + ".swiftmodule" -config.substitutions.append(('%ononesupport_module', ononesupport_module)) + ononesupport_module = os.path.join(ononesupport_module, target_specific_module_triple + ".swiftmodule") +config.substitutions.append(('%ononesupport_module', ononesupport_module)) +config.substitutions.append(('%/ononesupport_module', + '/'.join(os.path.normpath(ononesupport_module).split(os.sep)))) # Different OS's require different prefixes for the environment variables to be # propagated to the calling contexts.