Skip to content

Commit

Permalink
Add support for skiping tests on Linux with Sourcery
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofabri committed Jul 17, 2017
1 parent 6022985 commit 4e5d1b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .sourcery/LinuxMain.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import XCTest
{% for type in types.classes|based:"XCTestCase" %}
extension {{ type.name }} {
static var allTests: [(String, ({{ type.name }}) -> () throws -> Void)] = [
{% for method in type.methods where method.parameters.count == 0 and method.shortName|hasPrefix:"test" %} ("{{ method.shortName }}", {{ method.shortName }}){% if not forloop.last %},{% endif %}
{% for method in type.methods where method.parameters.count == 0 and method.shortName|hasPrefix:"test" and method|!annotated:"skipTestOnLinux" %} ("{{ method.shortName }}", {{ method.shortName }}){% if not forloop.last %},{% endif %}
{% endfor %}]
}

Expand Down
1 change: 0 additions & 1 deletion Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ extension CustomRulesTests {
static var allTests: [(String, (CustomRulesTests) -> () throws -> Void)] = [
("testCustomRuleConfigurationSetsCorrectly", testCustomRuleConfigurationSetsCorrectly),
("testCustomRuleConfigurationThrows", testCustomRuleConfigurationThrows),
("testCustomRuleConfigurationIgnoreInvalidRules", testCustomRuleConfigurationIgnoreInvalidRules),
("testCustomRules", testCustomRules),
("testLocalDisableCustomRule", testLocalDisableCustomRule),
("testLocalDisableCustomRuleWithMultipleRules", testLocalDisableCustomRuleWithMultipleRules),
Expand Down
2 changes: 2 additions & 0 deletions Tests/SwiftLintFrameworkTests/CustomRulesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class CustomRulesTests: XCTestCase {
}
}

// sourcery: skipTestOnLinux
// (check https://bugs.swift.org/browse/SR-5477)
func testCustomRuleConfigurationIgnoreInvalidRules() throws {
let configDict = ["my_custom_rule": ["name": "MyCustomRule",
"message": "Message",
Expand Down

0 comments on commit 4e5d1b2

Please sign in to comment.