Skip to content

Commit 5ce04c8

Browse files
committed
Move benchmarks into separate test target
1 parent 474f417 commit 5ce04c8

6 files changed

Lines changed: 135 additions & 14 deletions

File tree

.travis.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ jobs:
66
osx_image: xcode9.4
77
script:
88
- swift build
9-
- swift test --filter BitByteDataTests.ByteReaderTests
10-
- swift test --filter BitByteDataTests.LsbBitReaderTests
11-
- swift test --filter BitByteDataTests.MsbBitReaderTests
12-
- swift test --filter BitByteDataTests.LsbBitWriterTests
13-
- swift test --filter BitByteDataTests.MsbBitWriterTests
9+
- swift test --filter BitByteDataTests
1410
- swift build -c release # Check Release build just in case.
1511
- language: generic
1612
os: linux
@@ -19,26 +15,22 @@ jobs:
1915
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
2016
script:
2117
- swift build
22-
- swift test --filter BitByteDataTests.ByteReaderTests
23-
- swift test --filter BitByteDataTests.LsbBitReaderTests
24-
- swift test --filter BitByteDataTests.MsbBitReaderTests
25-
- swift test --filter BitByteDataTests.LsbBitWriterTests
26-
- swift test --filter BitByteDataTests.MsbBitWriterTests
18+
- swift test --filter BitByteDataTests
2719
- swift build -c release # Check Release build just in case.
2820
- stage: benchmark
2921
if: NOT (tag IS present)
3022
language: swift
3123
os: osx
3224
osx_image: xcode9.4
3325
script:
34-
- swift test -c release -Xswiftc -enable-testing --filter BitByteDataTests.ByteReaderBenchmarks
26+
- swift test -c release -Xswiftc -enable-testing --filter BitByteDataBenchmarks
3527
- language: generic
3628
os: linux
3729
dist: trusty
3830
install:
3931
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
4032
script:
41-
- swift test -c release -Xswiftc -enable-testing --filter BitByteDataTests.ByteReaderBenchmarks
33+
- swift test -c release -Xswiftc -enable-testing --filter BitByteDataBenchmarks
4234
- stage: deploy
4335
if: tag IS present
4436
language: generic
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.2.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>13</string>
21+
</dict>
22+
</plist>

BitByteData.xcodeproj/project.pbxproj

Lines changed: 105 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
065DD5E421673BC100704028 /* BitByteData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06F0656C1FFAEA4B00312A82 /* BitByteData.framework */; };
1011
06ADF4CB214BB86600B8F0E9 /* ByteReaderBenchmarks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06ADF4CA214BB86600B8F0E9 /* ByteReaderBenchmarks.swift */; };
1112
06F065751FFAEA8700312A82 /* LsbBitReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06F065571FFAEA1F00312A82 /* LsbBitReader.swift */; };
1213
06F065761FFAEA8700312A82 /* BitReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06F065581FFAEA1F00312A82 /* BitReader.swift */; };
@@ -25,6 +26,13 @@
2526
/* End PBXBuildFile section */
2627

