-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests on Linux & configure sourcery to automate this
- Loading branch information
Showing
3 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@testable import AnyLintTests | ||
@testable import Utility | ||
import XCTest | ||
|
||
// swiftlint:disable line_length file_length | ||
|
||
{% 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" and method|!annotated:"skipTestOnLinux" %} ("{{ method.shortName }}", {{ method.shortName }}){% if not forloop.last %},{% endif %} | ||
{% endfor %}] | ||
} | ||
|
||
{% endfor %} | ||
XCTMain([ | ||
{% for type in types.classes|based:"XCTestCase" %} testCase({{ type.name }}.allTests){% if not forloop.last %},{% endif %} | ||
{% endfor %}]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Generated using Sourcery 0.17.0 — https://github.com/krzysztofzablocki/Sourcery | ||
// DO NOT EDIT | ||
|
||
@testable import AnyLintTests | ||
@testable import Utility | ||
import XCTest | ||
|
||
// swiftlint:disable line_length file_length | ||
|
||
extension AnyLintCLITests { | ||
static var allTests: [(String, (AnyLintCLITests) -> () throws -> Void)] = [ | ||
("testExample", testExample) | ||
] | ||
} | ||
|
||
extension AutoCorrectionTests { | ||
static var allTests: [(String, (AutoCorrectionTests) -> () throws -> Void)] = [ | ||
("testInitWithDictionaryLiteral", testInitWithDictionaryLiteral) | ||
] | ||
} | ||
|
||
extension CheckInfoTests { | ||
static var allTests: [(String, (CheckInfoTests) -> () throws -> Void)] = [ | ||
("testInitWithStringLiteral", testInitWithStringLiteral) | ||
] | ||
} | ||
|
||
extension FileContentsCheckerTests { | ||
static var allTests: [(String, (FileContentsCheckerTests) -> () throws -> Void)] = [ | ||
("testPerformCheck", testPerformCheck) | ||
] | ||
} | ||
|
||
extension FilePathsCheckerTests { | ||
static var allTests: [(String, (FilePathsCheckerTests) -> () throws -> Void)] = [ | ||
("testPerformCheck", testPerformCheck) | ||
] | ||
} | ||
|
||
extension FilesSearchTests { | ||
static var allTests: [(String, (FilesSearchTests) -> () throws -> Void)] = [ | ||
("testAllFilesWithinPath", testAllFilesWithinPath) | ||
] | ||
} | ||
|
||
extension LintTests { | ||
static var allTests: [(String, (LintTests) -> () throws -> Void)] = [ | ||
("testValidateRegexMatchesForEach", testValidateRegexMatchesForEach), | ||
("testValidateRegexDoesNotMatchAny", testValidateRegexDoesNotMatchAny), | ||
("testValidateAutocorrectsAllExamplesWithAnonymousGroups", testValidateAutocorrectsAllExamplesWithAnonymousGroups), | ||
("testValidateAutocorrectsAllExamplesWithNamedGroups", testValidateAutocorrectsAllExamplesWithNamedGroups) | ||
] | ||
} | ||
|
||
extension LoggerTests { | ||
static var allTests: [(String, (LoggerTests) -> () throws -> Void)] = [ | ||
("testMessage", testMessage) | ||
] | ||
} | ||
|
||
extension RegexExtTests { | ||
static var allTests: [(String, (RegexExtTests) -> () throws -> Void)] = [ | ||
("testInitWithStringLiteral", testInitWithStringLiteral), | ||
("testInitWithDictionaryLiteral", testInitWithDictionaryLiteral), | ||
("testStringLiteralInit", testStringLiteralInit) | ||
] | ||
} | ||
|
||
extension StatisticsTests { | ||
static var allTests: [(String, (StatisticsTests) -> () throws -> Void)] = [ | ||
("testFoundViolationsInCheck", testFoundViolationsInCheck), | ||
("testLogSummary", testLogSummary) | ||
] | ||
} | ||
|
||
extension ViolationTests { | ||
static var allTests: [(String, (ViolationTests) -> () throws -> Void)] = [ | ||
("testLocationMessage", testLocationMessage) | ||
] | ||
} | ||
|
||
XCTMain([ | ||
testCase(AnyLintCLITests.allTests), | ||
testCase(AutoCorrectionTests.allTests), | ||
testCase(CheckInfoTests.allTests), | ||
testCase(FileContentsCheckerTests.allTests), | ||
testCase(FilePathsCheckerTests.allTests), | ||
testCase(FilesSearchTests.allTests), | ||
testCase(LintTests.allTests), | ||
testCase(LoggerTests.allTests), | ||
testCase(RegexExtTests.allTests), | ||
testCase(StatisticsTests.allTests), | ||
testCase(ViolationTests.allTests) | ||
]) |