-
Notifications
You must be signed in to change notification settings - Fork 1
/
Package.swift
121 lines (107 loc) · 3.83 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
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
name: "PackageBenchmarkSamples",
platforms: [.macOS(.v13)],
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",
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",
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"),
]
)
]
)