[test] Update ParseableInterface to ModuleInterface

Also remove uses of -emit-parseable-module-interface from tests
This commit is contained in:
Harlan Haskins
2019-09-13 14:19:56 -07:00
parent c82c9b8210
commit d3b8ce7ae2
181 changed files with 183 additions and 183 deletions

View File

@@ -0,0 +1,4 @@
// swift-interface-format-version: 1.0
// swift-module-flags:
garbage

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags:

View File

@@ -0,0 +1,4 @@
// swift-interface-format-version: 1.0
// swift-module-flags: -parse-stdlib
garbage

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags:

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags:

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags:

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags:

View File

@@ -0,0 +1,3 @@
struct SomeCStruct {
int value;
};

View File

@@ -0,0 +1,4 @@
module Platform {
header "Platform.h"
export *
}

View File

@@ -0,0 +1,4 @@
// swift-interface-format-version: 1.0
// swift-module-flags:
garbage

View File

@@ -0,0 +1,4 @@
// swift-interface-format-version: 1.0
// swift-module-flags:
garbage

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags:

View File

@@ -0,0 +1,2 @@
// swift-interface-format-version: 1.0
// swift-module-flags: -parse-stdlib

View File

@@ -0,0 +1,33 @@
// RUN: %empty-directory(%t)
// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule
// RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule
// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name Normal
// RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat
// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name FMWK
// RUN: %swift_build_sdk_interfaces -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -v -o %t/prebuilt -check-only
// RUN: ls %t/prebuilt | %FileCheck %s
// CHECK-DAG: Normal.swiftmodule
// CHECK-DAG: Flat.swiftmodule
// CHECK-DAG: FMWK.swiftmodule
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
// Touch a file in the SDK (to make it look like it changed) and try again.
// In -check-only mode, this should force a rebuild.
// RUN: rm -rf %t/MCP
// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule
import Normal
import Flat
import FMWK
func test() {
normal()
flat()
fmwk()
}

View File

@@ -0,0 +1,7 @@
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -o %t/output -debug-crash-compiler 2>&1 | %FileCheck %s
CHECK: Program arguments:
CHECK-SAME: -debug-crash-immediately
CHECK-SAME: {{.+}}.swiftinterface
REQUIRES: asserts

View File

@@ -0,0 +1,59 @@
// RUN: %empty-directory(%t)
// RUN: mkdir -p %t/sdk/usr/lib/swift/Normal.swiftmodule
// RUN: mkdir -p %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule
// RUN: echo 'public func normal() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name Normal
// RUN: echo 'public func flat() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Flat.swiftinterface -emit-module -o /dev/null -module-name Flat
// RUN: echo 'public func fmwk() {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/System/Library/Frameworks/FMWK.framework/Modules/FMWK.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name FMWK
// RUN: %swift_build_sdk_interfaces -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -v -o %t/prebuilt
// RUN: ls %t/prebuilt | %FileCheck %s
// CHECK-DAG: Normal.swiftmodule
// CHECK-DAG: Flat.swiftmodule
// CHECK-DAG: FMWK.swiftmodule
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
// Touch a file in the SDK (to make it look like it changed) and try again.
// This should still be able to use the prebuilt modules because they track
// content hashes, not just size+mtime.
// RUN: rm -rf %t/MCP
// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
// CHECK-CACHE-DAG: Normal-{{.+}}.swiftmodule
// CHECK-CACHE-DAG: Flat-{{.+}}.swiftmodule
// CHECK-CACHE-DAG: FMWK-{{.+}}.swiftmodule
// Actually change a file in the SDK, to check that we're tracking dependencies
// at all.
// RUN: rm -rf %t/MCP
// RUN: echo "public func another()" >> %t/sdk/usr/lib/swift/Normal.swiftmodule/%target-cpu.swiftinterface
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/FMWK-*.swiftmodule
// Without the prebuilt cache everything should still work; it'll just take time
// because we have to build the interfaces.
// RUN: rm -rf %t/MCP
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -Fsystem %t/sdk/System/Library/Frameworks -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP
// RUN: ls %t/MCP/*.swiftmodule | %FileCheck -check-prefix CHECK-CACHE %s
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Normal-*.swiftmodule
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Flat-*.swiftmodule
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/FMWK-*.swiftmodule
import Normal
import Flat
import FMWK
func test() {
normal()
flat()
fmwk()
}

View File

@@ -0,0 +1,8 @@
RUN: not %swift_build_sdk_interfaces 2>&1 | %FileCheck -check-prefix NO-OUTPUT %s
NO-OUTPUT: argument -o is required
RUN: not env -u SDKROOT %swift_build_sdk_interfaces -o %t 2>&1 | %FileCheck -check-prefix NO-SDK %s
NO-SDK: SDKROOT must be set
RUN: not %swift_build_sdk_interfaces -o %t -sdk %S/nonexistent 2>&1 | %FileCheck -check-prefix BAD-SDK %s
BAD-SDK: invalid SDK: {{.+[/\\]nonexistent$}}

