From b791382308ae608eec6468a4eb8d6d92f551630f Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Wed, 30 Sep 2026 17:18:29 +0200 Subject: [PATCH] add repro test --- .gitignore | 1 + Makefile | 5 +- tests/repro.bats | 142 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 1 deletion(-) create mode 100755 tests/repro.bats diff --git a/.gitignore b/.gitignore index c795b05..0fd8a0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +albumlist build \ No newline at end of file diff --git a/Makefile b/Makefile index 536afee..b3218ab 100644 --- 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 index 0000000..b58bc84 --- /dev/null +++ b/tests/repro.bats @@ -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 -- 2.47.3