Browse Source

refactor visual_regression: improve some of the warnings and docstrings

sschmid 5 years ago
parent
commit
cecaaf81a1
1 changed files with 10 additions and 6 deletions
  1. 10 6
      test/Util/visual_regression.sh

+ 10 - 6
test/Util/visual_regression.sh

@@ -69,36 +69,40 @@ else
   printf "only processing images matching bash string (not regex): ${files}\n"
 fi
 
-# some sanity checks: check if some png images are in the right folder and warn if not. doesn't make sure there are actual, correct png images though.
+# some sanity checks: check if some png files are in the right folder and warn if not. doesn't make sure there are actual, correct png images though.
 folderWarningStringMsg="Exiting without running visual regression tests.\n"
 # check if current directory exists / started from base OSMD folder
 if [ ! -e "$CURRENT" ]
 then
-  printf "Warning: directory ${CURRENT} missing. Please run npm run generate:current (and if necessary npm run generate:blessed) first.
+  printf "Warning: directory ${CURRENT} missing.
+    Please run npm run generate:current (and if necessary npm run generate:blessed) first.
     ${folderWarningStringMsg}"
   exit 1
 fi
 # check if blessed directory exists / started from base OSMD folder
 if [ ! -e "$BLESSED" ]
 then
-  printf "Warning: directory ${BLESSED} missing. Please run npm run generate:blessed first (or otherwise get the blessed images).
+  printf "Warning: directory ${BLESSED} missing.
+    Please run npm run generate:blessed first (or otherwise get the blessed images).
     ${folderWarningStringMsg}"
   exit 1
 fi
-# note: ls returns errors if the directory doesn't exist
+# note: ls returns errors if the directory doesn't exist (that's why we do the checks above)
 totalCurrentImages=`ls -l $CURRENT/*.png | wc -l | sed 's/[[:space:]]//g'`
 totalBlessedImages=`ls -l $BLESSED/*.png | wc -l | sed 's/[[:space:]]//g'`
 # check if there are some current images
 if [ "$totalCurrentImages" -lt 1 ]
 then
-  printf "Warning: Found no pngs in ${CURRENT}. Please run npm run generate (and if necessary npm run blessed) first.
+  printf "Warning: Found no pngs in ${CURRENT}.
+    Please run npm run generate (and if necessary npm run blessed) first.
     ${folderWarningStringMsg}"
   exit 1
 fi
 # check if there are some blessed images
 if [ "$totalBlessedImages" -lt 1 ]
 then
-  printf "Warning: Found no pngs in ${BLESSED}. Please run npm run blessed first, ideally on the repository's develop state.
+  printf "Warning: Found no pngs in ${BLESSED}.
+    Please run npm run blessed first, ideally on the repository's develop state.
     ${folderWarningStringMsg}"
   exit 1
 fi