forked from rpm-software-management/rpmlint
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·58 lines (50 loc) · 1.39 KB
/
test.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
#!/bin/sh
export PYTHONPATH=$(pwd)/tools:$(pwd)
export TESTPATH="$(pwd)/test/"
: ${PYTHON:=python} ${PYTEST:=py.test} ${FLAKE8:=flake8}
: ${PYTHONWARNINGS:=all}
export PYTHONWARNINGS
echo
echo "Please ignore the possibly occurring output like this:"
echo " .../Patch*.patch: No such file or directory"
echo
for i in $TESTPATH/test.*.py; do
$PYTHON $i
RET=$?
if [ $RET -ne 0 ]; then
exit $RET
fi
done
echo "Check that rpmlint executes with no unexpected errors"
echo "...in default locale"
$PYTHON ./rpmlint -C $(pwd) test/*/*.rpm test/spec/*.spec >/dev/null
rc=$?
test $rc -eq 0 -o $rc -eq 64 || exit $rc
echo "...in the C locale"
LC_ALL=C $PYTHON ./rpmlint -C $(pwd) test/*/*.rpm test/spec/*.spec >/dev/null
rc=$?
test $rc -eq 0 -o $rc -eq 64 || exit $rc
echo "$PYTEST tests"
$PYTEST -v || exit $?
unset PYTHONWARNINGS
echo "$FLAKE8 tests"
$FLAKE8 --version
$FLAKE8 . ./rpmdiff ./rpmlint || exit $?
echo "man page tests"
if man --help 2>&1 | grep -q -- --warnings; then
tmpfile=$(mktemp) || exit 1
for manpage in ./rpmdiff.1 ./rpmlint.1; do
man --warnings $manpage >/dev/null 2>$tmpfile
if [ -s $tmpfile ]; then
echo $manpage:
cat $tmpfile
rm -f $tmpfile
exit 1
else
>$tmpfile
fi
done
rm -f $tmpfile
else
echo "Skipped, man does not seem to recognize the --warnings switch"
fi