Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 3 | TEST_FILE="/tmp/test.data" |
| 4 | |
| 5 | RETVAL=0 |
| 6 | # Test every writing test application |
| 7 | for write_exe_full_path in ${DIR}/add_person_*; do |
| 8 | if [ -x "${write_exe_full_path}" ]; then |
| 9 | write_exe=`basename ${write_exe_full_path}` |
| 10 | echo "Generating new test file using ${write_exe}..." |
| 11 | ${write_exe_full_path} "${TEST_FILE}" |
| 12 | RETVAL=$? |
| 13 | |
| 14 | # Test every reading test application |
| 15 | for read_exe_full_path in ${DIR}/list_people_*; do |
| 16 | read_exe=`basename ${read_exe_full_path}` |
| 17 | echo "Test: Write with ${write_exe}; Read with ${read_exe}..." |
| 18 | if [ -x "${read_exe_full_path}" ]; then |
| 19 | ${read_exe_full_path} "${TEST_FILE}" |
| 20 | RETVAL=$? |
| 21 | fi |
| 22 | done |
| 23 | |
| 24 | # Cleanup... |
| 25 | if [ -e "${TEST_FILE}" ]; then |
| 26 | rm "${TEST_FILE}" |
| 27 | fi |
| 28 | fi |
| 29 | done |
| 30 | |
| 31 | exit $RETVAL |
| 32 | |