Index: gm/tests/run.sh |
=================================================================== |
--- gm/tests/run.sh (revision 9186) |
+++ gm/tests/run.sh (working copy) |
@@ -105,12 +105,14 @@ |
# 1. Image file encoding may vary by platform |
# 2. https://code.google.com/p/chromium/issues/detail?id=169600 |
# ('gcl/upload.py fail to upload binary files to rietveld') |
- for IMAGEFILE in $(ls $ACTUAL_OUTPUT_DIR/*/*/*.png); do |
+ for IMAGEFILE in $(find $ACTUAL_OUTPUT_DIR -name *.png); do |
echo "[contents of $IMAGEFILE]" >$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 |
+ if [ -d $ACTUAL_OUTPUT_DIR/mismatchPath ]; then |
+ for MISMATCHDIR in $(find $ACTUAL_OUTPUT_DIR/mismatchPath -mindepth 1 -type d); 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 |
} |
@@ -118,7 +120,7 @@ |
# Create input dir (at path $1) with expectations (both image and json) |
# that gm will match or mismatch as appropriate. |
# |
-# We used to check these files into SVN, but then we needed to rebasline them |
+# We used to check these files into SVN, but then we needed to rebaseline them |
# when our drawing changed at all... so, as proposed in |
# http://code.google.com/p/skia/issues/detail?id=1068 , we generate them |
# new each time. |
@@ -163,6 +165,17 @@ |
-r $IMAGES_DIR/different-pixels \ |
--writeJsonSummaryPath $JSON_DIR/different-pixels.json |
+ mkdir -p $IMAGES_DIR/different-pixels-no-hierarchy |
scroggo
2013/05/20 17:22:03
Should there be a variable set to different-pixels
epoger
2013/05/21 15:41:23
Great idea, thanks! Done throughout this function
|
+ $GM_BINARY --match selftest2 $CONFIGS \ |
+ -w $IMAGES_DIR/different-pixels-no-hierarchy |
+ mv $IMAGES_DIR/different-pixels-no-hierarchy/selftest2_8888.png \ |
+ $IMAGES_DIR/different-pixels-no-hierarchy/selftest1_8888.png |
+ mv $IMAGES_DIR/different-pixels-no-hierarchy/selftest2_565.png \ |
+ $IMAGES_DIR/different-pixels-no-hierarchy/selftest1_565.png |
+ $GM_BINARY --match selftest1 $CONFIGS \ |
+ -r $IMAGES_DIR/different-pixels-no-hierarchy \ |
+ --writeJsonSummaryPath $JSON_DIR/different-pixels-no-hierarchy.json |
+ |
mkdir -p $IMAGES_DIR/empty-dir |
} |
@@ -208,6 +221,9 @@ |
# 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" |
+# Test non-hierarchical mode. |
+gm_test "--verbose --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels-no-hierarchy.json" "$GM_OUTPUTS/no-hierarchy" |
+ |
# Exercise confirm_no_failures_in_json.py |
PASSING_CASES="compared-against-identical-bytes-json compared-against-identical-pixels-json" |
FAILING_CASES="compared-against-different-pixels-json" |