forked from Nikolay-Kha/PyCNC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.sh
executable file
·30 lines (27 loc) · 1.21 KB
/
runtests.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
#!/bin/bash
set -e
echo '**********************************************************************'
echo '* Testing PyCNC modules. *'
echo '* Hint: pass -v to this script arguments to see more verbose output. *'
echo '* Note: HAL tests should be run manually on corresponding board. For *'
echo '* example Raspberry Pi tests is tests/rpgpio_test.sh which should be *'
echo '* run with RPi board with connected to pin GPIO21 LED. LED should *'
echo '* light up on pullup, set, and DMA test events. *'
echo '**********************************************************************'
echo '---------------------------Unit tests---------------------------------'
python -m unittest discover "$@" --pattern="test_*.py"
echo '-------------------------Integration tests----------------------------'
app="pycnc"
if ! which ${app} &> /dev/null; then
echo "WARNING pycnc not found in path. Not installed? Using './pycnc'."
app="./pycnc"
fi
res="$(${app} tests/rects.gcode 2>&1)"
res="${res}$(${app} tests/circles.gcode 2>&1)"
res="${res}$(${app} tests/test_parser.gcode 2>&1)"
if echo "${res}" | grep -q -i error; then
echo "FAILED"
echo "$res"
exit 1
fi
echo "OK"