|
| 1 | +import Foo |
| 2 | + |
| 3 | +func test() { |
| 4 | + |
| 5 | +} |
| 6 | + |
| 7 | +// UNSUPPORTED: OS=windows-msvc |
| 8 | + |
| 9 | +// ----------------------------------------------------------------------------- |
| 10 | +// Test that modifications for frameworks in '-Fsystem' doesn't affect the result. |
| 11 | + |
| 12 | +// RUN: %empty-directory(%t/ModuleCache) |
| 13 | +// RUN: %empty-directory(%t/System/Frameworks) |
| 14 | +// RUN: cp -R %S/../Inputs/build_session/Frameworks/Foo.framework %t/System/Frameworks/ |
| 15 | +// RUN: cp -R %S/../Inputs/build_session/Frameworks/FooHelper.framework %t/System/Frameworks/ |
| 16 | +// RUN: %sourcekitd-test \ |
| 17 | +// RUN: -shell -- echo '## ONE' == \ |
| 18 | +// RUN: -req=complete -pos=4:1 %s -- %s -D ONE -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache == \ |
| 19 | +// RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/Foo.framework %t/System/Frameworks/ == \ |
| 20 | +// RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/FooHelper.framework %t/System/Frameworks/ == \ |
| 21 | +// RUN: -shell -- echo '## TWO' == \ |
| 22 | +// RUN: -req=complete -pos=4:1 %s -- %s -D TWO -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache \ |
| 23 | +// RUN: | tee %t.response | %FileCheck %s --check-prefix=CHECK_SYSTEM |
| 24 | +// RUN: sleep 2 |
| 25 | +// RUN: %sourcekitd-test \ |
| 26 | +// RUN: -shell -- echo '## THREE' == \ |
| 27 | +// RUN: -req=complete -pos=4:1 %s -- %s -D TWO -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache \ |
| 28 | +// RUN: | %FileCheck %s --check-prefix=CHECK_SYSTEM_2 |
| 29 | + |
| 30 | +// CHECK_SYSTEM-LABEL: ## ONE |
| 31 | +// CHECK_SYSTEM-DAG: key.description: "fooFunc(arg: Int32)" |
| 32 | +// CHECK_SYSTEM-DAG: key.description: "fooSubFunc(arg: Int32)" |
| 33 | +// CHECK_SYSTEM-DAG: key.description: "fooHelperFunc(arg: Int32)" |
| 34 | +// CHECK_SYSTEM-DAG: key.description: "fooHelperSubFunc(arg: Int32)" |
| 35 | + |
| 36 | +// CHECK_SYSTEM-LABEL: ## TWO |
| 37 | +// CHECK_SYSTEM-DAG: key.description: "fooFunc(arg: Int32)" |
| 38 | +// CHECK_SYSTEM-DAG: key.description: "fooSubFunc(arg: Int32)" |
| 39 | +// CHECK_SYSTEM-DAG: key.description: "fooHelperFunc(arg: Int32)" |
| 40 | +// CHECK_SYSTEM-DAG: key.description: "fooHelperSubFunc(arg: Int32)" |
| 41 | + |
| 42 | +// CHECK_SYSTEM_2-LABEL: ## THREE |
| 43 | +// CHECK_SYSTEM_2-NOT: fooFunc( |
| 44 | +// CHECK_SYSTEM_2-NOT: fooSubFunc( |
| 45 | +// CHECK_SYSTEM_2-NOT: fooHelperFunc( |
| 46 | +// CHECK_SYSTEM_2-NOT: fooHelperSubFunc( |
| 47 | +// CHECK_SYSTEM_2-DAG: key.description: "fooFunc_mod(arg: Int32)" |
| 48 | +// CHECK_SYSTEM_2-DAG: key.description: "fooSubFunc_mod(arg: Int32)" |
| 49 | +// CHECK_SYSTEM_2-DAG: key.description: "fooHelperFunc_mod(arg: Int32)" |
| 50 | +// CHECK_SYSTEM_2-DAG: key.description: "fooHelperSubFunc_mod(arg: Int32)" |
| 51 | +// CHECK_SYSTEM_2-NOT: fooFunc( |
| 52 | +// CHECK_SYSTEM_2-NOT: fooSubFunc( |
| 53 | +// CHECK_SYSTEM_2-NOT: fooHelperFunc( |
| 54 | +// CHECK_SYSTEM_2-NOT: fooHelperSubFunc( |
| 55 | + |
| 56 | +// ----------------------------------------------------------------------------- |
| 57 | +// Test that modifications for frameworks in '-F' are immidiately propagated |
| 58 | +// while modifications for frameworks in '-Fsystem' are not. |
| 59 | + |
| 60 | +// RUN: %empty-directory(%t/ModuleCache) |
| 61 | +// RUN: %empty-directory(%t/Frameworks) |
| 62 | +// RUN: %empty-directory(%t/System/Frameworks) |
| 63 | +// RUN: cp -R %S/../Inputs/build_session/Frameworks/Foo.framework %t/Frameworks/ |
| 64 | +// RUN: cp -R %S/../Inputs/build_session/Frameworks/FooHelper.framework %t/System/Frameworks/ |
| 65 | +// RUN: %sourcekitd-test \ |
| 66 | +// RUN: -shell -- echo '## ONE' == \ |
| 67 | +// RUN: -req=complete -pos=4:1 %s -- %s -D ONE -F %t/Frameworks -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache == \ |
| 68 | +// RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/Foo.framework %t/Frameworks/ == \ |
| 69 | +// RUN: -shell -- cp -R %S/../Inputs/build_session/Frameworks_modified/FooHelper.framework %t/System/Frameworks/ == \ |
| 70 | +// RUN: -shell -- echo '## TWO' == \ |
| 71 | +// RUN: -req=complete -pos=4:1 %s -- %s -D TWO -F %t/Frameworks -Fsystem %t/System/Frameworks -module-cache-path %t/ModuleCache \ |
| 72 | +// RUN: | %FileCheck %s --check-prefix=CHECK_USER |
| 73 | + |
| 74 | +// CHECK_USER-LABEL: ## ONE |
| 75 | +// CHECK_USER-DAG: key.description: "fooFunc(arg: Int32)" |
| 76 | +// CHECK_USER-DAG: key.description: "fooSubFunc(arg: Int32)" |
| 77 | +// CHECK_USER-DAG: key.description: "fooHelperFunc(arg: Int32)" |
| 78 | +// CHECK_USER-DAG: key.description: "fooHelperSubFunc(arg: Int32)" |
| 79 | + |
| 80 | +// CHECK_USER-LABEL: ## TWO |
| 81 | +// CHECK_USER-NOT: fooFunc( |
| 82 | +// CHECK_USER-NOT: fooSubFunc( |
| 83 | +// CHECK_USER-DAG: key.description: "fooFunc_mod(arg: Int32)" |
| 84 | +// CHECK_USER-DAG: key.description: "fooSubFunc_mod(arg: Int32)" |
| 85 | +// CHECK_USER-DAG: key.description: "fooHelperFunc(arg: Int32)" |
| 86 | +// CHECK_USER-DAG: key.description: "fooHelperSubFunc(arg: Int32)" |
| 87 | +// CHECK_USER-NOT: fooFunc( |
| 88 | +// CHECK_USER-NOT: fooSubFunc( |
0 commit comments