|
| 1 | +import ClangFW |
| 2 | +import SwiftFW |
| 3 | + |
| 4 | +func foo() { |
| 5 | + /*HERE*/ |
| 6 | +} |
| 7 | + |
| 8 | +// Checks that, due to default check delay, a modification will be ignored and fast completion will still activate. |
| 9 | +// REQUIRES: shell |
| 10 | + |
| 11 | +// RUN: %empty-directory(%t/Frameworks) |
| 12 | +// RUN: %empty-directory(%t/MyProject) |
| 13 | + |
| 14 | +// RUN: COMPILER_ARGS=( \ |
| 15 | +// RUN: -target %target-triple \ |
| 16 | +// RUN: -module-name MyProject \ |
| 17 | +// RUN: -F %t/Frameworks \ |
| 18 | +// RUN: -I %t/MyProject \ |
| 19 | +// RUN: -import-objc-header %t/MyProject/Bridging.h \ |
| 20 | +// RUN: %t/MyProject/Library.swift \ |
| 21 | +// RUN: %s \ |
| 22 | +// RUN: ) |
| 23 | +// RUN: INPUT_DIR=%S/Inputs/checkdeps |
| 24 | +// RUN: DEPCHECK_INTERVAL=1 |
| 25 | +// RUN: SLEEP_TIME=2 |
| 26 | + |
| 27 | +// RUN: cp -R $INPUT_DIR/MyProject %t/ |
| 28 | +// RUN: cp -R $INPUT_DIR/ClangFW.framework %t/Frameworks/ |
| 29 | +// RUN: %empty-directory(%t/Frameworks/SwiftFW.framework/Modules/SwiftFW.swiftmodule) |
| 30 | +// RUN: %target-swift-frontend -emit-module -module-name SwiftFW -o %t/Frameworks/SwiftFW.framework/Modules/SwiftFW.swiftmodule/%target-swiftmodule-name $INPUT_DIR/SwiftFW_src/Funcs.swift |
| 31 | + |
| 32 | +// RUN: %sourcekitd-test \ |
| 33 | +// RUN: -req=global-config == \ |
| 34 | + |
| 35 | +// RUN: -shell -- echo "### Initial" == \ |
| 36 | +// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \ |
| 37 | + |
| 38 | +// RUN: -shell -- echo '### Modify framework (c)' == \ |
| 39 | +// RUN: -shell -- sleep $SLEEP_TIME == \ |
| 40 | +// RUN: -shell -- cp -R $INPUT_DIR/ClangFW.framework_mod/* %t/Frameworks/ClangFW.framework/ == \ |
| 41 | +// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} == \ |
| 42 | + |
| 43 | +// RUN: -req=global-config -completion-check-dependency-interval ${DEPCHECK_INTERVAL} == \ |
| 44 | +// RUN: -shell -- echo '### Checking dependencies' == \ |
| 45 | +// RUN: -req=complete -pos=5:3 %s -- ${COMPILER_ARGS[@]} \ |
| 46 | + |
| 47 | +// RUN: | %FileCheck %s |
| 48 | + |
| 49 | + |
| 50 | +// CHECK-LABEL: ### Initial |
| 51 | +// CHECK: key.results: [ |
| 52 | +// CHECK-DAG: key.description: "clangFWFunc()" |
| 53 | +// CHECK-DAG: key.description: "swiftFWFunc()" |
| 54 | +// CHECK-DAG: key.description: "localClangFunc()" |
| 55 | +// CHECK-DAG: key.description: "localSwiftFunc()" |
| 56 | +// CHECK: ] |
| 57 | +// CHECK-NOT: key.reusingastcontext: 1 |
| 58 | + |
| 59 | +// CHECK-LABEL: ### Modify framework (c) |
| 60 | +// CHECK: key.results: [ |
| 61 | +// CHECK-DAG: key.description: "clangFWFunc()" |
| 62 | +// CHECK-DAG: key.description: "swiftFWFunc()" |
| 63 | +// CHECK-DAG: key.description: "localClangFunc()" |
| 64 | +// CHECK-DAG: key.description: "localSwiftFunc()" |
| 65 | +// CHECK: ] |
| 66 | +// CHECK: key.reusingastcontext: 1 |
| 67 | + |
| 68 | +// CHECK-LABEL: ### Checking dependencies |
| 69 | +// CHECK: key.results: [ |
| 70 | +// CHECK-DAG: key.description: "clangFWFunc_mod()" |
| 71 | +// CHECK-DAG: key.description: "swiftFWFunc()" |
| 72 | +// CHECK-DAG: key.description: "localClangFunc()" |
| 73 | +// CHECK-DAG: key.description: "localSwiftFunc()" |
| 74 | +// CHECK: ] |
| 75 | +// CHECK-NOT: key.reusingastcontext: 1 |
0 commit comments