-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdev-test.sh
67 lines (56 loc) · 932 Bytes
/
dev-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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
prev=$SS_DIR
export SS_DIR=$PWD
is_png()
{
tst=$(hexdump $1 | head -1 | awk '{print $2, $3}')
[ "$tst" = "5089 474e" ] && return 0
return 1
}
test()
{
type sss && {
# test 1
sss && {
is_png ./screenshot.png || {
echo "failed at test 1"
exit 1
}
}
# test 2
sss -n && {
is_png ./screenshot.png || {
echo "failed at test 2"
exit 1
}
}
# test 3
sss -f && {
is_png ./screenshot.png || {
echo "failed at test 3"
exit 1
}
}
# test 4
sss -n test.png && {
is_png ./test.png || {
echo "failed at test 4"
exit 1
}
}
# test 5
sss -f test.png && {
is_png ./test.png || {
echo "failed at test 5"
exit 1
}
}
cleanup
}
}
cleanup()
{
rm -f ./test.png ./screenshot.png ./fullscreen.png
}
test
export SS_DIR=$prev