Skip to content

Commit 9df5adb

Browse files
committed
Move mock Foundation framework into clang shared folder
1 parent 3c824dd commit 9df5adb

File tree

15 files changed

+20
-15
lines changed

15 files changed

+20
-15
lines changed

docs/Testing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ Other substitutions:
353353

354354
* ``%clang-importer-sdk``: FIXME.
355355

356+
* ``%clang-importer-sdk-frameworks``: absolute path of the directory where mock frameworks are stored.
357+
356358
* ``%clang_apinotes``: run ``clang -cc1apinotes`` using the locally-built
357359
clang.
358360

test/ClangImporter/MixedSource/resolve-cross-language.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// 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
44
// RUN: cp %S/Inputs/resolve-cross-language/Base-module.map %t/module.map
5-
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -enable-objc-interop -typecheck -I %t -F %S/../../PrintAsObjC/Inputs/ -F %S/Inputs/resolve-cross-language %s -verify
5+
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource) -enable-objc-interop -typecheck -I %t -F %clang-importer-sdk-frameworks -F %S/Inputs/resolve-cross-language %s -verify
66

77
import Base
88
import BaseUser

test/Index/cross_language.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// RUN: cat %s > %t/combined.m
1010
// RUN: cat %S/Inputs/cross_language.m >> %t/combined.m
11-
// RUN: c-index-test core -print-source-symbols -- %t/combined.m -F %S/../PrintAsObjC/Inputs -I %t -isysroot %S/../Inputs/clang-importer-sdk >> %t.idx.out
11+
// RUN: c-index-test core -print-source-symbols -- %t/combined.m -F %clang-importer-sdk-frameworks -I %t -isysroot %S/../Inputs/clang-importer-sdk >> %t.idx.out
1212
// RUN: %FileCheck %t/combined.m -input-file %t.idx.out
1313

1414
#if SWIFT_CODE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#import <Foundation.h>

test/PrintAsObjC/Inputs/Foundation.framework/Headers/Foundation.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/PrintAsObjC/cdecl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/cdecl.swiftmodule -typecheck -emit-objc-header-path %t/cdecl.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
44
// RUN: %FileCheck %s < %t/cdecl.h
55
// RUN: %check-in-clang %t/cdecl.h
6-
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/cdecl.h -include Foundation.h -include ctypes.h -include CoreFoundation.h
6+
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/cdecl.h -include ctypes.h -include CoreFoundation.h
77

88
// REQUIRES: objc_interop
99

test/PrintAsObjC/classes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// RUN: %FileCheck --check-prefix=NEGATIVE %s < %t/classes.h
1919
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ %t/classes.h
2020
// RUN: not %check-in-clang -I %S/Inputs/custom-modules/ -fno-modules -Qunused-arguments %t/classes.h
21-
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ -fno-modules -Qunused-arguments %t/classes.h -include Foundation.h -include CoreFoundation.h -include objc_generics.h -include SingleGenericClass.h -include CompatibilityAlias.h
21+
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ -fno-modules -Qunused-arguments %t/classes.h -include CoreFoundation.h -include objc_generics.h -include SingleGenericClass.h -include CompatibilityAlias.h
2222

2323
// CHECK-NOT: AppKit;
2424
// CHECK-NOT: Properties;

test/PrintAsObjC/enums-frozen.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -parse-as-library %t/enums.swiftmodule -typecheck -emit-objc-header-path %t/enums.h -import-objc-header %S/Inputs/enums.h -disable-objc-attr-requires-foundation-module -enable-resilience
44
// RUN: %FileCheck %s < %t/enums.h
55
// RUN: %check-in-clang %t/enums.h
6-
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/enums.h -include Foundation.h -include ctypes.h -include CoreFoundation.h
6+
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/enums.h -include ctypes.h -include CoreFoundation.h
77

88
// REQUIRES: objc_interop
99

test/PrintAsObjC/enums.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %FileCheck %s < %t/enums.h
55
// RUN: %FileCheck -check-prefix=NEGATIVE %s < %t/enums.h
66
// RUN: %check-in-clang %t/enums.h
7-
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/enums.h -include Foundation.h -include ctypes.h -include CoreFoundation.h
7+
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/enums.h -include ctypes.h -include CoreFoundation.h
88

99
// REQUIRES: objc_interop
1010

test/PrintAsObjC/lit.local.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ config.substitutions.insert(0, ('%check-in-clang',
66
'-fmodules-validate-system-headers '
77
'-Weverything -Werror -Wno-unused-macros -Wno-incomplete-module '
88
'-Wno-auto-import '
9-
'-F %%S/Inputs/ '
9+
'-F %%clang-importer-sdk-frameworks '
1010
'-I %%clang-include-dir '
1111
'-isysroot %r/Inputs/clang-importer-sdk' % config.test_source_root) )
1212

