]> gitweb.hhaalo.de Git - albentohandy.git/commitdiff
add repro test
authorBastian Dehn <hhaalo@arcor.de>
Wed, 30 Sep 2026 15:18:29 +0000 (17:18 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 30 Sep 2026 16:25:31 +0000 (18:25 +0200)
.gitignore
Makefile
tests/repro.bats [new file with mode: 0755]

index c795b054e5ade51b7031abab1581a5b7e2d2f5ba..0fd8a0ddb4cf3672f7235c953a9dd705f8e068f4 100644 (file)
@@ -1 +1,2 @@
+albumlist
 build
\ No newline at end of file
index 536afeedc5797f196340b98765278d6b076f07cd..b3218ab2d26da1e362b172bca4c0c33dbb5f9336 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ SHAREDIR=usr/share/doc/$(NAME)
 MANDIR=usr/share/man
 PACKAGE=$(NAME)_$(VERSION)-$(REVISION)$(EXTRA_VERSION)_x86_64
 
-.PHONY: all build test clean package
+.PHONY: all build test repro clean package
 
 all: test package
 
@@ -29,6 +29,9 @@ test:
        ./tests/opus.bats
        ./tests/flac.bats
 
+repro:
+       ./tests/repro.bats
+
 clean:
        rm --recursive --force build
 
diff --git a/tests/repro.bats b/tests/repro.bats
new file mode 100755 (executable)
index 0000000..b58bc84
--- /dev/null
@@ -0,0 +1,142 @@
+#!/usr/bin/bats
+
+setup() {
+       bats_load_library 'bats-support'
+       bats_load_library 'bats-assert'
+}
+
+setup_file() {
+       [ -f "albumlist" ]
+}
+
+teardown_file() {
+       rm --recursive --force "build/tests"
+}
+
+@test "run create origin vorbis" {
+       local lib="vorbis"
+       export OUTPUT_PATH="build/tests/origin-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create repro vorbis" {
+       local lib="vorbis"
+       export OUTPUT_PATH="build/tests/repro-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run origin checksum on repro vorbis" {
+       local lib="vorbis"
+       cp "build/tests/origin-$lib/checksum.sha256" \
+               "build/tests/repro-$lib/checksum.sha256"
+
+       cd "build/tests/repro-$lib"
+
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create origin mp3" {
+       local lib="mp3"
+       export OUTPUT_PATH="build/tests/origin-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create repro mp3" {
+       local lib="mp3"
+       export OUTPUT_PATH="build/tests/repro-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run origin checksum on repro mp3" {
+       local lib="mp3"
+       cp "build/tests/origin-$lib/checksum.sha256" \
+               "build/tests/repro-$lib/checksum.sha256"
+
+       cd "build/tests/repro-$lib"
+
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create origin opus" {
+       local lib="opus"
+       export OUTPUT_PATH="build/tests/origin-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create repro opus" {
+       local lib="opus"
+       export OUTPUT_PATH="build/tests/repro-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run origin checksum on repro opus" {
+       local lib="opus"
+       cp "build/tests/origin-$lib/checksum.sha256" \
+               "build/tests/repro-$lib/checksum.sha256"
+
+       cd "build/tests/repro-$lib"
+
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create origin flac" {
+       local lib="flac"
+       export OUTPUT_PATH="build/tests/origin-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run create repro flac" {
+       local lib="flac"
+       export OUTPUT_PATH="build/tests/repro-$lib"
+
+       ./src/albentohandy -i "albumlist" -l "$lib"
+
+       [ -f "$OUTPUT_PATH/checksum.sha256" ]
+       cd "$OUTPUT_PATH"
+       sha256sum -c "checksum.sha256"
+}
+
+@test "run origin checksum on repro flac" {
+       local lib="flac"
+       cp "build/tests/origin-$lib/checksum.sha256" \
+               "build/tests/repro-$lib/checksum.sha256"
+
+       cd "build/tests/repro-$lib"
+
+       sha256sum -c "checksum.sha256"
+}
\ No newline at end of file