skdiff test-only change: add test of --nodiffs mode, make tests validate return value

Review URL: https://codereview.appspot.com/6206085

git-svn-id: http://skia.googlecode.com/svn/trunk@3999 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2012-05-18 18:25:26 +00:00
Родитель 6f3437fce0
Коммит 90cb9b325c
6 изменённых файлов: 24 добавлений и 1 удалений

Просмотреть файл

@ -30,10 +30,15 @@ function skdiff_test {
rm -rf $ACTUAL_OUTPUT_DIR
mkdir -p $ACTUAL_OUTPUT_DIR
$SKDIFF_BINARY $SKDIFF_ARGS $ACTUAL_OUTPUT_DIR &>$ACTUAL_OUTPUT_DIR/stdout
COMMAND="$SKDIFF_BINARY $SKDIFF_ARGS $ACTUAL_OUTPUT_DIR"
echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line
$COMMAND &>$ACTUAL_OUTPUT_DIR/stdout
echo $? >$ACTUAL_OUTPUT_DIR/return_value
compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
}
SKDIFF_TESTDIR=tools/tests/skdiff
skdiff_test "$SKDIFF_TESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/test1"
skdiff_test "--nodiffs $SKDIFF_TESTDIR/baseDir $SKDIFF_TESTDIR/comparisonDir" "$SKDIFF_TESTDIR/test2"
echo "All tests passed."

Просмотреть файл

@ -0,0 +1 @@
out/Debug/skdiff tools/tests/skdiff/baseDir tools/tests/skdiff/comparisonDir tools/tests/skdiff/test1/output-actual

Просмотреть файл

@ -0,0 +1 @@
0

Просмотреть файл

@ -0,0 +1 @@
out/Debug/skdiff --nodiffs tools/tests/skdiff/baseDir tools/tests/skdiff/comparisonDir tools/tests/skdiff/test2/output-actual

Просмотреть файл

@ -0,0 +1 @@
0

Просмотреть файл

@ -0,0 +1,14 @@
ERROR: no codec found for <tools/tests/skdiff/baseDir/different-bits-unknown-format.xyz>
ERROR: no codec found for <tools/tests/skdiff/baseDir/identical-bits-unknown-format.xyz>
baseDir is [tools/tests/skdiff/baseDir/]
comparisonDir is [tools/tests/skdiff/comparisonDir/]
not writing any diffs to outputDir [tools/tests/skdiff/test2/output-actual/]
Missing in baseDir:
missing-from-baseDir.png
missing-from-baseDir.xyz
Missing in comparisonDir:
missing-from-comparisonDir.png
missing-from-comparisonDir.xyz
4 of 12 images matched.
Maximum pixel intensity mismatch 239
Largest area mismatch was 100.00% of pixels