-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPackage.swift
144 lines (129 loc) · 4.43 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "PackageBenchmarkSamples",
platforms: [.macOS(.v15)],
products: [
.library(
name: "PackageBenchmarkSamples",
targets: ["PackageBenchmarkSamples"]
),
],
dependencies: [
// .package(url: "https://github.com/ordo-one/package-benchmark", branch: "main"),
// .package(path: "../package-benchmark"),
.package(url: "https://github.com/ordo-one/package-benchmark", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/swift-extras/swift-extras-json.git", .upToNextMajor(from: "0.6.0")),
],
targets: [
.target(
name: "PackageBenchmarkSamples",
dependencies: []
),
// Sample benchmark executable targets, a few displaying how benchmarks can be split up.
// Absolute minimal boilerplate
.executableTarget(
name: "Minimal",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/Minimal",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
// Sample showing wide range of API usage
.executableTarget(
name: "Samples",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
"PackageBenchmarkSamples",
],
path: "Benchmarks/Samples",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
// Some miscellaneous tests for edge conditions
.executableTarget(
name: "Miscellaneous",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/Miscellaneous",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
// One test for problems with memory measurements
.executableTarget(
name: "MemoryOne",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/MemoryOne",
swiftSettings: [
.swiftLanguageMode(.v5)
],
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
// Another test for problems with memory measurements
.executableTarget(
name: "MemoryTwo",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/MemoryTwo",
swiftSettings: [
.swiftLanguageMode(.v5)
],
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
// Some test benchmarks on Foundation
.executableTarget(
name: "Foundation-Benchmark",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/Foundation",
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
),
// Benchmarks on external libraries
.executableTarget(
name: "External-Benchmarks",
dependencies: [
.product(name: "ExtrasJSON", package: "swift-extras-json"),
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/External",
resources: [
.process("Resources/example.geojson"),
],
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark"),
]
)
]
)
// Benchmark of MultiFileExample
package.targets += [
.executableTarget(
name: "MultiFileExample",
dependencies: [
.product(name: "Benchmark", package: "package-benchmark"),
],
path: "Benchmarks/MultiFileExample",
swiftSettings: [
.swiftLanguageMode(.v5)
],
plugins: [
.plugin(name: "BenchmarkPlugin", package: "package-benchmark")
]
),
]