Simplify writing test providers in framework tests
This commit is contained in:
committed by
SvyatoslavScherbina
parent
7b187aa169
commit
d75ddfdaf4
@@ -188,6 +188,18 @@ protocol TestProvider {
|
||||
var tests: [TestCase] { get }
|
||||
}
|
||||
|
||||
class SimpleTestProvider : TestProvider {
|
||||
var tests: [TestCase] = []
|
||||
|
||||
init() {
|
||||
providers.append(self)
|
||||
}
|
||||
|
||||
func test(_ name: String, _ method: @escaping () throws -> Void) {
|
||||
tests.append(TestCase(name: name, method: withAutorelease(method)))
|
||||
}
|
||||
}
|
||||
|
||||
var providers: [TestProvider] = []
|
||||
|
||||
private func execute(tests: [TestCase]) {
|
||||
|
||||
Reference in New Issue
Block a user