@@ -15,6 +15,6 @@ config.substitutions.insert(0, ('%check-in-clang\+\+',
1515
'-Weverything -Werror -Wno-unused-macros -Wno-incomplete-module '
1616
'-Wno-auto-import -Wno-variadic-macros -Wno-c++98-compat-pedantic '
1717
'-Wno-unused-command-line-argument ' # for -fmodules-cache-path
18-
'-F %%S/Inputs/ '
18+
'-F %%clang-importer-sdk-frameworks '
1919
'-I %%clang-include-dir '
2020
'-isysroot %r/Inputs/clang-importer-sdk' % config.test_source_root) )

test/PrintAsObjC/reintroduced-new.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../../test/Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/Inputs/reintroduced-new.swift -swift-version 4 -disable-objc-attr-requires-foundation-module -module-name main
1010
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../../test/Inputs/clang-importer-sdk -I %t) -parse-as-library %t/main.swiftmodule -typecheck -emit-objc-header-path %t/generated.h -disable-objc-attr-requires-foundation-module -swift-version 4
11-
// RUN: not %clang -fsyntax-only -x objective-c %s -include %t/generated.h -fobjc-arc -fmodules -Werror -F %S/Inputs/ -isysroot %S/../../test/Inputs/clang-importer-sdk 2>&1 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s
11+
// RUN: not %clang -fsyntax-only -x objective-c %s -include %t/generated.h -fobjc-arc -fmodules -Werror -F %clang-importer-sdk-frameworks -isysroot %S/../../test/Inputs/clang-importer-sdk 2>&1 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s
1212

1313
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../../test/Inputs/clang-importer-sdk -I %t) -emit-module -o %t %S/Inputs/reintroduced-new.swift -disable-objc-attr-requires-foundation-module -module-name main -swift-version 5
1414
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../../test/Inputs/clang-importer-sdk -I %t) -parse-as-library %t/main.swiftmodule -typecheck -emit-objc-header-path %t/generated.h -disable-objc-attr-requires-foundation-module -swift-version 5
15-
// RUN: not %clang -fsyntax-only -x objective-c %s -include %t/generated.h -fobjc-arc -fmodules -Werror -F %S/Inputs/ -isysroot %S/../../test/Inputs/clang-importer-sdk 2>&1 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-5 %s
15+
// RUN: not %clang -fsyntax-only -x objective-c %s -include %t/generated.h -fobjc-arc -fmodules -Werror -F %clang-importer-sdk-frameworks -isysroot %S/../../test/Inputs/clang-importer-sdk 2>&1 | %FileCheck -check-prefix=CHECK -check-prefix=CHECK-5 %s
1616

1717
// CHECK-NOT: error:
1818

@@ -28,4 +28,4 @@ void test() {
2828
(void)[Sub new];
2929
}
3030

31-
// CHECK-NOT: error:
31+
// CHECK-NOT: error:

test/PrintAsObjC/simd.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -parse-as-library %t/simd_test.swiftmodule -typecheck -emit-objc-header-path %t/simd.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
1212
// RUN: %FileCheck %s < %t/simd.h
1313
// RUN: %check-in-clang %t/simd.h
14-
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/simd.h -include Foundation.h
14+
// RUN: %check-in-clang -fno-modules -Qunused-arguments %t/simd.h
1515

1616
// REQUIRES: objc_interop
1717

test/PrintAsObjC/swift_name.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) %S/../Inputs/empty.swift -typecheck -emit-objc-header-path %t/empty.h
3-
// RUN: %clang -F %S/Inputs/ -E -fobjc-arc -fmodules -isysroot %clang-importer-sdk-path -I %t %s | %FileCheck %s
3+
// RUN: %clang -F %clang-importer-sdk-frameworks -E -fobjc-arc -fmodules -isysroot %clang-importer-sdk-path -I %t %s | %FileCheck %s
44

55
// REQUIRES: objc_interop
66

test/PrintAsObjC/versioned.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// RUN: %target-swift-frontend(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t) -parse-as-library %t/versioned.swiftmodule -typecheck -I %S/Inputs/custom-modules -emit-objc-header-path %t/versioned.h -import-objc-header %S/../Inputs/empty.h -disable-objc-attr-requires-foundation-module -swift-version 3
1414
// RUN: %FileCheck %s < %t/versioned.h
1515
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ %t/versioned.h
16-
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ -fno-modules -Qunused-arguments %t/versioned.h -include Foundation.h -include VersionedFMWK.h
16+
// RUN: %check-in-clang -I %S/Inputs/custom-modules/ -fno-modules -Qunused-arguments %t/versioned.h -include VersionedFMWK.h
1717

1818
import VersionedFMWK
1919

test/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ config.substitutions.append(('%build-clang-importer-objc-overlays',
384384
config.substitutions.append(('%clang-importer-sdk-path',
385385
'%r' % (make_path(config.test_source_root, 'Inputs', 'clang-importer-sdk'))))
386386

387+
config.substitutions.append(('%clang-importer-sdk-frameworks',
388+
'%r' % (make_path(config.test_source_root, 'Inputs', 'clang-importer-sdk', 'frameworks'))))
389+
387390
config.substitutions.append(('%clang-importer-sdk-nosource',
388391
'-sdk %r' % (make_path(config.test_source_root, 'Inputs', 'clang-importer-sdk'))))
389392
# FIXME: END -enable-source-import hackaround

0 commit comments

Comments
 (0)