-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.sh
52 lines (43 loc) · 1.7 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/bash
# A simple test harness for track_list_to_cue_sheet that verifies a known input
# against a given output.
# TODO: Clean up repeated validation code. Of course, this is bash, so it's
# a huge pain to do flow control if there are quotes and spaces involved.
num_tests_failed=0
python track_list_to_cue_sheet.py testdata/rockapella_in_concert.tsv \
--performer Rockapella --title "In Concert" --start-time 50 \
--rem "GENRE Pop" "DATE 2001" --name-index 1 --time-index 3 \
--audio-file="testdata/rockapella_in_concert.mp3" \
| diff - testdata/rockapella_in_concert.cue
if (( $? == 0 )); then
echo "Rockapella test success!";
else
echo "Rockapella test failed";
((num_tests_failed++))
fi
python track_list_to_cue_sheet.py testdata/clap_it_up_dan.tsv \
--performer "Clap It Up Dan" --title "Covers 2020–2021" \
--timestamp --end-time 1:14:22 --rem "GENRE Christian" "DATE 2021" \
--name-index 1 --time-index 0 --performer-index 2 \
--audio-file="testdata/clap_it_up_dan.mp3" \
| diff - testdata/clap_it_up_dan.cue
if (( $? == 0 )); then
echo "Clap It Up Dan test success!";
else
echo "Clap It Up Dan test failed";
((num_tests_failed++))
fi
python track_list_to_cue_sheet.py testdata/petite_messe_solennelle.tsv \
--performer "Wolfgang Sawallisch" \
--title "Petite Messe solennelle – Vocal Highlights" --timestamp \
--name-index 1 --time-index 0 --performer-index 2 \
--audio-file=testdata/petite_messe_solennelle.ogg \
--rem "GENRE Classical" "DATE 1972" --no-dummy \
| diff - testdata/petite_messe_solennelle.cue
if (( $? == 0 )); then
echo "Petite Messe solennelle test success!";
else
echo "Petite Messe solennelle test failed";
((num_tests_failed++))
fi
exit $num_tests_failed