feat: tests

This commit is contained in:
ange 2024-04-14 13:40:14 +02:00
parent dffaa00d9f
commit aa3c0a5191
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
4 changed files with 29 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
test*/

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM docker.io/debian:12-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
imagemagick \
zenity \
&& rm -rf /var/lib/apt/lists/*
COPY compress /usr/local/bin/
CMD ["compress", "/images/"]

12
compose.yaml Normal file
View File

@ -0,0 +1,12 @@
---
services:
app:
build: .
environment:
- DISPLAY=$DISPLAY
- XAUTHORITY=/.Xauthority
volumes:
- ./test/:/images/:ro
- ./test_1080p/:/images_1080p/
- "$XAUTHORITY:/.Xauthority:ro"
- "/tmp/.X11-unix/:/tmp/.X11-unix/"

7
test.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash -e
mkdir -p test test_1080p
gm convert -size 3840x2160 xc:black test/000.png
printf '%s\n' {001..127} | xargs -P0 -I'{}' cp test/000.png test/'{}'.png