mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add a script to build all dependencies for explicit module build in one step. This reduces the boiling plate code needed to write a test for explicit module build and allows the test to be more cross platform and resilient to module dependencies changes.
27 lines
1.0 KiB
Swift
27 lines
1.0 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %target-swift-frontend -scan-dependencies -module-name Test -O -I %t/include \
|
|
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
|
|
// RUN: %t/main.swift -o %t/deps.json -cache-compile-job -cas-path %t/cas -profile-coverage-mapping -profile-generate
|
|
|
|
// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json clang:SwiftShims > %t/shim.cmd
|
|
// RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json A > %t/A.cmd
|
|
|
|
// RUN: %FileCheck %s --input-file=%t/shim.cmd
|
|
// RUN: %FileCheck %s --input-file=%t/A.cmd
|
|
|
|
// CHECK: -direct-clang-cc1-module-build
|
|
// CHECK-NOT: -fcoverage-compilation-dir
|
|
|
|
//--- main.swift
|
|
import A
|
|
func test() {
|
|
a();
|
|
}
|
|
|
|
//--- include/A.swiftinterface
|
|
// swift-interface-format-version: 1.0
|
|
// swift-module-flags: -module-name A -O -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib -user-module-version 1.0
|
|
public func a() { }
|