-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.sh
executable file
·77 lines (62 loc) · 1.53 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
echo "Compiling program"
cargo build
echo "Compile complete"
echo
echo "Testing graphical program"
./target/debug/gobble xterm -e sh -c 'echo Close this terminal; exec sh'
echo "Test complete"
echo
echo "Testing cli program"
./target/debug/gobble echo testing
echo "Test complete"
echo
echo "Testing incorrect arguments"
./target/debug/gobble ls doesnotexist
echo "Test complete"
echo
echo "Testing non-existent command"
./target/debug/gobble ehco testing
echo "Test complete"
echo
echo "Testing no arguments"
./target/debug/gobble
echo "Test complete"
echo
echo "Testing simulated Wayland"
WAYLAND_DISPLAY=test ./target/debug/gobble xterm -e sh -c 'echo Close this terminal; exec sh'
echo "Test complete"
echo
echo "Performance test"
echo "Gobble:"
time for I in {0..1000}; do ./target/debug/gobble printf ' ' 2>/dev/null; done
echo "Devour:"
time for I in {0..1000}; do devour printf ' ' 2>/dev/null; done
echo "Test complete"
echo
echo "Overlap mode test"
./target/debug/gobble -o xterm -e sh -c 'echo Close this terminal; exec sh'
echo "Test complete"
echo
echo "Testing multiple flags + wrong flags"
./target/debug/gobble -v -l
echo "Test complete"
echo
echo "Testing version flag"
./target/debug/gobble -v
echo "Test complete"
echo
echo "Testing flag in the wrong spot"
./target/debug/gobble echo -h
echo "Test complete"
echo
echo "Test quick window close"
./target/debug/gobble -o xterm -e sh -c exit
echo "Test complete"
echo
echo "Test terminal app"
./target/debug/gobble top
echo "Test complete"
echo
echo "All tests completed"
exit 0