View File

@@ -0,0 +1,54 @@
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -v -n -o %t/output > %t.txt
RUN: %FileCheck %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
CHECK-DAG: System/Library/Frameworks{{\\|/}}Simple.framework{{\\|/}}Modules{{\\|/}}Simple.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}Simple.swiftmodule{{\\|/}}xyz.swiftmodule
CHECK-DAG: usr/lib/swift{{\\|/}}Flat.swiftinterface -o {{.+}}output{{\\|/}}Flat.swiftmodule
CHECK-DAG: usr/lib/swift{{\\|/}}Normal.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}Normal.swiftmodule{{\\|/}}xyz.swiftmodule
CHECK-DAG: System/iOSSupport/System/Library/Frameworks{{\\|/}}Simple.framework{{\\|/}}Modules{{\\|/}}Simple.swiftmodule{{\\|/}}xyzzy.swiftinterface -o {{.+}}output{{\\|/}}Simple.swiftmodule{{\\|/}}xyzzy.swiftmodule
CHECK-DAG: System/iOSSupport/usr/lib/swift{{\\|/}}Caramel.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}Caramel.swiftmodule{{\\|/}}xyz.swiftmodule
NEGATIVE-NOT: BAD
RUN: env SDKROOT=%S/Inputs/mock-sdk/ %swift_build_sdk_interfaces -v -n -o %t/output > %t.txt
RUN: %FileCheck %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
# Make sure the stdlib is processed first.
RUN: %empty-directory(%t)
RUN: cp -r %S/Inputs/mock-sdk %t/sdk
RUN: mkdir %t/sdk/usr/lib/swift/Swift.swiftmodule
RUN: touch %t/sdk/usr/lib/swift/Swift.swiftmodule/abc.swiftinterface
RUN: touch %t/sdk/usr/lib/swift/Swift.swiftmodule/def.swiftinterface
RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -n -o %t/output | %FileCheck -check-prefix CHECK-WITH-STDLIB %s
CHECK-WITH-STDLIB-NOT: .swiftinterface -o
CHECK-WITH-STDLIB: Swift.swiftmodule{{\\|/}}{{abc|def}}.swiftinterface -o
CHECK-WITH-STDLIB-NOT: .swiftinterface -o
CHECK-WITH-STDLIB: Swift.swiftmodule{{\\|/}}{{abc|def}}.swiftinterface -o
CHECK-WITH-STDLIB: .swiftinterface -o
# ...unless we pass -skip-stdlib.
RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -n -o %t/output -skip-stdlib > %t.txt
RUN: %FileCheck -check-prefix CHECK-SKIP-STDLIB %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE-SKIP-STDLIB %s < %t.txt
CHECK-SKIP-STDLIB: .swiftinterface -o
NEGATIVE-SKIP-STDLIB-NOT: Swift.swiftmodule
# Check custom searching based on positional arguments.
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -v -n -o %t/output System/Library/PrivateFrameworks > %t.txt
RUN: %FileCheck -check-prefix CHECK-CUSTOM-PATHS %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE-CUSTOM-PATHS %s < %t.txt
CHECK-CUSTOM-PATHS-DAG: System/Library/PrivateFrameworks{{\\|/}}PrivateSimple.framework{{\\|/}}Modules{{\\|/}}PrivateSimple.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}PrivateSimple.swiftmodule{{\\|/}}xyz.swiftmodule
CHECK-CUSTOM-PATHS-DAG: usr/lib/swift{{\\|/}}Flat.swiftinterface -o {{.+}}output{{\\|/}}Flat.swiftmodule
CHECK-CUSTOM-PATHS-DAG: usr/lib/swift{{\\|/}}Normal.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}Normal.swiftmodule{{\\|/}}xyz.swiftmodule
CHECK-CUSTOM-PATHS-DAG: System/iOSSupport/usr/lib/swift{{\\|/}}Caramel.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}Caramel.swiftmodule{{\\|/}}xyz.swiftmodule
NEGATIVE-CUSTOM-PATHS-NOT: System/Library/Frameworks/
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/mock-sdk/ -v -n -o %t/output System/Library/Frameworks System/Library/PrivateFrameworks > %t.txt
RUN: %FileCheck -check-prefix CHECK-CUSTOM-PATHS -check-prefix CHECK-NORMAL-PATHS %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
CHECK-NORMAL-PATHS-DAG: System/Library/Frameworks{{\\|/}}Simple.framework{{\\|/}}Modules{{\\|/}}Simple.swiftmodule{{\\|/}}xyz.swiftinterface -o {{.+}}output{{\\|/}}Simple.swiftmodule{{\\|/}}xyz.swiftmodule

