Browse Source

Travis: add Artist exif test (#35)

Cody Garver 1 year ago
parent
commit
b7ae40798f
2 changed files with 31 additions and 0 deletions
  1. 9 0
      .travis.yml
  2. 22 0
      tests.sh

+ 9 - 0
.travis.yml

@@ -0,0 +1,9 @@
+---
+
+language: bash
+
+sudo: true
+
+before_script: sudo apt-get install -y exif
+
+script: bash tests.sh

+ 22 - 0
tests.sh

@@ -0,0 +1,22 @@
+#!/bin/sh
+set -e
+
+# Ensure Artist metadata is not corrupt, does exist and at least 3 chars
+test_artist () {
+    print_error () {
+        echo "Failure! $1 missing Artist metadata! See README.md."
+        exit 1
+    }
+
+    ARTIST="$(exif --tag=Artist --no-fixup -m "$1")" || print_error "$1"
+    if [ "$(echo "$ARTIST" | wc -m)" -lt 3 ]; then
+        print_error "$1"
+    fi
+}
+
+for WALLPAPER in *.jpg
+do
+    test_artist "$WALLPAPER"
+done
+
+echo "Success! Wallpapers have Artist metadata."