Skip to content
Closed
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
Copy link
Contributor

@artemcm artemcm Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix is missing the removal of the comma after the last object element that I had in the other PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. That is optional - I can add it or it can be a follow up. The reason that it is not needed is because the list itself contains objects. Objects can have trailing commas.

// 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
16 changes: 10 additions & 6 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1441,23 +1441,27 @@ 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
else:
if platform.system() == 'Darwin':
stdlib_dir += config.target_sdk_name
else:
stdlib_dir += config.target_sdk_name + "/" + run_cpu
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"
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))
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