-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·48 lines (39 loc) · 1.19 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
#!/bin/bash
#set -e
rm -r demo
cp -r demo.bak demo
find demo -not -path "./demo/.time/*" -type f -exec md5sum {} \; > checklist.chk
cargo run --release -- -c demo.bak/config.json
rm -r demo/*
cp -r src/* demo/
find demo -not -path "demo/.time/*" -type f -exec md5sum {} \; > checklist-two.chk
cargo run --release -- -c demo.bak/config.json
cp -r gui/* demo/ # Do a test that includes pre-existing files.
find demo -not -path "demo/.time/*" -type f -exec md5sum {} \; > checklist-three.chk
cargo run --release -- -c demo.bak/config.json
echo "Checking demo..."
cargo run --release -- -c demo.bak/config.json restore --restore-index 1
if ! md5sum -c --quiet checklist.chk
then
echo "demo failed check!"
exit 0
fi
echo "Checking src..."
cargo run --release -- -c demo.bak/config.json restore --restore-index 2
if ! md5sum -c --quiet checklist-two.chk
then
echo "src failed check!"
exit 0
fi
echo "Checking src+gui..."
cargo run --release -- -c demo.bak/config.json restore --restore-index 3
if ! md5sum -c --quiet checklist-three.chk
then
echo "src+gui failed check!"
exit 0
fi
printf "\nAll tests passed!"
rm checklist.chk
rm checklist-two.chk
rm checklist-three.chk
cp -r demo.bak demo