-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCargo.toml
80 lines (61 loc) · 5.32 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
[package]
name = "big-o-test"
version = "0.2.9"
edition = "2021"
description = "Enforces a maximum `space` and `time` Algorithm Complexity when testing"
keywords = ["algorithm", "analysis", "Big-O", "notation", "performance"]
categories = ["development-tools", "development-tools::profiling", "development-tools::testing"]
readme = "README.md"
authors = ["Luiz Silveira <[email protected]>"]
homepage = "https://github.com/zertyz/big-o"
repository = "https://github.com/zertyz/big-o"
documentation = "https://docs.rs/big-o-test/"
license = "Unlicense"
[features]
default = [
"report_stdout", # Shows the algorithm analysis report for each test -- sending to stdout. Use `no_report` if you don't want it or `report_stderr` to leave stdout alone
"tolerance_10_percent", # Accepts measurement discrepancies of up to 10% -- for machines not performing any other work other than running the tests
]
# Report generation options
report_stdout = [] # Shows the algorithm analysis report for each test -- sending to stdout
report_stderr = [] # Shows the algorithm analysis report for each test -- sending to stderr
no_report = [] # Don't mess with nither stderr nor stdout -- do not show any report.
# -- the same behavior as not specifying neither `report_stdout` nor `report_stderr`.
# Measurement tolerance options
tolerance_10_percent = [] # Accepts measurement discrepancies of up to 10% -- for machines not performing any other work other than running the tests
# -- this behavior is the default if no `tollerance_*_percent` feature is specifyed
tolerance_25_percent = [] # Accepts measurement discrepancies of up to 25% -- for machines running other tasks along with the tests
# Misc
no_allocator_metrics = [] # If you don't want to change the global allocator (injecting our metrics probe in it), use this feature
# -- however, there will be no SPACE analysis
[workspace]
[dependencies]
crossbeam = "0.8" # scoped threads
keen-retry = "0.5" # for automatic retries on flaky execution passes
[dev-dependencies] # dev dependencies should become normal dependencies when building docs for tests
ctor = "0.2" # initializer functions -- that run before main
serial_test = "3" # run tests serially
parking_lot = "0.12" # way faster than std mutex
spin_sleep = "1.1" # precise sleeping, avoiding busy loops on some tests
rand = "0.8" # used by some tests to avoid call cancellation optimizations when running in release mode
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "test", "--document-private-items"] # enables full documentation (including test modules and test cases)
# DOCUMENTATION
# cargo doc --workspace --no-deps --document-private-items
# DEPENDENCIES (crates)
# cargo depgraph --all-features | dot -x -Tsvg -o dependencies.svg
# (install with cargo install cargo-depgraph)
# DEPENDENCIES (program)
# (install with cargo install cargo-modules)
# MODULE dependencies
# package="big-o"; layout="dot"; format="svg"; cargo modules generate graph --with-uses --package "${package}" --layout "$layout" | sed 's/label="uses"\|label="owns"/label=""/g' | sed 's|splines="line"|splines=true|g' | sed "s|${package}::||g" | sed 's|::|⸬|g' >modules.dot;
# for duplicate_to_remove in "`cat modules.dot | sort -r | sed '$!N; /\(.* \-> .*\) \[label=".*\n\1.*"owns" edge/P;D'`"; do grep -vF -- "${duplicate_to_remove}" modules.dot >_modules.dot; mv _modules.dot modules.dot; done;
# dot -x -T${format} -o modules.${format} modules.dot; rm modules.dot
# TYPES
# package="big-o"; layout="dot"; format="svg"; name="types"; cargo modules generate graph --with-uses --with-types --package "${package}" --layout "$layout" | sed 's/label="uses"\|label="owns"/label=""/g' | sed 's|splines="line"|splines=true|g' | sed "s|${package}::||g" | sed 's|::|⸬|g' >${name}.dot;
# for duplicate_to_remove in "`cat ${name}.dot | grep -E ' // "fn" node' | sed 's|^\s*\("[^"]*"\).*$|\1|'`" "`cat ${name}.dot | sort -r | sed '$!N; /\(.* \-> .*\) \[label=".*\n\1.*"owns" edge/P;D'`"; do if [ "$duplicate_to_remove" != "" ]; then grep -vF -- "${duplicate_to_remove}" ${name}.dot >_${name}.dot; mv _${name}.dot ${name}.dot; fi; done;
# dot -x -T${format} -o ${name}.${format} ${name}.dot; rm ${name}.dot
# FUNCTIONS -- doesn't include functions referenced in macros, sadly (update the ones above with knowledge from this)
# package="big-o"; layout="dot"; format="svg"; name="functions"; cargo modules generate graph --with-uses --with-types --package "${package}" --layout "$layout" | sed 's/label="uses"\|label="owns"/label=""/g' | sed 's|splines="line"|splines=true|g' | sed "s|${package}::||g" | sed 's|::|⸬|g' >${name}.dot;
# for duplicate_to_remove in "`cat ${name}.dot | grep -E ' // "const" node| // "enum" node| // "trait" node| // "struct" node' | sed 's|^\s*\("[^"]*"\).*$|\1|'`" "`cat ${name}.dot | sort -r | sed '$!N; /\(.* \-> .*\) \[label=".*\n\1.*"owns" edge/P;D'`"; do if [ "$duplicate_to_remove" != "" ]; then grep -vF -- "${duplicate_to_remove}" ${name}.dot >_${name}.dot; mv _${name}.dot ${name}.dot; fi; done;
# dot -x -T${format} -o ${name}.${format} ${name}.dot; rm ${name}.dot