Commit 611cc4eb authored by Nathan Harris's avatar Nathan Harris

Use `swift test --generate-linuxmain` to handle index of unit tests

Motivation:

A handful of times, unit tests were forgotten to be added to the `allTests` extension, or were incorrectly copy/pasted.

Modifications:

Remove manual entries of `allTest` and use generated result from `swift test --generate-linuxmain`

Result:

There should be proper test parity between macOS and Linux.
parent 6791ba80
Pipeline #70818954 passed with stages
in 6 minutes and 32 seconds
//===----------------------------------------------------------------------===//
//
// This source file is part of the RediStack open source project
//
// Copyright (c) 2019 RediStack project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of RediStack project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//
import XCTest
import RediStackTests
var tests = [XCTestCaseEntry]()
tests += RediStackTests.allTests()
tests += RediStackTests.__allTests()
XCTMain(tests)
......@@ -300,21 +300,6 @@ extension RedisByteDecoderTests {
}
}
extension RedisByteDecoderTests {
static var allTests = [
("testErrors", testErrors),
("testSimpleStrings", testSimpleStrings),
("testIntegers", testIntegers),
("testBulkStrings", testBulkStrings),
("testArrays", testArrays),
("testAll", testAll),
("test_partial_needsMoreData", test_partial_needsMoreData),
("test_badMessage_throws", test_badMessage_throws),
("test_complete_continues", test_complete_continues),
("test_complete_movesReaderIndex", test_complete_movesReaderIndex),
]
}
extension RedisError: Equatable {
public static func == (lhs: RedisError, rhs: RedisError) -> Bool {
return lhs.message == rhs.message
......
......@@ -113,14 +113,3 @@ final class RedisMessageEncoderTests: XCTestCase {
validation(buffer)
}
}
extension RedisMessageEncoderTests {
static var allTests = [
("testSimpleStrings", testSimpleStrings),
("testBulkStrings", testBulkStrings),
("testIntegers", testIntegers),
("testArrays", testArrays),
("testError", testError),
("testNull", testNull),
]
}
......@@ -111,14 +111,4 @@ final class BasicCommandsTests: RedisIntegrationTestCase {
XCTAssertGreaterThanOrEqual(keys.count, 1)
XCTAssertLessThanOrEqual(keys.count, 7)
}
static var allTests = [
("test_select", test_select),
("test_expire", test_expire),
("test_delete", test_delete),
("test_ping", test_ping),
("test_echo", test_echo),
("test_swapDatabase", test_swapDatabase),
("test_scan", test_scan),
]
}
......@@ -160,22 +160,4 @@ final class HashCommandsTests: RedisIntegrationTestCase {
XCTAssertGreaterThanOrEqual(fields.count, 1)
XCTAssertLessThanOrEqual(fields.count, 7)
}
static var allTests = [
("test_hset", test_hset),
("test_hmset", test_hmset),
("test_hsetnx", test_hsetnx),
("test_hget", test_hget),
("test_hmget", test_hmget),
("test_hgetall", test_hgetall),
("test_hdel", test_hdel),
("test_hexists", test_hexists),
("test_hlen", test_hlen),
("test_hstrlen", test_hstrlen),
("test_hkeys", test_hkeys),
("test_hvals", test_hvals),
("test_hincrby", test_hincrby),
("test_hincrbyfloat", test_hincrbyfloat),
("test_hscan", test_hscan),
]
}
......@@ -236,23 +236,4 @@ final class ListCommandsTests: RedisIntegrationTestCase {
.wait()
XCTAssertEqual(element, 10)
}
static var allTests = [
("test_llen", test_llen),
("test_lindex", test_lindex),
("test_lset", test_lset),
("test_lrem", test_lrem),
("test_lrange", test_lrange),
("test_rpoplpush", test_rpoplpush),
("test_brpoplpush", test_brpoplpush),
("test_linsert", test_linsert),
("test_lpop", test_lpop),
("test_blpop", test_blpop),
("test_lpush", test_lpush),
("test_lpushx", test_lpushx),
("test_rpop", test_rpop),
("test_brpop", test_brpop),
("test_rpush", test_rpush),
("test_rpushx", test_rpushx),
]
}
......@@ -252,22 +252,4 @@ final class SetCommandsTests: RedisIntegrationTestCase {
XCTAssertGreaterThanOrEqual(results.count, 1)
XCTAssertLessThanOrEqual(results.count, 3)
}
static var allTests = [
("test_sadd", test_sadd),
("test_smembers", test_smembers),
("test_sismember", test_sismember),
("test_scard", test_scard),
("test_srem", test_srem),
("test_spop", test_spop),
("test_srandmember", test_srandmember),
("test_sdiff", test_sdiff),
("test_sdiffstore", test_sdiffstore),
("test_sinter", test_sinter),
("test_sinterstore", test_sinterstore),
("test_smove", test_smove),
("test_sunion", test_sunion),
("test_sunionstore", test_sunionstore),
("test_sscan", test_sscan),
]
}
......@@ -381,32 +381,4 @@ final class SortedSetCommandsTests: RedisIntegrationTestCase {
count = try connection.zremrangebyscore(within: ("-inf", "+inf"), from: key).wait()
XCTAssertEqual(count, 5)
}
static var allTests = [
("test_zadd", test_zadd),
("test_zcard", test_zcard),
("test_zscore", test_zscore),
("test_zscan", test_zscan),
("test_zrank", test_zrank),
("test_zrevrank", test_zrevrank),
("test_zcount", test_zcount),
("test_zlexcount", test_zlexcount),
("test_zpopmin", test_zpopmin),
("test_bzpopmin", test_bzpopmin),
("test_zpopmax", test_zpopmax),
("test_bzpopmax", test_bzpopmax),
("test_zincrby", test_zincrby),
("test_zunionstore", test_zunionstore),
("test_zinterstore", test_zinterstore),
("test_zrange", test_zrange),
("test_zrevrange", test_zrevrange),
("test_zrangebyscore", test_zrangebyscore),
("test_zrevrangebyscore", test_zrevrangebyscore),
("test_zrangebylex", test_zrangebylex),
("test_zrevrangebylex", test_zrevrangebylex),
("test_zrem", test_zrem),
("test_zremrangebylex", test_zremrangebylex),
("test_zremrangebyrank", test_zremrangebyrank),
("test_zremrangebyscore", test_zremrangebyscore),
]
}
......@@ -128,18 +128,4 @@ final class StringCommandsTests: RedisIntegrationTestCase {
result = try connection.decrement(#function, by: 0).wait()
XCTAssertEqual(result, 7)
}
static var allTests = [
("test_get", test_get),
("test_mget", test_mget),
("test_set", test_set),
("test_append", test_append),
("test_mset", test_mset),
("test_msetnx", test_msetnx),
("test_increment", test_increment),
("test_incrementBy", test_incrementBy),
("test_incrementByFloat", test_incrementByFloat),
("test_decrement", test_decrement),
("test_decrementBy", test_decrementBy),
]
}
......@@ -478,51 +478,3 @@ extension RESPTranslatorTests {
return result
}
}
// MARK: All Tests
extension RESPTranslatorTests {
static var allTests = [
("testWriting_simpleStrings", testWriting_simpleStrings),
("testWriting_bulkStrings", testWriting_bulkStrings),
("testWriting_integers", testWriting_integers),
("testWriting_arrays", testWriting_arrays),
("testWriting_errors", testWriting_errors),
("testWriting_null", testWriting_null),
("testWriting_foundationData", testWriting_foundationData),
("testParsing_invalidSymbols", testParsing_invalidSymbols),
("testParsing_simpleString", testParsing_simpleString),
("testParsing_simpleString_chunked", testParsing_simpleString_chunked),
("testParsing_integer", testParsing_integer),
("testParsing_integer_chunked", testParsing_integer_chunked),
("testParsing_bulkStrings", testParsing_bulkStrings),
("testParsing_bulkStrings_chunked", testParsing_bulkStrings_chunked),
("testParsing_arrays", testParsing_arrays),
("testParsing_arrays_chunked", testParsing_arrays_chunked),
("testParsing_error", testParsing_error),
("testParsing_simpleString_missingNewline", testParsing_simpleString_missingNewline),
("testParsing_simpleString_withNoContent", testParsing_simpleString_withNoContent),
("testParsing_simpleString_withContent", testParsing_simpleString_withContent),
("testParsing_simpleString_handlesRecursion", testParsing_simpleString_handlesRecursion),
("testParsing_integer_withAllBytes", testParsing_integer_withAllBytes),
("testParsing_integer_missingBytes", testParsing_integer_missingBytes),
("testParsing_integer_recursively", testParsing_integer_recursively),
("testParsing_bulkString_missingEndings", testParsing_bulkString_missingEndings),
("testParsing_bulkString_withNoSize", testParsing_bulkString_withNoSize),
("testParsing_bulkString_withContent", testParsing_bulkString_withContent),
("testParsing_bulkString_null", testParsing_bulkString_null),
("testParsing_bulkString_rawBytes", testParsing_bulkString_rawBytes),
("testParsing_bulkString_recursively", testParsing_bulkString_recursively),
("testParsing_array_whenNull", testParsing_array_whenNull),
("testParsing_array_whenEmpty", testParsing_array_whenEmpty),
("testParsing_array_withMixedTypes", testParsing_array_withMixedTypes),
("testParsing_array_withNullElements", testParsing_array_withNullElements),
("testParsing_array_nested", testParsing_array_nested),
("testParsing_array_recursively", testParsing_array_recursively),
]
}
......@@ -45,10 +45,4 @@ final class RedisConnectionTests: RedisIntegrationTestCase {
XCTAssertTrue(error is RedisClientError)
}
}
static var allTests = [
("test_unexpectedChannelClose", test_unexpectedChannelClose),
("test_callingCloseMultipleTimes", test_callingCloseMultipleTimes),
("test_sendingCommandAfterClosing", test_sendingCommandAfterClosing),
]
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment