mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[test] Rename all module.map files to module.modulemap
`module.map` as a module map name has been discouraged since 2014, and Clang will soon warn on its usage. This patch renames all instances of `module.map` in the Swift tests to `module.modulemap` in preparation for this change to Clang. rdar://106123303
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -emit-module -enable-objc-interop -emit-objc-header -o %t %S/Inputs/resolve-cross-language/Base.swift -disable-objc-attr-requires-foundation-module
|
||||
// RUN: cp %S/Inputs/resolve-cross-language/Base-module.map %t/module.map
|
||||
// RUN: cp %S/Inputs/resolve-cross-language/Base-module.map %t/module.modulemap
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -typecheck -I %t -F %clang-importer-sdk-path/frameworks -F %S/Inputs/resolve-cross-language %s -verify
|
||||
|
||||
import Base
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#if MISSING_FROM_MODULE
|
||||
import MissingHeader
|
||||
// CHECK-MODULE-MAP: {{.*}}{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}module.map:{{[0-9]+:[0-9]+}}: error: header 'this-header-does-not-exist.h' not found
|
||||
// CHECK-MODULE-MAP: {{.*}}{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap:{{[0-9]+:[0-9]+}}: error: header 'this-header-does-not-exist.h' not found
|
||||
// CHECK-MODULE-MAP: broken-modules.swift:[[@LINE-2]]:8: error: could not build Objective-C module 'MissingHeader'
|
||||
|
||||
#else
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Emit the explicit module.
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-emit-pcm -module-name script -o %t/script.pcm %S/Inputs/custom-modules/module.map
|
||||
// RUN: %target-swift-emit-pcm -module-name script -o %t/script.pcm %S/Inputs/custom-modules/module.modulemap
|
||||
|
||||
// Verify some of the output of the -dump-pcm flag.
|
||||
// RUN: %swift-dump-pcm %t/script.pcm | %FileCheck %s --check-prefix=CHECK-DUMP
|
||||
// CHECK-DUMP: Information for module file '{{.*}}/script.pcm':
|
||||
// CHECK-DUMP: Module name: script
|
||||
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.map
|
||||
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap
|
||||
|
||||
// Compile a source file that imports the explicit module.
|
||||
// RUN: %target-swift-frontend -typecheck -verify -Xcc -fmodule-file=%t/script.pcm %s
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// Emit the explicit module.
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %swift-frontend -emit-pcm -direct-clang-cc1-module-build -only-use-extra-clang-opts -module-name script -o %t/script.pcm %S/Inputs/custom-modules/module.map -Xcc %S/Inputs/custom-modules/module.map -Xcc -o -Xcc %t/script.pcm -Xcc -fmodules -Xcc -triple -Xcc %target-triple -Xcc -x -Xcc objective-c -dump-clang-diagnostics 2> %t.diags.txt
|
||||
// RUN: %swift-frontend -emit-pcm -direct-clang-cc1-module-build -only-use-extra-clang-opts -module-name script -o %t/script.pcm %S/Inputs/custom-modules/module.modulemap -Xcc %S/Inputs/custom-modules/module.modulemap -Xcc -o -Xcc %t/script.pcm -Xcc -fmodules -Xcc -triple -Xcc %target-triple -Xcc -x -Xcc objective-c -dump-clang-diagnostics 2> %t.diags.txt
|
||||
|
||||
// Verify some of the output of the -dump-pcm flag.
|
||||
// RUN: %swift-dump-pcm %t/script.pcm | %FileCheck %s --check-prefix=CHECK-DUMP
|
||||
// CHECK-DUMP: Information for module file '{{.*}}/script.pcm':
|
||||
// CHECK-DUMP: Module name: script
|
||||
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.map
|
||||
// CHECK-DUMP: Module map file: {{.*[/\\]}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap
|
||||
|
||||
// Verify that the clang command-line used is cc1
|
||||
// RUN: %FileCheck -check-prefix CHECK-CLANG -DTRIPLE=%target-triple %s < %t.diags.txt
|
||||
// CHECK-CLANG: '{{.*[/\\]}}module.map' '-o' '{{.*[/\\]}}script.pcm' '-fmodules' '-triple' '[[TRIPLE]]' '-x' 'objective-c'
|
||||
// CHECK-CLANG: '{{.*[/\\]}}module.modulemap' '-o' '{{.*[/\\]}}script.pcm' '-fmodules' '-triple' '[[TRIPLE]]' '-x' 'objective-c'
|
||||
|
||||
import script
|
||||
var _ : ScriptTy
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Emit the explicit system module.
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-emit-pcm -module-name script -Xcc -Xclang -Xcc -emit-module -Xcc -Xclang -Xcc -fsystem-module -o %t/script.pcm %S/Inputs/custom-modules/module.map
|
||||
// RUN: %target-swift-emit-pcm -module-name script -Xcc -Xclang -Xcc -emit-module -Xcc -Xclang -Xcc -fsystem-module -o %t/script.pcm %S/Inputs/custom-modules/module.modulemap
|
||||
|
||||
// Verify that the input modulemap if marked [System] in the output of the -dump-pcm action.
|
||||
// RUN: %swift-dump-pcm %t/script.pcm | %FileCheck %s --check-prefix=CHECK-SYSTEM-INPUT
|
||||
// CHECK-SYSTEM-INPUT: Input file: {{.*[/\\]}}ClangImporter{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}module.map [System]
|
||||
// CHECK-SYSTEM-INPUT: Input file: {{.*[/\\]}}ClangImporter{{/|\\}}Inputs{{/|\\}}custom-modules{{/|\\}}module.modulemap [System]
|
||||
import script
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-DAG: usr{{/|\\}}include{{/|\\}}Foundation.h
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-DAG: usr{{/|\\}}include{{/|\\}}objc{{/|\\}}NSObject.h
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-DAG: usr{{/|\\}}include{{/|\\}}objc{{/|\\}}ObjectiveC.apinotes
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-DAG: usr{{/|\\}}include{{/|\\}}objc{{/|\\}}module.map
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-DAG: usr{{/|\\}}include{{/|\\}}objc{{/|\\}}module.modulemap
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-DAG: usr{{/|\\}}include{{/|\\}}objc{{/|\\}}objc.h
|
||||
// CHECK-IMPORT-TRACK-SYSTEM-NOT: {{[^\\]}}:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// RUN: %target-swift-frontend -emit-module -disable-objc-attr-requires-foundation-module -o %t %S/Inputs/AnyObject/foo_swift_module.swift
|
||||
// RUN: %target-swift-frontend -emit-module -disable-objc-attr-requires-foundation-module -o %t %S/Inputs/AnyObject/bar_swift_module.swift
|
||||
// RUN: cp %S/Inputs/AnyObject/baz_clang_module.h %t
|
||||
// RUN: cp %S/Inputs/AnyObject/module.map %t
|
||||
// RUN: cp %S/Inputs/AnyObject/module.modulemap %t
|
||||
|
||||
// RUN: %target-swift-ide-test -code-completion -source-filename %s -I %t -disable-objc-attr-requires-foundation-module -code-completion-token=DL_FUNC_PARAM_NO_DOT_1 > %t.dl.txt
|
||||
// RUN: %FileCheck %s -check-prefix=DL_INSTANCE_NO_DOT < %t.dl.txt
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Xcc -fmodule-map-file=%S/Inputs/custom-modules/module.map -Xcc -I%S/Inputs/custom-modules/header_subdirectory/ -I%S/Inputs/custom-modules/ -emit-objc-header-path %t/textual-imports.h -emit-clang-header-nonmodular-includes %s
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Xcc -fmodule-map-file=%S/Inputs/custom-modules/module.modulemap -Xcc -I%S/Inputs/custom-modules/header_subdirectory/ -I%S/Inputs/custom-modules/ -emit-objc-header-path %t/textual-imports.h -emit-clang-header-nonmodular-includes %s
|
||||
// RUN: %FileCheck %s < %t/textual-imports.h
|
||||
|
||||
// The module map does not lie in a provided include dir, but we should still include <header-regular.h> and NOT <header_subdirectory/header-regular.h> because
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Xcc -fmodule-map-file=%S/Inputs/custom-modules/module.map -Xcc -I%S/Inputs/custom-modules/./header_subdirectory/ -I%S/Inputs/custom-modules/ -emit-objc-header-path %t/textual-imports.h -emit-clang-header-nonmodular-includes %s
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Xcc -fmodule-map-file=%S/Inputs/custom-modules/module.modulemap -Xcc -I%S/Inputs/custom-modules/./header_subdirectory/ -I%S/Inputs/custom-modules/ -emit-objc-header-path %t/textual-imports.h -emit-clang-header-nonmodular-includes %s
|
||||
// RUN: %FileCheck %s < %t/textual-imports.h
|
||||
|
||||
// The period in the provided include directory above should not break the system.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Xcc -fmodule-map-file=%S/Inputs/custom-modules/module.map -Xcc -I%S/Inputs/custom-modules/header_subdirectory/ -I%S/Inputs/custom-modules/ -emit-objc-header-path %t/textual-imports.h -emit-clang-header-nonmodular-includes %s
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -Xcc -fmodule-map-file=%S/Inputs/custom-modules/module.modulemap -Xcc -I%S/Inputs/custom-modules/header_subdirectory/ -I%S/Inputs/custom-modules/ -emit-objc-header-path %t/textual-imports.h -emit-clang-header-nonmodular-includes %s
|
||||
// RUN: %FileCheck %s < %t/textual-imports.h
|
||||
|
||||
// Make sure the include we get is not based on the resolved symlink, but rather the path to the symlink itself.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// RUN: %target-swift-frontend -emit-module-path %t/resilient_struct.swiftmodule %S/../Inputs/resilient_struct.swift -enable-library-evolution
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module-path %t/resilient_objc_class.swiftmodule %S/../Inputs/resilient_objc_class.swift -I %t -enable-library-evolution -emit-objc-header-path %t/resilient_objc_class.h
|
||||
|
||||
// RUN: cp %S/Inputs/custom-modules/module.map %t/module.map
|
||||
// RUN: cp %S/Inputs/custom-modules/module.modulemap %t/module.modulemap
|
||||
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %S/resilient-ancestry.swift -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution -target %target-next-stable-abi-triple
|
||||
// RUN: %FileCheck %S/resilient-ancestry.swift < %t/resilient.h
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// RUN: %target-swift-frontend -emit-module-path %t/resilient_struct.swiftmodule %S/../Inputs/resilient_struct.swift -enable-library-evolution
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -emit-module-path %t/resilient_objc_class.swiftmodule %S/../Inputs/resilient_objc_class.swift -I %t -enable-library-evolution -emit-objc-header-path %t/resilient_objc_class.h
|
||||
|
||||
// RUN: cp %S/Inputs/custom-modules/module.map %t/module.map
|
||||
// RUN: cp %S/Inputs/custom-modules/module.modulemap %t/module.modulemap
|
||||
|
||||
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -module-name resilient -emit-objc-header-path %t/resilient.h -I %t -enable-library-evolution
|
||||
// RUN: %FileCheck %s --check-prefix=NO-STUBS < %t/resilient.h
|
||||
|
||||
Reference in New Issue
Block a user