-
Notifications
You must be signed in to change notification settings - Fork 30
/
ch.sh
53 lines (46 loc) · 774 Bytes
/
ch.sh
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
# Runs cargo check on each feature.
FEATS=(
advapi
'advapi comctl'
'advapi shell'
comctl
'comctl gdi'
'comctl shell'
dshow
dwm
dxgi
gdi
'gdi mf'
gui
'gui shell'
kernel
mf
ole
oleaut
psapi
shell
taskschd
user
uxtheme
version
)
set -e
print_elapsed () {
MIN=$(( ($1 - ($1 % (60 * 1000))) / (1000 * 60) ))
SEC=$(( ($TF - ($MIN * 1000 * 60) - ($1 % 1000)) / 1000 ))
MS=$(( $1 % 1000 ))
PURP='\033[0;35m'
NC='\033[0m'
if (($MIN > 0)); then
printf " ${PURP}Duration${NC} %02d:%02d.%03d min\n" $MIN $SEC $MS
else
printf " ${PURP}Duration${NC} %d.%03d sec\n" $SEC $MS
fi
}
for FEAT in "${FEATS[@]}" ; do
echo "$FEAT..."
T0=$(date +%s%N)
cargo check --features "$FEAT"
TF=$((($(date +%s%N) - $T0)/1000000))
print_elapsed $TF
done