mirror of
https://github.com/thead-yocto-mirror/meta-openembedded
synced 2026-09-16 20:21:58 +02:00
During protobuf-ptest execution, add_person_cpp waits for user inputs to write data into test.data file. Fixed this by supplying dummy data through standard input. Upstream-Status: Pending Signed-off-by: Aditya Tayade <Aditya.Tayade@kpit.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
39 lines
998 B
Bash
39 lines
998 B
Bash
#!/bin/bash
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
TEST_FILE="/tmp/test.data"
|
|
|
|
RETVAL=0
|
|
# Test every writing test application
|
|
for write_exe_full_path in ${DIR}/add_person_*; do
|
|
if [ -x "${write_exe_full_path}" ]; then
|
|
write_exe=`basename ${write_exe_full_path}`
|
|
echo "Generating new test file using ${write_exe}..."
|
|
printf "1234\nname\nname@example.com\n" | ${write_exe_full_path} "${TEST_FILE}"
|
|
RETVAL=$?
|
|
[ $RETVAL -eq 0 ] || exit $RETVAL
|
|
|
|
# Test every reading test application
|
|
for read_exe_full_path in ${DIR}/list_people_*; do
|
|
read_exe=`basename ${read_exe_full_path}`
|
|
echo "Test: Write with ${write_exe}; Read with ${read_exe}..."
|
|
if [ -x "${read_exe_full_path}" ]; then
|
|
${read_exe_full_path} "${TEST_FILE}"
|
|
RETVAL=$?
|
|
[ $RETVAL -eq 0 ] || exit $RETVAL
|
|
fi
|
|
done
|
|
|
|
# Cleanup...
|
|
if [ -e "${TEST_FILE}" ]; then
|
|
rm "${TEST_FILE}"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
if [ $RETVAL -eq 0 ] ; then
|
|
echo "PASS: protobuf"
|
|
else
|
|
echo "FAIL: protobuf"
|
|
fi
|
|
|