-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest
executable file
·79 lines (64 loc) · 1.6 KB
/
test
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
#!/usr/bin/env bash
PARAMS=(
'-j1 rule_ok NUM_SLOTS=1'
'-j1 rule_ok NUM_SLOTS=5'
'-j1 rule_ok NUM_SLOTS=10'
'-j1 rule_ok NUM_SLOTS=20'
'-j rule_ok NUM_SLOTS=1'
'-j rule_ok NUM_SLOTS=5'
'-j rule_ok NUM_SLOTS=10'
'-j rule_ok NUM_SLOTS=20'
'-j10 rule_ok NUM_SLOTS=1'
'-j10 rule_ok NUM_SLOTS=5'
'-j10 rule_ok NUM_SLOTS=10'
'-j10 rule_ok NUM_SLOTS=20'
'-j1 rule_error NUM_SLOTS=1'
'-j1 rule_error NUM_SLOTS=5'
'-j1 rule_error NUM_SLOTS=10'
'-j1 rule_error NUM_SLOTS=20'
'-j rule_error NUM_SLOTS=1'
'-j rule_error NUM_SLOTS=5'
'-j rule_error NUM_SLOTS=10'
'-j rule_error NUM_SLOTS=20'
'-j10 rule_error NUM_SLOTS=1'
'-j10 rule_error NUM_SLOTS=5'
'-j10 rule_error NUM_SLOTS=10'
'-j10 rule_error NUM_SLOTS=20'
)
RC=(
'NUM_SLOTS not defined'
'make -j'
'make -j'
'make -j'
'NUM_SLOTS not defined'
'make -j'
'make -j'
'make -j'
'NUM_SLOTS not defined'
'Read 4 bytes.+Return 4 bytes'
'Read 9 bytes.+Return 9 bytes'
'Run forced'
'NUM_SLOTS not defined.+command not found'
'make -j.+command not found'
'make -j.+command not found'
'make -j.+command not found'
'NUM_SLOTS not defined.+command not found'
'make -j.+command not found'
'make -j.+command not found'
'make -j.+command not found'
'NUM_SLOTS not defined.+command not found'
'Read 4 bytes.+command not found.+Return 4 bytes'
'Read 9 bytes.+command not found.+Return 9 bytes'
'Run forced.+command not found'
)
for i in "${!PARAMS[@]}"; do
params="${PARAMS[$i]}"
rc="${RC[$i]}"
printf "Test %-3s: make %-30s" "$i" "$params"
msg="$(make $params 2>&1)"
if [[ "$msg" =~ $rc ]]; then
echo -e "ok"
else
echo -e "not ok"
fi
done