Skip to content

Commit

Permalink
fix grunt reference
Browse files Browse the repository at this point in the history
  • Loading branch information
rvilarl committed Dec 5, 2021
1 parent c3297ce commit bb7aae6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export default Vex;`;
},
clean: {
build: { src: [BUILD_DIR] },
reference: { src: [REFERENCE_DIR] },
},
});

Expand Down Expand Up @@ -352,8 +353,9 @@ export default Vex;`;
'Build to reference/.', //
[
//
'default',
'qunit',
'clean:reference',
'clean:build',
'webpack:buildDebugPlusTests',
'copy:reference',
]
);
Expand Down
9 changes: 8 additions & 1 deletion tools/visual_regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
# PNG viewer on OSX. Switch this to whatever your system uses.
# VIEWER=open

# use . as decimal separator
LC_NUMERIC="en_US.UTF-8"

# Check ImageMagick installation
command -v convert >/dev/null 2>&1 || { echo >&2 "Error: ImageMagick not found."; exit 1; }

Expand Down Expand Up @@ -154,7 +157,11 @@ function diff_image() {
# Calculate the difference metric and store the composite diff image.
local hash=`compare -metric PHASH -highlight-color '#ff000050' $diff-b.png $diff-a.png $diff-diff.png 2>&1`

local isGT=`echo "$hash > $THRESHOLD" | bc -l`
# Remove scientific notation
local hash6=`printf "%.6f" $hash`
local THRESHOLD6=`printf "%.6f" $THRESHOLD`

local isGT=`echo "$hash6 > $THRESHOLD6" | bc -l`
if [ "$isGT" == "1" ]
then
# Add the result to results.text
Expand Down

0 comments on commit bb7aae6

Please sign in to comment.