From 8e2b139f618c9f0a15f58c575624560928afea10 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 13 Sep 2016 01:03:32 +0300 Subject: vsp-lib: Add option to keep all frames when tests succeed When the environment variable VSP_KEEP_FRAMES is set to 1, all frames will be kept regardless of the test results. Signed-off-by: Laurent Pinchart --- scripts/vsp-lib.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/vsp-lib.sh b/scripts/vsp-lib.sh index 6ce701a..7c012d0 100755 --- a/scripts/vsp-lib.sh +++ b/scripts/vsp-lib.sh @@ -254,13 +254,19 @@ compare_frames() { params=$in_fmt-$out_fmt-$size$params for frame in ${frames_dir}frame-*.bin ; do - (compare_frame_$method $out_format $size $frame ${frames_dir}ref-frame.bin) || { - mv $frame ${0/.sh/}-$(basename ${frame/.bin/-$params.bin}) ; - result="fail" + local match="true" + + (compare_frame_$method $out_format $size $frame ${frames_dir}ref-frame.bin) || { + match="false" ; + result="fail" ; } + + if [ $match = "false" -o x$VSP_KEEP_FRAMES = x1 ] ; then + mv $frame ${0/.sh/}-$(basename ${frame/.bin/-$params.bin}) + fi done - if [ $result = "fail" ] ; then + if [ x$VSP_KEEP_FRAMES = x1 -o $result = "fail" ] ; then mv ${frames_dir}ref-frame.bin ${0/.sh/}-ref-frame-$params.bin else rm -f ${frames_dir}ref-frame.bin -- cgit v1.2.3