2728
/* Begin PBXContainerItemProxy section */
29+
065DD5E521673BC100704028 /* PBXContainerItemProxy */ = {
30+
isa = PBXContainerItemProxy;
31+
containerPortal = 06F065501FFAE9EC00312A82 /* Project object */;
32+
proxyType = 1;
33+
remoteGlobalIDString = 06F0656B1FFAEA4B00312A82;
34+
remoteInfo = BitByteData;
35+
};
2836
06F065871FFAEAA000312A82 /* PBXContainerItemProxy */ = {
2937
isa = PBXContainerItemProxy;
3038
containerPortal = 06F065501FFAE9EC00312A82 /* Project object */;
@@ -36,6 +44,7 @@
3644

3745
/* Begin PBXFileReference section */
3846
062BE3301FFBB9E300343CAD /* LinuxMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinuxMain.swift; sourceTree = "<group>"; };
47+
065DD5DF21673BC100704028 /* BitByteDataBenchmarks.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BitByteDataBenchmarks.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3948
06ADF4CA214BB86600B8F0E9 /* ByteReaderBenchmarks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ByteReaderBenchmarks.swift; sourceTree = "<group>"; };
4049
06F065571FFAEA1F00312A82 /* LsbBitReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LsbBitReader.swift; sourceTree = "<group>"; };
4150
06F065581FFAEA1F00312A82 /* BitReader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BitReader.swift; sourceTree = "<group>"; };
@@ -55,6 +64,14 @@
5564
/* End PBXFileReference section */
5665

5766
/* Begin PBXFrameworksBuildPhase section */
67+
065DD5DC21673BC100704028 /* Frameworks */ = {
68+
isa = PBXFrameworksBuildPhase;
69+
buildActionMask = 2147483647;
70+
files = (
71+
065DD5E421673BC100704028 /* BitByteData.framework in Frameworks */,
72+
);
73+
runOnlyForDeploymentPostprocessing = 0;
74+
};
5875
06F0657E1FFAEAA000312A82 /* Frameworks */ = {
5976
isa = PBXFrameworksBuildPhase;
6077
buildActionMask = 2147483647;
@@ -66,6 +83,14 @@
6683
/* End PBXFrameworksBuildPhase section */
6784

6885
/* Begin PBXGroup section */
86+
065DD5E021673BC100704028 /* BitByteDataBenchmarks */ = {
87+
isa = PBXGroup;
88+
children = (
89+
06ADF4CA214BB86600B8F0E9 /* ByteReaderBenchmarks.swift */,
90+
);
91+
path = BitByteDataBenchmarks;
92+
sourceTree = "<group>";
93+
};
6994
06F0654F1FFAE9EC00312A82 = {
7095
isa = PBXGroup;
7196
children = (
@@ -93,6 +118,7 @@
93118
06F0655F1FFAEA1F00312A82 /* Tests */ = {
94119
isa = PBXGroup;
95120
children = (
121+
065DD5E021673BC100704028 /* BitByteDataBenchmarks */,
96122
06F065611FFAEA1F00312A82 /* BitByteDataTests */,
97123
062BE3301FFBB9E300343CAD /* LinuxMain.swift */,
98124
);
@@ -107,7 +133,6 @@
107133
06F065631FFAEA1F00312A82 /* MsbBitReaderTests.swift */,
108134
06F065641FFAEA1F00312A82 /* LsbBitWriterTests.swift */,
109135
06F065621FFAEA1F00312A82 /* MsbBitWriterTests.swift */,
110-
06ADF4CA214BB86600B8F0E9 /* ByteReaderBenchmarks.swift */,
111136
);
112137
path = BitByteDataTests;
113138
sourceTree = "<group>";
@@ -117,13 +142,31 @@
117142
children = (
118143
06F0656C1FFAEA4B00312A82 /* BitByteData.framework */,
119144
06F065811FFAEAA000312A82 /* TestBitByteData.xctest */,
145+
065DD5DF21673BC100704028 /* BitByteDataBenchmarks.xctest */,
120146
);
121147
name = Products;
122148
sourceTree = "<group>";
123149
};
124150
/* End PBXGroup section */
125151

126152
/* Begin PBXNativeTarget section */
153+
065DD5DE21673BC100704028 /* BitByteDataBenchmarks */ = {
154+
isa = PBXNativeTarget;
155+
buildConfigurationList = 065DD5E921673BC100704028 /* Build configuration list for PBXNativeTarget "BitByteDataBenchmarks" */;
156+
buildPhases = (
157+
065DD5DB21673BC100704028 /* Sources */,
158+
065DD5DC21673BC100704028 /* Frameworks */,
159+
);
160+
buildRules = (
161+
);
162+
dependencies = (
163+
065DD5E621673BC100704028 /* PBXTargetDependency */,
164+
);
165+
name = BitByteDataBenchmarks;
166+
productName = BitByteDataBenchmarks;
167+
productReference = 065DD5DF21673BC100704028 /* BitByteDataBenchmarks.xctest */;
168+
productType = "com.apple.product-type.bundle.unit-test";
169+
};
127170
06F0656B1FFAEA4B00312A82 /* BitByteData */ = {
128171
isa = PBXNativeTarget;
129172
buildConfigurationList = 06F065721FFAEA4C00312A82 /* Build configuration list for PBXNativeTarget "BitByteData" */;
@@ -166,6 +209,9 @@
166209
LastUpgradeCheck = 0930;
167210
ORGANIZATIONNAME = "Timofey Solomko";
168211
TargetAttributes = {
212+
065DD5DE21673BC100704028 = {
213+
CreatedOnToolsVersion = 10.0;
214+
};
169215
06F0656B1FFAEA4B00312A82 = {
170216
CreatedOnToolsVersion = 9.2;
171217
ProvisioningStyle = Manual;
@@ -190,11 +236,19 @@
190236
targets = (
191237
06F0656B1FFAEA4B00312A82 /* BitByteData */,
192238
06F065801FFAEAA000312A82 /* TestBitByteData */,
239+
065DD5DE21673BC100704028 /* BitByteDataBenchmarks */,
193240
);
194241
};
195242
/* End PBXProject section */
196243

197244
/* Begin PBXSourcesBuildPhase section */
245+
065DD5DB21673BC100704028 /* Sources */ = {
246+
isa = PBXSourcesBuildPhase;
247+
buildActionMask = 2147483647;
248+
files = (
249+
);
250+
runOnlyForDeploymentPostprocessing = 0;
251+
};
198252
06F065671FFAEA4B00312A82 /* Sources */ = {
199253
isa = PBXSourcesBuildPhase;
200254
buildActionMask = 2147483647;
@@ -226,6 +280,11 @@
226280
/* End PBXSourcesBuildPhase section */
227281

228282
/* Begin PBXTargetDependency section */
283+
065DD5E621673BC100704028 /* PBXTargetDependency */ = {
284+
isa = PBXTargetDependency;
285+
target = 06F0656B1FFAEA4B00312A82 /* BitByteData */;
286+
targetProxy = 065DD5E521673BC100704028 /* PBXContainerItemProxy */;
287+
};
229288
06F065881FFAEAA000312A82 /* PBXTargetDependency */ = {
230289
isa = PBXTargetDependency;
231290
target = 06F0656B1FFAEA4B00312A82 /* BitByteData */;
@@ -234,6 +293,42 @@
234293
/* End PBXTargetDependency section */
235294

236295
/* Begin XCBuildConfiguration section */
296+
065DD5E721673BC100704028 /* Debug */ = {
297+
isa = XCBuildConfiguration;
298+
buildSettings = {
299+
COPY_PHASE_STRIP = NO;
300+
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteDataBenchmarks.plist;
301+
LD_RUNPATH_SEARCH_PATHS = (
302+
"$(inherited)",
303+
"@loader_path/Frameworks",
304+
"@executable_path/Frameworks",
305+
"@loader_path/../Frameworks",
306+
"@executable_path/../Frameworks",
307+
);
308+
PRODUCT_BUNDLE_IDENTIFIER = me.tsolomko.BitByteDataBenchmarks;
309+
PRODUCT_NAME = "$(TARGET_NAME)";
310+
SWIFT_VERSION = 4.2;
311+
};
312+
name = Debug;
313+
};
314+
065DD5E821673BC100704028 /* Release */ = {
315+
isa = XCBuildConfiguration;
316+
buildSettings = {
317+
COPY_PHASE_STRIP = NO;
318+
INFOPLIST_FILE = BitByteData.xcodeproj/BitByteDataBenchmarks.plist;
319+
LD_RUNPATH_SEARCH_PATHS = (
320+
"$(inherited)",
321+
"@loader_path/Frameworks",
322+
"@executable_path/Frameworks",
323+
"@loader_path/../Frameworks",
324+
"@executable_path/../Frameworks",
325+
);
326+
PRODUCT_BUNDLE_IDENTIFIER = me.tsolomko.BitByteDataBenchmarks;
327+
PRODUCT_NAME = "$(TARGET_NAME)";
328+
SWIFT_VERSION = 4.2;
329+
};
330+
name = Release;
331+
};
237332
06F065541FFAE9EC00312A82 /* Debug */ = {
238333
isa = XCBuildConfiguration;
239334
buildSettings = {
@@ -413,6 +508,15 @@
413508
/* End XCBuildConfiguration section */
414509

415510
/* Begin XCConfigurationList section */
511+
065DD5E921673BC100704028 /* Build configuration list for PBXNativeTarget "BitByteDataBenchmarks" */ = {
512+
isa = XCConfigurationList;
513+
buildConfigurations = (
514+
065DD5E721673BC100704028 /* Debug */,
515+
065DD5E821673BC100704028 /* Release */,
516+
);
517+
defaultConfigurationIsVisible = 0;
518+
defaultConfigurationName = Release;
519+
};
416520
06F065531FFAE9EC00312A82 /* Build configuration list for PBXProject "BitByteData" */ = {
417521
isa = XCConfigurationList;
418522
buildConfigurations = (

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ let package = Package(
1010
],
1111
targets: [
1212
.target(name: "BitByteData", path: "Sources"),
13-
.testTarget(name: "BitByteDataTests", dependencies: ["BitByteData"])
13+
.testTarget(name: "BitByteDataTests", dependencies: ["BitByteData"]),
14+
.testTarget(name: "BitByteDataBenchmarks", dependencies: ["BitByteData"])
1415
],
1516
swiftLanguageVersions: [4]
1617
)
File renamed without changes.

Tests/LinuxMain.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import XCTest
77
@testable import BitByteDataTests
8+
@testable import BitByteDataBenchmarks
89

910
extension ByteReaderTests {
1011
static var allTests: [(String, (ByteReaderTests) -> () -> Void)] {
@@ -130,5 +131,6 @@ XCTMain([
130131
testCase(MsbBitReaderTests.allTests),
131132
testCase(LsbBitWriterTests.allTests),
132133
testCase(MsbBitWriterTests.allTests),
134+
133135
testCase(ByteReaderBenchmarks.allTests)
134136
])

0 commit comments

Comments
 (0)