-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglibc-check.sh
59 lines (51 loc) · 1.06 KB
/
glibc-check.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
54
55
56
57
58
59
#!/bin/sh
##
## Glibc "make check" helper script
##
while [[ $# -gt 0 ]]; do
opt=$1
shift 1
optarg=$1
case $opt in
-d) DIR=$optarg; shift 1;;
-k) K=$opt;;
-l) LDSO=$optarg; shift 1;;
-j) JOBS=-j$optarg; shift 1;;
-j[0-9]*) JOBS=$opt;;
esac
done
[[ -n "$DIR" ]] || {
echo "ERROR: check dir not specified"
exit 1
}
function CMD() {
echo + ${1+"$@"}
${1+"$@"} || return $?
}
echo "########################################################################"
echo "##"
echo "## Testing in $DIR with ${LDSO:-default ld.so}"
echo "##"
echo "########################################################################"
[[ -n "$LDSO" ]] && {
CMD mv -f $DIR/elf/ld.so $DIR/elf/ld.so.orig
CMD cp -a $LDSO $DIR/elf/ld.so
CMD find $DIR -name \*.out -exec mv -f '{}' '{}'.origldso \;
}
CMD make $JOBS -C $DIR check $K PARALLELMFLAGS=-s
rc=$?
if [[ $rc -eq 0 ]]; then
STATUS="PASS"
else
STATUS="FAIL"
if [[ -n "$K" ]]; then
rc=0
fi
fi
[[ -n "$LDSO" ]] && {
CMD mv -f $DIR/elf/ld.so.orig $DIR/elf/ld.so
}
echo "##"
echo "## Result: $STATUS"
echo "##"
exit $rc