GM self-tests: always run all tests (don't stop at first failure)
authorepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 26 Apr 2013 17:45:06 +0000 (17:45 +0000)
committerepoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 26 Apr 2013 17:45:06 +0000 (17:45 +0000)
and make rebaseline.sh rebaseline all tests in one go.
(RunBuilders:Skia_PerCommit_House_Keeping)

Review URL: https://codereview.chromium.org/13979017

git-svn-id: http://skia.googlecode.com/svn/trunk@8881 2bbb7eff-a529-9590-31e7-b0007b416f81

gm/tests/rebaseline.sh
gm/tests/run.sh

index 71af20f..608e667 100755 (executable)
@@ -4,9 +4,6 @@
 # gm self-tests.
 # Use with caution: are you sure the new results are actually correct?
 #
-# YOU MUST RE-RUN THIS UNTIL THE SELF-TESTS SUCCEED!
-# (It takes one run for each failing call to gm_test in run.sh)
-#
 # TODO: currently, this must be run on Linux to generate baselines that match
 # the ones on the housekeeper bot (which runs on Linux... see
 # http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1417/steps/RunGmSelfTests/logs/stdio )
@@ -64,11 +61,11 @@ SELFTEST_RESULT=$?
 echo
 if [ "$SELFTEST_RESULT" != "0" ]; then
   replace_expected_with_actual
-  echo "Self-tests still failing, you should probably run this again..."
-else
   svn_add_new_files
   svn_delete_old_files
-  echo "Self-tests succeeded this time, you should be done!"
+  echo "Rebaseline completed.  If you run run.sh now, it should succeed."
+else
+  echo "Self-tests succeeded, nothing to rebaseline."
 fi
 exit $SELFTEST_RESULT
 
index 8e35640..4482d39 100755 (executable)
@@ -25,6 +25,8 @@ OUTPUT_ACTUAL_SUBDIR=output-actual
 OUTPUT_EXPECTED_SUBDIR=output-expected
 CONFIGS="--config 8888 565"
 
+ENCOUNTERED_ANY_ERRORS=0
+
 # Compare contents of all files within directories $1 and $2,
 # EXCEPT for any dotfiles.
 # If there are any differences, a description is written to stdout and
@@ -38,7 +40,7 @@ function compare_directories {
   diff -r --exclude=.* $1 $2
   if [ $? != 0 ]; then
     echo "failed in: compare_directories $1 $2"
-    exit 1
+    ENCOUNTERED_ANY_ERRORS=1
   fi
 }
 
@@ -171,4 +173,9 @@ gm_test "--verbose --hierarchy --match selftest1 selftest2 $CONFIGS" "$GM_OUTPUT
 # Ignore some error types (including ExpectationsMismatch)
 gm_test "--ignoreErrorTypes ExpectationsMismatch NoGpuContext --verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OUTPUTS/ignore-expectations-mismatch"
 
-echo "All tests passed."
+if [ $ENCOUNTERED_ANY_ERRORS == 0 ]; then
+  echo "All tests passed."
+  exit 0
+else
+  exit 1
+fi