-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtest-all.sh
More file actions
executable file
·58 lines (48 loc) · 1.15 KB
/
test-all.sh
File metadata and controls
executable file
·58 lines (48 loc) · 1.15 KB
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
#!/bin/sh
set -e
cleanup() {
test -n "$DIR" && rm -rf "$DIR"
}
trap cleanup EXIT
DIR=$(mktemp -d "/tmp/crash-python-tests.XXXXXX")
export CRASH_PYTHON_TESTDIR="$DIR"
rm -rf build/lib/crash
python3 setup.py -q build
make -C tests -s
crash-python-gdb -nx -batch -ex "source tests/unittest-bootstrap.py"
has_mypy() {
python3 -c 'import mypy' 2> /dev/null
}
if has_mypy; then
cat <<- END > $DIR/gdbinit
set build-id-verbose 0
set python print-stack full
set height 0
set print pretty on
python
sys.path.insert(0, 'build/lib')
from mypy.main import main
main(None, args=["-p", "crash", "--ignore-missing-imports"])
end
END
echo "Doing static checking."
if ! crash-python-gdb -nx -batch -x $DIR/gdbinit; then
echo "static checking failed." >&2
else
echo "OK"
fi
fi
cat << END > $DIR/gdbinit
python sys.path.insert(0, 'build/lib')
set build-id-verbose 0
set python print-stack full
set prompt py-crash>
set height 0
set print pretty on
source kernel-tests/unittest-prepare.py
source kernel-tests/unittest-bootstrap.py
END
for f in "$@"; do
export CRASH_PYTHON_TESTFILE="$f"
crash-python-gdb -nx -batch -x $DIR/gdbinit
done