2018-04-05 05:10:23 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-07-09 05:25:59 +08:00
|
|
|
cd tests/binaries && make && cd ../..
|
2018-07-09 01:03:03 +08:00
|
|
|
|
|
|
|
# NOTE: We run tests under GDB sessions and because of some cleanup/tests dependencies problems
|
|
|
|
# we decided to run each test in a separate GDB session
|
2018-07-09 05:25:59 +08:00
|
|
|
TESTS_LIST=$(gdb --silent --nx --nh --command gdbinit.py --command pytests_collect.py --eval-command quit | grep -o "tests/.*::.*")
|
|
|
|
|
|
|
|
tests_passed_or_skipped=0
|
|
|
|
tests_failed=0
|
2018-07-09 01:03:03 +08:00
|
|
|
|
|
|
|
for test_case in ${TESTS_LIST}; do
|
2018-07-09 05:25:59 +08:00
|
|
|
PWNDBG_LAUNCH_TEST="${test_case}" PWNDBG_DISABLE_COLORS=1 gdb --silent --nx --nh --command gdbinit.py --command pytests_launcher.py --eval-command quit
|
|
|
|
|
|
|
|
exit_status=$?
|
|
|
|
|
|
|
|
if [ ${exit_status} -eq 0 ]; then
|
|
|
|
(( ++tests_passed_or_skipped ))
|
|
|
|
else
|
|
|
|
(( ++tests_failed ))
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "*********************************"
|
|
|
|
echo "********* TESTS SUMMARY *********"
|
|
|
|
echo "*********************************"
|
|
|
|
echo "Tests passed or skipped: ${tests_passed_or_skipped}"
|
|
|
|
echo "Tests failed: ${tests_failed}"
|
|
|
|
|
|
|
|
if [ ${tests_failed} -ne 0 ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|