Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions test/ScanDependencies/can_import_with_map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/ScanDependencies/explicit-module-map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 13 additions & 9 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down