forked from mirrors/jj
d66fcf2ca0
this greatly speeds up the time to run all tests, at the cost of slightly larger recompile times for individual tests. this unfortunately adds the requirement that all tests are listed in `runner.rs` for the crate. to avoid forgetting, i've added a new test that ensures the directory is in sync with the file. ## benchmarks before this change, recompiling all tests took 32-50 seconds and running a single test took 3.5 seconds: ``` ; hyperfine 'touch lib/src/lib.rs && cargo t --test test_working_copy' Time (mean ± σ): 3.543 s ± 0.168 s [User: 2.597 s, System: 1.262 s] Range (min … max): 3.400 s … 3.847 s 10 runs ``` after this change, recompiling all tests take 4 seconds: ``` ; hyperfine 'touch lib/src/lib.rs ; cargo t --test runner --no-run' Time (mean ± σ): 4.055 s ± 0.123 s [User: 3.591 s, System: 1.593 s] Range (min … max): 3.804 s … 4.159 s 10 runs ``` and running a single test takes about the same: ``` ; hyperfine 'touch lib/src/lib.rs && cargo t --test runner -- test_working_copy' Time (mean ± σ): 4.129 s ± 0.120 s [User: 3.636 s, System: 1.593 s] Range (min … max): 3.933 s … 4.346 s 10 runs ``` about 1.4 seconds of that is the time for the runner, of which .4 is the time for the linker. so there may be room for further improving the times.
99 lines
2.8 KiB
TOML
99 lines
2.8 KiB
TOML
[package]
|
|
name = "jj-cli"
|
|
description = "Jujutsu - an experimental version control system"
|
|
default-run = "jj"
|
|
autotests = false
|
|
|
|
version = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
license = { workspace = true }
|
|
homepage = { workspace = true }
|
|
repository = { workspace = true }
|
|
documentation = { workspace = true }
|
|
keywords = { workspace = true }
|
|
|
|
[[bin]]
|
|
name = "jj"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "fake-editor"
|
|
path = "testing/fake-editor.rs"
|
|
required-features = ["test-fakes"]
|
|
|
|
[[bin]]
|
|
name = "fake-diff-editor"
|
|
path = "testing/fake-diff-editor.rs"
|
|
required-features = ["test-fakes"]
|
|
|
|
[[test]]
|
|
name = "runner"
|
|
|
|
[build-dependencies]
|
|
cargo_metadata = { workspace = true }
|
|
|
|
[dependencies]
|
|
chrono = { workspace = true }
|
|
clap = { workspace = true }
|
|
clap-markdown = { workspace = true }
|
|
clap_complete = { workspace = true }
|
|
clap_mangen = { workspace = true }
|
|
config = { workspace = true }
|
|
criterion = { workspace = true, optional = true }
|
|
crossterm = { workspace = true }
|
|
dirs = { workspace = true }
|
|
esl01-renderdag = { workspace = true }
|
|
futures = { workspace = true }
|
|
git2 = { workspace = true }
|
|
gix = { workspace = true }
|
|
hex = { workspace = true }
|
|
indexmap = { workspace = true }
|
|
itertools = { workspace = true }
|
|
jj-lib = { workspace = true }
|
|
maplit = { workspace = true }
|
|
once_cell = { workspace = true }
|
|
pest = { workspace = true }
|
|
pest_derive = { workspace = true }
|
|
pollster = { workspace = true }
|
|
regex = { workspace = true }
|
|
rpassword = { workspace = true }
|
|
scm-record = { workspace = true }
|
|
serde = { workspace = true }
|
|
slab = { workspace = true }
|
|
tempfile = { workspace = true }
|
|
textwrap = { workspace = true }
|
|
thiserror = { workspace = true }
|
|
timeago = { workspace = true }
|
|
toml_edit = { workspace = true }
|
|
tracing = { workspace = true }
|
|
tracing-chrome = { workspace = true }
|
|
tracing-subscriber = { workspace = true }
|
|
unicode-width = { workspace = true }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
libc = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
anyhow = { workspace = true }
|
|
assert_cmd = { workspace = true }
|
|
assert_matches = { workspace = true }
|
|
async-trait = { workspace = true }
|
|
insta = { workspace = true }
|
|
test-case = { workspace = true }
|
|
testutils = { workspace = true }
|
|
# https://github.com/rust-lang/cargo/issues/2911#issuecomment-1483256987
|
|
jj-cli = { path = ".", features = ["test-fakes"], default-features = false }
|
|
|
|
[features]
|
|
default = ["watchman"]
|
|
bench = ["dep:criterion"]
|
|
packaging = []
|
|
test-fakes = ["jj-lib/testing"]
|
|
vendored-openssl = ["git2/vendored-openssl", "jj-lib/vendored-openssl"]
|
|
watchman = ["jj-lib/watchman"]
|
|
|
|
[package.metadata.binstall]
|
|
# The archive name is jj, not jj-cli. Also, `cargo binstall` gets
|
|
# confused by the `v` before versions in archive name.
|
|
pkg-url = "{ repo }/releases/download/v{ version }/jj-v{ version }-{ target }.{ archive-format }"
|