-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·76 lines (69 loc) · 1.13 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
#!/bin/bash
BUILD_DIR="build"
test_2d () {
cd "$BUILD_DIR" || exit 1
SUCCESS=()
FAILURE=()
for POLYGON_ID in $(seq 12); do
CMD="./StraightSkel 2d $POLYGON_ID --no-window"
echo ""
echo "$CMD"
$CMD
if [ $? -eq 0 ]; then
SUCCESS+=("$CMD")
else
FAILURE+=("$CMD")
fi
echo ""
done
echo ""
echo "SUCCESS:"
for CMD in "${SUCCESS[@]}"; do
echo "$CMD"
done
echo ""
echo "FAILURE:"
for CMD in "${FAILURE[@]}"; do
echo "$CMD"
done
echo ""
}
test_3d () {
cd "$BUILD_DIR" || exit 1
SUCCESS=()
FAILURE=()
POLYHEDRONS=$(find ../res/polyhedrons/events -type f -name '*.obj' | sort)
for POLYHEDRON in $POLYHEDRONS; do
CMD="./StraightSkel 3d load $POLYHEDRON --no-window"
echo ""
echo "$CMD"
$CMD
if [ $? -eq 0 ]; then
SUCCESS+=("$CMD")
else
FAILURE+=("$CMD")
fi
echo ""
done
echo ""
echo "SUCCESS:"
for CMD in "${SUCCESS[@]}"; do
echo "$CMD"
done
echo ""
echo "FAILURE:"
for CMD in "${FAILURE[@]}"; do
echo "$CMD"
done
echo ""
}
case "$1" in
'2d')
test_2d
;;
'3d')
test_3d
;;
*)
test_3d
esac