summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-27 03:35:29 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-27 03:35:29 +0100
commit7daee6daefee15183e87f9f01680f27a34274bc1 (patch)
tree7ed47c2f6796402534c41b3708550520a2e07331
parent2b4ac9b580dcde28a428be2c5e662dc6c88ac054 (diff)
downloadgallery-7daee6daefee15183e87f9f01680f27a34274bc1.tar.gz
gallery-7daee6daefee15183e87f9f01680f27a34274bc1.tar.xz
gallery-7daee6daefee15183e87f9f01680f27a34274bc1.zip
Start generalizing the test script
-rwxr-xr-xtest.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/test.sh b/test.sh
index 0f69676..844148c 100755
--- a/test.sh
+++ b/test.sh
@@ -1,28 +1,29 @@
#!/bin/sh -xe
+cd "$(dirname "$0")"
make gallery
-target=/tmp/G input=/tmp/Gi
-rm -rf $target $input
+target=/tmp/G input=/tmp/G/Images
+rm -rf $target
-mkdir -p $target
-cp -ra $HOME/Pictures/Anime $input
+mkdir -p $target $input
+# TODO: Generate something in there.
./gallery init $target
./gallery sync $target $input "$@"
./gallery thumbnail $target
./gallery dhash $target
-./gallery tag $target autotagger "DanBooru autotagger" \
- < ../build-db/autotagger.tsv
+./gallery tag $target test "Test space" < /dev/null
./gallery web $target :8080 &
web=$!
-trap "kill $web; wait $web" EXIT INT
+trap "kill $web; wait $web" EXIT INT TERM
sleep 0.25
call() (curl http://localhost:8080/api/$1 -X POST --data-binary @-)
-echo '{"path":"/tmp/Gi"}' | call browse
+echo '{"path":"'"$(basename "$input")"'"}' | call browse
echo '{}' | call tags
echo '{}' | call duplicates
echo '{}' | call orphans
+# TODO: Use hashes of generated images.
echo '{"sha1":"d53fc82162fd19a6e7b92b401b08b7505dbf3dfd"}' | call info
echo '{"sha1":"9539d9895ab8c25d76c321b23b8a327801a496bb"}' | call similar