Skip to content

Commit

Permalink
Add information to test.sh for more clarity
Browse files Browse the repository at this point in the history
Improve the test.sh usage, and make the header for each
test stand out better in the test output.

Signed-off-by: Tim Bird <[email protected]>
  • Loading branch information
tbird20d committed Sep 3, 2019
1 parent 6ff85d0 commit dfa9074
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ if [ -n "$1" ] ; then
echo " -h Show this usage help"
echo " -f Do 'flake8' test of grabserial syntax"
echo " -l Do 'pylint' test of grabserial source"
echo ""
echo "By default (with no arguments), test.sh will run 2 tests on"
echo "the board 'bbb' (using the ttc command) using the default"
echo "python interpreter, and then 2 more test using the python3"
echo "interpreter"
echo ""
echo "On the second test of each set you should log in to the"
echo "board when the login prompt appears. This tests interactive"
echo "input to the board during grabserial operation."
exit 0
fi
if [ "$1" = "-f" ] ; then
Expand All @@ -19,7 +28,7 @@ if [ -n "$1" ] ; then
if [ "$1" = "-l" ] ; then
echo "Running pylint to analyze grabserial source"
# C0325 is unnecessary-parens (in python 2.0, parens for prints
# is encouraged to make them forward-compatible with python 3.0
# is encouraged to make them forward-compatible with python 3.0)
pylint --disable=C0325 grabserial
exit $?
fi
Expand All @@ -40,8 +49,10 @@ console_dev="$(ttc info bbb -n console_dev)"
# Also, use ttc to reboot bbb

# use ttc to reboot my beaglebone black
echo "==================================="
echo "Testing with python 2"
echo " 60 second grab, stopping when 'login' is seen"
echo "==================================="

# do the reboot after grabserial is started
(sleep 1 ; ttc reboot bbb) &
Expand All @@ -56,27 +67,35 @@ echo " 60 second grab, stopping when 'login' is seen"
./grabserial -v -S -d ${console_dev} -e 60 -t -m "Starting kernel" -i "FAQ" -q "login" -o graboutput.log

echo

echo "==================================="
echo "Testing with python 2"
echo " 120 second grab, try logging in (test user input to serial port)"
echo "==================================="

(sleep 1 ; ttc reboot bbb) &

# run for two minutes, allowing user to login (using threaded input)
./grabserial -v -S -d ${console_dev} -e 120 -t -o graboutput2.log

echo
echo

echo "==================================="
echo "Testing with python 3"
echo " 60 second grab, stopping when 'login' is seen"
echo "==================================="
(sleep 1 ; ttc reboot bbb) &

python3 ./grabserial -v -S -d ${console_dev} -e 60 -t -m "Starting kernel" -i "FAQ" -q "login" -o graboutput3.log

echo

echo "==================================="
echo "Testing with python 3"
echo " 120 second grab, try logging in (test user input to serial port)"
echo "==================================="
(sleep 1 ; ttc reboot bbb) &
python3 ./grabserial -v -S -d ${console_dev} -e 120 -t -o graboutput4.log

echo
echo

echo "Done in test.sh"

0 comments on commit dfa9074

Please sign in to comment.