[package]
name = "tests"
version = "0.0.1"
edition = "2018"
publish = false

[[test]]
name = "failpoints"
path = "failpoints/mod.rs"
required-features = ["failpoints"]

[[test]]
name = "integrations"
path = "integrations/mod.rs"
required-features = ["testexport"]

[[bench]]
name = "raftstore"
harness = false
path = "benches/raftstore/mod.rs"

[[bench]]
name = "coprocessor_executors"
harness = false
path = "benches/coprocessor_executors/mod.rs"

[[bench]]
name = "hierarchy"
harness = false
path = "benches/hierarchy/mod.rs"

[[bench]]
name = "misc"
path = "benches/misc/mod.rs"
test = true

[[bench]]
name = "deadlock_detector"
harness = false
path = "benches/deadlock_detector/mod.rs"

[[bench]]
name = "channel"
path = "benches/channel/mod.rs"
test = true

[features]
default = ["failpoints", "testexport", "protobuf-codec"]
failpoints = ["fail/failpoints", "tikv/failpoints"]
testexport = ["raftstore/testexport", "tikv/testexport"]
profiling = ["profiler/profiling"]
protobuf-codec = [
  "engine/protobuf-codec",
  "grpcio/protobuf-codec",
  "kvproto/protobuf-codec",
  "pd_client/protobuf-codec",
  "raft/protobuf-codec",
  "raftstore/protobuf-codec",
  "tikv/protobuf-codec",
  "tidb_query/protobuf-codec",
  "tipb/protobuf-codec",
  "txn_types/protobuf-codec",
  "cdc/protobuf-codec",
]
prost-codec = [
  "engine/prost-codec",
  "grpcio/prost-codec",
  "kvproto/prost-codec",
  "pd_client/prost-codec",
  "raft/prost-codec",
  "raftstore/prost-codec",
  "tikv/prost-codec",
  "tidb_query/prost-codec",
  "tipb/prost-codec",
  "txn_types/prost-codec",
  "cdc/prost-codec",
]
jemalloc = ["tikv/jemalloc"]
mem-profiling = ["tikv/mem-profiling"]
sse = ["tikv/sse"]
portable = ["tikv/portable"]

[dependencies]
fail = "0.4"
batch-system = { path = "../components/batch-system" }
crc64fast = "0.1"
crossbeam = "0.8"
configuration = { path = "../components/configuration" }
encryption = { path = "../components/encryption" }
engine = { path = "../components/engine" }
cdc = { path = "../components/cdc" }
futures = "0.1"
futures-cpupool = "0.1"
futures03 = { package = "futures", version = "0.3", features = ["executor"] }
grpcio = { version = "0.5", default-features = false, features = ["openssl-vendored"] }
hex = "0.4"
kvproto = { git = "https://github.com/pingcap/kvproto.git", branch = "release-4.0", default-features = false }
log_wrappers = { path = "../components/log_wrappers" }
pd_client = { path = "../components/pd_client" }
protobuf = "2.8"
raft = { version = "0.6.0-alpha", default-features = false }
raftstore = { path = "../components/raftstore" }
rand = "0.7.3"
slog = { version = "2.3", features = ["max_level_trace", "release_max_level_debug"] }
slog-global = { version = "0.1", git = "https://github.com/breeswish/slog-global.git", rev = "0e23a5baff302a9d7bccd85f8f31e43339c2f2c1" }
tempfile = "3.0"
tidb_query = { path = "../components/tidb_query" }
tikv = { path = "../", default-features = false }
tikv_util = { path = "../components/tikv_util" }
error_code = { path = "../components/error_code" }
tipb = { git = "https://github.com/pingcap/tipb.git", default-features = false }
tokio-threadpool = "0.1.13"
toml = "0.4"
txn_types = { path = "../components/txn_types" }
uuid = { version = "0.8.1", features = ["serde", "v4"] }

[dev-dependencies]
# See https://bheisler.github.io/criterion.rs/book/user_guide/known_limitations.html for the usage
# of `real_blackbox` feature.
criterion = "0.3"
criterion-cpu-time = "0.1"
arrow = "0.10.0"
rand_xorshift = "0.2"

engine_rocks = { path = "../components/engine_rocks" }
engine_traits = { path = "../components/engine_traits" }
external_storage = { path = "../components/external_storage" }
hyper = { version = "0.13", default-features = false, features = ["runtime"] }
keys = { path = "../components/keys" }
profiler = { path = "../components/profiler" }
panic_hook = { path = "../components/panic_hook" }
security = { path = "../components/security" }
sst_importer = {path = "../components/sst_importer" }
tipb_helper = { path = "../components/tipb_helper" }
tidb_query_datatype = { path = "../components/tidb_query_datatype" }
test_util = { path = "../components/test_util" }
test_storage = { path = "../components/test_storage" }
test_coprocessor = { path = "../components/test_coprocessor" }
test_sst_importer = { path = "../components/test_sst_importer" }
test_raftstore = { path = "../components/test_raftstore" }
test_pd = { path = "../components/test_pd" }
byteorder = "1.2"
serde_json = "1.0"
tokio = { version = "0.2", features = ["rt-core"] }

[target.'cfg(target_os = "linux")'.dev-dependencies]
criterion-papi = "0.1"
