Skip to content

Commit 6cf76d0

Browse files
author
Ferran Pujol Camins
committed
Add performance tests to CI
1 parent e749ac1 commit 6cf76d0

File tree

7 files changed

+18
-3
lines changed

7 files changed

+18
-3
lines changed

BuildScripts/linux_script.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
2-
swift build
3-
swift test
2+
swift test -c debug --filter "SwiftGraphTests"
3+
swift test -c release -Xswiftc -enable-testing --filter "SwiftGraphPerformanceTests"

BuildScripts/osx_script.sh

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
set -v -o pipefail
44
# Test
55
xcodebuild -enableCodeCoverage YES -project SwiftGraph.xcodeproj -scheme SwiftGraph test | xcpretty
6+
xcodebuild -enableCodeCoverage NO -project SwiftGraph.xcodeproj -scheme SwiftGraphPerformanceTests test | xcpretty

SwiftGraph.xcodeproj/project.pbxproj

+1
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@
916916
SKIP_INSTALL = YES;
917917
SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator";
918918
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
919+
SWIFT_COMPILATION_MODE = wholemodule;
919920
SWIFT_VERSION = 4.2;
920921
VERSIONING_SYSTEM = "apple-generic";
921922
VERSION_INFO_PREFIX = "";

Tests/LinuxMain.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import XCTest
22
@testable import SwiftGraphTests
3+
@testable import SwiftGraphPerformanceTests
34

45
XCTMain([
56
testCase(DijkstraGraphTests.allTests),
@@ -13,5 +14,8 @@ XCTMain([
1314
testCase(UniqueElementsGraphInitTests.allTests),
1415
testCase(UnionTests.allTests),
1516
testCase(SwiftGraphCodableTests.allTests),
16-
testCase(ConstructorsTests.allTests)
17+
testCase(ConstructorsTests.allTests),
18+
19+
testCase(SearchPerformanceTests.allTests),
20+
testCase(ConstructorsPerformanceTests.allTests),
1721
])

Tests/SwiftGraphPerformanceTests/ConstructorsPerformanceTests.swift

+5
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ class ConstructorsPerformanceTests: XCTestCase {
3131
_ = CompleteGraph.build(withVertices: Array(0...1999))
3232
}
3333
}
34+
35+
static var allTests = [
36+
("testStarGraphConstructor", testStarGraphConstructor),
37+
("testCompleteGraphConstructor", testCompleteGraphConstructor),
38+
]
3439
}

Tests/SwiftGraphPerformanceTests/SearchPerformanceTests.swift

+4
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,8 @@ class SearchPerformanceTests: XCTestCase {
2626
_ = g.dfs(from: 0, goalTest: { _ in false })
2727
}
2828
}
29+
30+
static var allTests = [
31+
("testDfsInStarGraph", testDfsInStarGraph),
32+
]
2933
}

0 commit comments

Comments
 (0)