Print descriptive error message if test file does not exist

Added verification that test file or directory exists for the command:
run_tests.sh -t <test file>

If a test file (or directory) does not exist, run_tests.sh prints error message:
ERROR: File or directory <test file> not found
and exits with status 1

Change-Id: Ia0b11efe434daf7f040943ea8622bad496074563
Closes-Bug: #1397916
This commit is contained in:
Julia Varigina 2014-12-11 07:43:14 -08:00
parent d31b59a7ed
commit c3df5c2b52
1 changed files with 5 additions and 0 deletions

View File

@ -137,6 +137,11 @@ function run_tests {
if [ $certain_tests -eq 1 ]; then if [ $certain_tests -eq 1 ]; then
for testfile in $testrargs; do for testfile in $testrargs; do
local testfile=`readlink -f $testfile` local testfile=`readlink -f $testfile`
local tf=`echo $testfile | cut -d':' -f1`
if [ ! -e $tf ]; then
echo "ERROR: File or directory $tf not found"
exit 1
fi
guess_test_run $testfile guess_test_run $testfile
done done
exit exit