Skip to content

Commit 3583c90

Browse files
committed
Run VariantPerformanceTests on Linux
1 parent 347cc4b commit 3583c90

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

Source/SourceKittenFramework/SourceKitVariant.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ extension SourceKitVariant {
442442

443443
// MARK: - Custom
444444
extension SourceKitVariant {
445-
var attributes: [SourceKitVariant]? { return self["key.attributes"]?.array }
446-
var attribute: SourceKitVariant? { return self["key.attribute"] }
445+
public var attributes: [SourceKitVariant]? { return self["key.attributes"]?.array }
446+
public var attribute: SourceKitVariant? { return self["key.attribute"] }
447447
}
448448

449449
// MARK: - sourcekitd_variant_*_apply

Tests/LinuxMain.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ XCTMain([
1313
testCase(StructureTests.allTests),
1414
// testCase(SwiftDocsTests.allTests),
1515
testCase(SyntaxTests.allTests),
16+
testCase(VariantPerformanceTests.allTests),
1617
])

Tests/SourceKittenFrameworkTests/VariantPerformanceTests.swift

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
// VariantPerformanceTests.swift
33
// SourceKitten
44
//
5-
// Created by 野村 憲男 on 10/17/16.
5+
// Created by Norio Nomura on 10/17/16.
66
// Copyright © 2016 SourceKitten. All rights reserved.
77
//
88

9+
import Foundation
10+
import SourceKittenFramework
911
import XCTest
10-
@testable import SourceKittenFramework
12+
1113
let srcURL = URL(fileURLWithPath: #file)
1214
.deletingLastPathComponent()
1315
.deletingLastPathComponent()
@@ -128,3 +130,17 @@ class VariantPerformanceTests: XCTestCase {
128130
}
129131
}
130132

133+
extension VariantPerformanceTests {
134+
static var allTests: [(String, (VariantPerformanceTests) -> () throws -> Void)] {
135+
return [
136+
("testEditorOpenJSONWithDictionary", testEditorOpenJSONWithDictionary),
137+
("testEditorOpenJSONWithVariant", testEditorOpenJSONWithVariant),
138+
("testIndexJSONWithDictionary", testIndexJSONWithDictionary),
139+
("testIndexJSONWithVariant", testIndexJSONWithVariant),
140+
("testRequestEditorOpenWithDictionary", testRequestEditorOpenWithDictionary),
141+
("testRequestEditorOpenWithVariant", testRequestEditorOpenWithVariant),
142+
("testFindAvailablesWithDictionary", testFindAvailablesWithDictionary),
143+
("testFindAvailablesWithVariant", testFindAvailablesWithVariant),
144+
]
145+
}
146+
}

0 commit comments

Comments
 (0)