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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
[config]
default_to_workspace = false
[env]
FUZZ_RUNS = 1000
[tasks.build]
command = "cargo"
args = ["build"]
[tasks.format]
workspace = true
install_crate = "rustfmt"
command = "cargo"
args = ["fmt", "--", "--emit=files"]
[tasks.clippy]
workspace = true
install_crate = "clippy"
command = "cargo"
args = ["clippy"]
[tasks.outdated]
install_crate = "cargo-outdated"
command = "cargo"
args = ["outdated", "-R"]
[tasks.bench]
toolchain = "nightly"
command = "cargo"
args = ["bench", "${@}"]
[tasks.bench-maths]
toolchain = "nightly"
command = "cargo"
args = ["bench", "--features", "maths", "${@}"]
[tasks.bench-legacy]
toolchain = "nightly"
command = "cargo"
args = ["bench", "--no-default-features", "--features", "serde,std,legacy-ops", "${@}"]
[tasks.benchcmp]
dependencies = [
"benchcmp-legacy",
"benchcmp-default"
]
install_crate = "benchcmp"
command = "cargo"
args = ["benchcmp", "target/legacy.bench", "target/default.bench"]
[tasks.benchcmp-default]
script = "cargo +nightly bench > target/default.bench"
[tasks.benchcmp-legacy]
script = "cargo +nightly bench --no-default-features --features serde,std,legacy-ops > target/legacy.bench"
[tasks.coverage]
dependencies = ["codecov-clean"]
env = { "CARGO_INCREMENTAL" = "0", "RUSTFLAGS" = "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort", "RUSTDOCFLAGS" = "-Cpanic=abort" }
run_task = "codecov-grcov"
[tasks.codecov-grcov]
dependencies = ["codecov-build", "codecov-test"]
command = "grcov"
args = [".", "-s", ".", "--binary-path", "./target/debug/", "-t", "html", "--branch", "--ignore-not-existing", "-o", "./target/debug/coverage/"]
[tasks.codecov-open]
command = "open"
args = [ "./target/debug/coverage/index.html" ]
[tasks.codecov-clean]
toolchain = "nightly"
command = "cargo"
args = [ "clean" ]
[tasks.codecov-build]
toolchain = "nightly"
command = "cargo"
args = [ "build", "-p", "rust_decimal", "--features=default" ]
[tasks.codecov-test]
toolchain = "nightly"
command = "cargo"
args = [ "test", "-p", "rust_decimal", "--features=default" ]
# Always test no-std with std tests
[tasks.test]
dependencies = ["test-no-std"]
command = "cargo"
args = ["test"]
[tasks.fuzz]
dependencies = [
"fuzz-arithmetic",
"fuzz-constructors"
]
[tasks.fuzz-arithmetic]
toolchain = "nightly"
install_crate = "cargo-fuzz"
command = "cargo"
args = ["fuzz", "run", "arithmetic", "--", "-runs=${FUZZ_RUNS}"]
[tasks.fuzz-constructors]
toolchain = "nightly"
install_crate = "cargo-fuzz"
command = "cargo"
args = ["fuzz", "run", "constructors", "--", "-runs=${FUZZ_RUNS}"]
[tasks.test-all]
dependencies = [
"test-no-std",
"test-default",
"test-legacy-ops",
"test-maths",
"test-misc",
"test-db",
"test-rocket-traits",
"test-serde",
"test-macros"
]
[tasks.test-db]
dependencies = [
"test-db-mysql-all",
"test-db-postgres-all"
]
[tasks.test-serde]
dependencies = [
"test-serde-float",
"test-serde-str",
"test-serde-str-float",
"test-serde-arbitrary-precision",
"test-serde-arbitrary-precision-float",
"test-serde-with-arbitrary-precision",
"test-serde-with-float",
"test-serde-with-str",
]
[tasks.test-macros]
workspace = true
[tasks.test-no-std]
command = "cargo"
args = ["test", "--no-default-features"]
[tasks.test-default]
command = "cargo"
args = ["test", "--workspace", "--features=default"]
[tasks.test-legacy-ops]
command = "cargo"
args = ["test", "--workspace", "--features=legacy-ops"]
[tasks.test-maths]
dependencies = [
"test-maths-default",
"test-maths-legacy",
"test-maths-nopanic",
]
[tasks.test-maths-default]
command = "cargo"
args = ["test", "--workspace", "--no-default-features", "--features=maths", "maths", "--", "--skip", "generated"]
[tasks.test-maths-legacy]
command = "cargo"
args = ["test", "--workspace", "--no-default-features", "--features=maths,legacy-ops", "maths", "--", "--skip", "generated"]
[tasks.test-maths-nopanic]
command = "cargo"
args = ["test", "--workspace", "--no-default-features", "--features=maths-nopanic", "maths", "--", "--skip", "generated"]
[tasks.test-misc]
dependencies = [
"test-rust-fuzz",
"test-borsh",
"test-rkyv"
]
[tasks.test-rust-fuzz]
command = "cargo"
args = ["test", "--workspace", "--no-default-features", "--features=rust-fuzz", "rust_fuzz", "--", "--skip", "generated"]
[tasks.test-db-diesel]
dependencies = [
"test-db-diesel1-mysql",
"test-db-diesel1-postgres",
"test-db-diesel2-mysql",
"test-db-diesel2-postgres",
]
[tasks.test-db-mysql-all]
dependencies = [
"test-db-diesel1-mysql",
"test-db-diesel2-mysql",
]
[tasks.test-db-diesel1-mysql]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=db-diesel1-mysql", "mysql", "--", "--skip", "generated"]
[tasks.test-db-diesel2-mysql]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=db-diesel2-mysql", "mysql", "--", "--skip", "generated"]
[tasks.test-db-postgres-all]
dependencies = [
"test-db-postgres",
"test-db-tokio-postgres",
"test-db-diesel1-postgres",
"test-db-diesel2-postgres"
]
[tasks.test-db-postgres]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=db-postgres", "postgres", "--", "--skip", "generated"]
[tasks.test-db-tokio-postgres]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=db-tokio-postgres", "postgres", "--", "--skip", "generated"]
[tasks.test-db-diesel1-postgres]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=db-diesel1-postgres", "postgres", "--", "--skip", "generated"]
[tasks.test-db-diesel2-postgres]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=db-diesel2-postgres", "postgres", "--", "--skip", "generated"]
[tasks.test-rocket-traits]
command = "cargo"
args = ["test", "--workspace", "--features=rocket-traits"]
[tasks.test-serde-float]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-float", "serde", "--", "--skip", "generated"]
[tasks.test-serde-str]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-str", "serde", "--", "--skip", "generated"]
[tasks.test-serde-str-float]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-str,serde-float", "serde", "--", "--skip", "generated"]
[tasks.test-serde-arbitrary-precision]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-arbitrary-precision", "serde", "--", "--skip", "generated"]
[tasks.test-serde-arbitrary-precision-float]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-arbitrary-precision,serde-float", "serde", "--", "--skip", "generated"]
[tasks.test-serde-with-arbitrary-precision]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-with-arbitrary-precision", "serde", "--", "--skip", "generated"]
[tasks.test-serde-with-float]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-with-float", "serde", "--", "--skip", "generated"]
[tasks.test-serde-with-str]
command = "cargo"
args = ["test", "--workspace", "--tests", "--features=serde-with-str", "serde", "--", "--skip", "generated"]
[tasks.test-borsh]
command = "cargo"
args = ["test", "--workspace", "--features=borsh", "--", "--skip", "generated"]
[tasks.test-rkyv]
command = "cargo"
args = ["test", "--workspace", "--features=rkyv", "--features=rkyv-safe", "--", "--skip", "generated"]
[tasks.test-rand]
command = "cargo"
args = ["test", "--workspace", "--features=rand", "--", "--skip", "generated"]
|