From: Wanlong G. <gao...@cn...> - 2012-07-26 02:45:52
|
New output format of file command for C program file is like below, $ file src/guestfs.c src/guestfs.c: C source, ASCII text Signed-off-by: Wanlong Gao <gao...@cn...> --- testcases/commands/ade/file/file_test.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/testcases/commands/ade/file/file_test.sh b/testcases/commands/ade/file/file_test.sh index 70420e3..8a4e9b5 100755 --- a/testcases/commands/ade/file/file_test.sh +++ b/testcases/commands/ade/file/file_test.sh @@ -314,10 +314,16 @@ then $LTPBIN/tst_resm TPASS "file: Recognised C program text correctly" rm -f $LTPTMP/cprog.c else - $LTPBIN/tst_res TFAIL $LTPTMP/file.out \ - "file: Failed to Recognize C program text correctly. Reason:" - TFAILCNT=$(( $TFAILCNT+1 )) - + grep "C source, ASCII text" $LTPTMP/file.out > /dev/null 2>&1 + if [ $? -eq 0 ] + then + $LTPBIN/tst_resm TPASS "file: Recognised C program text correctly" + rm -f $LTPTMP/cprog.c + else + $LTPBIN/tst_res TFAIL $LTPTMP/file.out \ + "file: Failed to Recognize C program text correctly. Reason:" + TFAILCNT=$(( $TFAILCNT+1 )) + fi fi else $LTPBIN/tst_resm TFAIL "file: Failed to recognize C programi text" -- 1.7.12.rc0 |