summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-09-13 01:03:32 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2016-09-13 01:07:08 +0300
commit8e2b139f618c9f0a15f58c575624560928afea10 (patch)
tree69acac523289a5450822bf3707b74fd97f4a9946
parent0b0156f964c8e6d27b1215c381917662372f3a0f (diff)
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 <laurent.pinchart@ideasonboard.com>
-rw-r--r--README6
-rwxr-xr-xscripts/vsp-lib.sh14
2 files changed, 16 insertions, 4 deletions
diff --git a/README b/README
index 7bc1d48..ecd3db0 100644
--- a/README
+++ b/README
@@ -56,3 +56,9 @@ Running the Tests
The test scripts are named vsp-unit-test-[0-9]*.sh. They can be run directly
from the test suite root directory.
+Test options:
+
+- VSP_KEEP_FRAMES: When the VSP_KEEP_FRAMES environment variable is set to 1,
+ all frame files will be preserved regardless of the tests results. Otherwise
+ frame files for successful tests are removed.
+
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