View File

@@ -0,0 +1,18 @@
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output | %FileCheck %s
CHECK-DAG: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-DAG: # (PASS) {{.+}}{{\\|/}}Good.swiftinterface
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -ignore-non-stdlib-failures | %FileCheck -check-prefix=CHECK-IGNORING-FAILURES %s
CHECK-IGNORING-FAILURES-DAG: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-IGNORING-FAILURES-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output | %FileCheck -check-prefix CHECK-BROKEN-STDLIB %s
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output -ignore-non-stdlib-failures | %FileCheck -check-prefix CHECK-BROKEN-STDLIB %s
CHECK-BROKEN-STDLIB: # (FAIL) {{.+}}{{\\|/}}Swift.swiftinterface
CHECK-BROKEN-STDLIB-NOT: {{^}}#
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output -skip-stdlib | %FileCheck %s
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/broken-stdlib-sdk/ -v -o %t/output -skip-stdlib -ignore-non-stdlib-failures | %FileCheck -check-prefix=CHECK-IGNORING-FAILURES %s

View File

@@ -0,0 +1,14 @@
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/iosmac-sdk/MacOSX.sdk/ -Fsystem-iosmac SECRET_SEARCH_PATH -v -n -o %t/output > %t.txt
RUN: %FileCheck %s < %t.txt
RUN: %FileCheck -check-prefix NEGATIVE %s < %t.txt
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}FMWK.framework{{\\|/}}Modules{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}/output{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/System/Library/Frameworks{{\\|/}}FMWK.framework{{\\|/}}Modules{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}/output{{\\|/}}FMWK.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
CHECK-DAG: MacOSX.sdk/usr/lib/swift{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}output{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/iOSSupport/usr/lib/swift{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}output{{\\|/}}Foo.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-macos.swiftmodule
CHECK-DAG: -Fsystem SECRET_SEARCH_PATH -Fsystem {{.+}}MacOSX.sdk/System{{\\|/}}iOSSupport{{\\|/}}System{{\\|/}}Library{{\\|/}}Frameworks {{.+}}MacOSX.sdk/System/Library/Frameworks{{\\|/}}Zippered.framework{{\\|/}}Modules{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftinterface -o {{.+}}/output{{\\|/}}Zippered.swiftmodule{{\\|/}}x86_64-apple-ios-macabi.swiftmodule
NEGATIVE-NOT: iOSSupport{{.+}}{{macos|x86_64}}.swiftmodule
NEGATIVE-NOT: SECRET_SEARCH_PATH{{.+}}{{macos|x86_64}}.swiftmodule

View File

@@ -0,0 +1,11 @@
# Make a local copy of the substitutions.
config.substitutions = list(config.substitutions)
swift_build_sdk_interfaces = (r'env SWIFT_EXEC=%%swiftc_driver_plain %r '
r'%%utils/swift_build_sdk_interfaces.py '
r'%%mcp_opt' %
(sys.executable,))
config.substitutions.insert(0, ('%swift_build_sdk_interfaces',
swift_build_sdk_interfaces))
config.suffixes.add('.py')

View File

@@ -0,0 +1,8 @@
# RUN: %swift_build_sdk_interfaces -machine-parseable-monotonic-version | \
# RUN: %{python} %s
import sys
lines = list(sys.stdin)
assert len(lines) == 1
assert int(lines[0]) > 0

View File

@@ -0,0 +1,35 @@
// RUN: %empty-directory(%t)
// RUN: cp -r %S/Inputs/system-dependencies-sdk %t/sdk
// RUN: echo 'import Platform; public func usesCStruct(_: SomeCStruct?) {}' | %target-swift-frontend - -emit-module-interface-path %t/sdk/usr/lib/swift/Swifty.swiftmodule/%target-cpu.swiftinterface -emit-module -o /dev/null -module-name Swifty -sdk %t/sdk
// RUN: %swift_build_sdk_interfaces -sdk %t/sdk -v -o %t/prebuilt
// RUN: ls %t/prebuilt | %FileCheck %s
// CHECK: Swifty.swiftmodule
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/*.swiftmodule
// Touch a file in the SDK (to make it look like it changed) and try again.
// This should still be able to use the prebuilt modules because they track
// content hashes, not just size+mtime.
// RUN: rm -rf %t/MCP
// RUN: %{python} %S/../ModuleCache/Inputs/make-old.py %t/sdk/usr/include/Platform.h
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule
// Actually change a file in the SDK, to check that we're tracking dependencies
// at all.
// RUN: rm -rf %t/MCP
// RUN: echo "void unrelated();" >> %t/sdk/usr/include/Platform.h
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP -prebuilt-module-cache-path %t/prebuilt
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule
// Without the prebuilt cache everything should still work; it'll just take time
// because we have to build the interfaces.
// RUN: rm -rf %t/MCP
// RUN: %target-typecheck-verify-swift -sdk %t/sdk -I %t/sdk/usr/lib/swift/ -module-cache-path %t/MCP
// RUN: not %{python} %S/../ModuleCache/Inputs/check-is-forwarding-module.py %t/MCP/Swifty-*.swiftmodule
import Swifty
usesCStruct(nil)

View File

@@ -0,0 +1,36 @@
RUN: %empty-directory(%t)
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -log-path %t/logs | %FileCheck %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/logs/Bad-Bad-err.txt
CHECK: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface
PRINTS-ERROR: unresolved identifier 'garbage'
RUN: %empty-directory(%t)
RUN: echo '["Good"]' > %t/xfails-good.json
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -log-path %t/logs -xfails %t/xfails-good.json | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/logs/Bad-Bad-err.txt
CHECK-XFAIL-GOOD-DAG: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-XFAIL-GOOD-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface
RUN: %empty-directory(%t)
RUN: echo '["Good", "Bad"]' > %t/xfails-good-and-bad.json
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -log-path %t/logs -xfails %t/xfails-good-and-bad.json| %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/logs/Bad-Bad-err.txt
CHECK-XFAIL-GOOD-AND-BAD-DAG: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-XFAIL-GOOD-AND-BAD-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface
RUN: %empty-directory(%t)
RUN: echo '["Bad"]' > %t/xfails-bad.json
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -log-path %t/logs -xfails %t/xfails-bad.json | %FileCheck -check-prefix=CHECK-XFAIL-BAD %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/logs/Bad-Bad-err.txt
CHECK-XFAIL-BAD: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface
RUN: %empty-directory(%t)
RUN: not %swift_build_sdk_interfaces -sdk %t -o %t/output -log-path %t/logs %S/Inputs/xfail-logs-framework/ | %FileCheck -check-prefix=CHECK-FRAMEWORK %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/logs/BadFMWK-x86_64-apple-macos-err.txt
CHECK-FRAMEWORK: # (FAIL) {{.+}}{{\\|/}}BadFMWK.swiftmodule{{\\|/}}x86_64-apple-macos.swiftinterface

View File

@@ -0,0 +1,43 @@
RUN: %empty-directory(%t)
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output 2> %t/stderr.txt | %FileCheck %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/stderr.txt
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output 2> %t/stderr.txt | %FileCheck -check-prefix CHECK-VERBOSE %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/stderr.txt
CHECK: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-VERBOSE-DAG: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-VERBOSE-DAG: # (PASS) {{.+}}{{\\|/}}Good.swiftinterface
PRINTS-ERROR: unresolved identifier 'garbage'
HIDES-ERROR-NOT: unresolved identifier 'garbage'
RUN: %empty-directory(%t)
RUN: echo '["Good"]' > %t/xfails-good.json
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -xfails %t/xfails-good.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/stderr.txt
RUN: not %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -xfails %t/xfails-good.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/stderr.txt
CHECK-XFAIL-GOOD-DAG: # (FAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-XFAIL-GOOD-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface
RUN: %empty-directory(%t)
RUN: echo '["Good", "Bad"]' > %t/xfails-good-and-bad.json
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -xfails %t/xfails-good-and-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s
RUN: %FileCheck -check-prefix HIDES-ERROR -allow-empty %s < %t/stderr.txt
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -xfails %t/xfails-good-and-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-GOOD-AND-BAD %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/stderr.txt
CHECK-XFAIL-GOOD-AND-BAD-DAG: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-XFAIL-GOOD-AND-BAD-DAG: # (UPASS) {{.+}}{{\\|/}}Good.swiftinterface
RUN: %empty-directory(%t)
RUN: echo '["Bad"]' > %t/xfails-bad.json
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -o %t/output -xfails %t/xfails-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-BAD %s
RUN: %FileCheck -check-prefix HIDES-ERROR -allow-empty %s < %t/stderr.txt
RUN: %swift_build_sdk_interfaces -sdk %S/Inputs/xfails-sdk/ -v -o %t/output -xfails %t/xfails-bad.json 2> %t/stderr.txt | %FileCheck -check-prefix=CHECK-XFAIL-BAD-VERBOSE %s
RUN: %FileCheck -check-prefix PRINTS-ERROR %s < %t/stderr.txt
CHECK-XFAIL-BAD: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-XFAIL-BAD-VERBOSE-DAG: # (XFAIL) {{.+}}{{\\|/}}Bad.swiftinterface
CHECK-XFAIL-BAD-VERBOSE-DAG: # (PASS) {{.+}}{{\\|/}}Good.swiftinterface