Skip to content

Commit 583a45c

Browse files
add test for -symbol-graph-minimum-access-level
1 parent 156e58d commit 583a45c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/SymbolGraph/EmitWhileBuilding.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/
33
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
4+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB
45

56
// also try without the trailing slash on `-emit-symbol-graph-dir` and make sure it works
67

78
// RUN: %empty-directory(%t)
89
// RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t
910
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
11+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB
1012

1113
// also try while forcing the use of supplementary file maps to make sure the symbol graph path gets
1214
// added to the file map for the inner frontend call
1315

1416
// RUN: %empty-directory(%t)
1517
// RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t -driver-filelist-threshold=0 -O -whole-module-optimization
1618
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
19+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB
1720

1821
// also try with an up-to-date incremental build to make sure that adding the symbol graph flags
1922
// can get them to be generated
@@ -23,8 +26,21 @@
2326
// RUN: cd %t && %target-build-swift %t/EmitWhileBuilding.swift -module-name EmitWhileBuilding -c -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-dependencies -incremental -output-file-map=%S/Inputs/EmitWhileBuilding.output.json -working-directory %t -v -driver-show-incremental
2427
// RUN: cd %t && %target-build-swift %t/EmitWhileBuilding.swift -module-name EmitWhileBuilding -c -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-dependencies -incremental -output-file-map=%S/Inputs/EmitWhileBuilding.output.json -working-directory %t -v -driver-show-incremental -emit-symbol-graph -emit-symbol-graph-dir %t
2528
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
29+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PUB
30+
31+
// now run with -symbol-graph-minimum-access-level to change the available symbols
32+
33+
// RUN: %empty-directory(%t)
34+
// RUN: %target-build-swift %s -module-name EmitWhileBuilding -emit-module -emit-module-path %t/EmitWhileBuilding.swiftmodule -emit-symbol-graph -emit-symbol-graph-dir %t/ -symbol-graph-minimum-access-level private
35+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json
36+
// RUN: %FileCheck %s --input-file %t/EmitWhileBuilding.symbols.json --check-prefix PRIV
2637

2738
/// Does a foo.
2839
public func foo() {}
2940

41+
/// Does a bar.
42+
func bar() {}
43+
3044
// CHECK: "precise":"s:17EmitWhileBuilding3fooyyF"
45+
// PUB-NOT: "precise":"s:17EmitWhileBuilding3baryyF"
46+
// PRIV: "precise":"s:17EmitWhileBuilding3baryyF"

0 commit comments

Comments
 (0)