Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: gm/tests/run.sh

Issue 14863009: GM self-test: add option to exercise --writePath and --mismatchPath, but not on bots (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tests/run.sh
===================================================================
--- gm/tests/run.sh (revision 9045)
+++ gm/tests/run.sh (working copy)
@@ -21,6 +21,12 @@
# TODO(epoger): make it look in Release and/or Debug
GM_BINARY=out/Debug/gm
+# If WRITE_IMAGE_FILES is nonzero, then the self-test will pass --writePath
+# and --mismatchPath arguments to GM. Currently, for various reasons, we
+# cannot run these arguments on the production buildbots, so this should
+# only be set to nonzero for local testing.
+WRITE_IMAGE_FILES=0
+
OUTPUT_ACTUAL_SUBDIR=output-actual
OUTPUT_EXPECTED_SUBDIR=output-expected
CONFIGS="--config 8888 565"
@@ -62,7 +68,12 @@
rm -rf $ACTUAL_OUTPUT_DIR
mkdir -p $ACTUAL_OUTPUT_DIR
+
COMMAND="$GM_BINARY $GM_ARGS --writeJsonSummaryPath $JSON_SUMMARY_FILE"
+ if [ $WRITE_IMAGE_FILES != 0 ]; then
+ COMMAND="$COMMAND --writePath $ACTUAL_OUTPUT_DIR/writePath --mismatchPath $ACTUAL_OUTPUT_DIR/mismatchPath"
+ fi
+
echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line
$COMMAND >$ACTUAL_OUTPUT_DIR/stdout 2>$ACTUAL_OUTPUT_DIR/stderr
echo $? >$ACTUAL_OUTPUT_DIR/return_value
@@ -77,6 +88,17 @@
grep ^GM: $ACTUAL_OUTPUT_DIR/stderr >$ACTUAL_OUTPUT_DIR/stderr-tmp
mv $ACTUAL_OUTPUT_DIR/stderr-tmp $ACTUAL_OUTPUT_DIR/stderr
+ if [ $WRITE_IMAGE_FILES != 0 ]; then
+ for IMAGEFILE in $(ls $ACTUAL_OUTPUT_DIR/*/*/*.png); do
+ SUM=$(sum $IMAGEFILE)
+ echo "Replaced image bytes with a checksum, because of https://code.google.com/p/chromium/issues/detail?id=169600 ('gcl/upload.py fail to upload binary files to rietveld')" >$IMAGEFILE
+ echo $SUM >> $IMAGEFILE
+ done
+ for MISMATCHDIR in $(ls -d $ACTUAL_OUTPUT_DIR/mismatchPath/*); do
+ echo "Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories." >$MISMATCHDIR/bogusfile
+ done
+ fi
+
compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698