-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathtestAllExamples.sh
executable file
·42 lines (38 loc) · 1.73 KB
/
testAllExamples.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
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $SCRIPT_DIR
for category in $( find ../../examples -maxdepth 1 -type d )
do
if [ "$category" = "../../examples/android" -o "$category" = "../../examples/ios" -o "$category" = "../../examples/gles" -o "$category" = "../../examples" ]; then
continue
fi
echo "-----------------------------------------------------------------"
echo running ALL examples in $category
echo "-----------------------------------------------------------------"
for example in $( find $category -maxdepth 1 -type d )
do
if [ "$example" = "$category" ]; then
continue
fi
if [ ! -d "$example"/bin/$(basename $example).app ]; then
echo "-----------------------------------------------------------------"
echo building $example
if [ ! -e "$example"/$(basename $example).xcodeproj ]; then
echo "-----------------------------------------------------------------"
echo no xcode project for $example
continue
fi
xcodebuild -configuration Release -target $(basename $example) -project $example/$(basename $example).xcodeproj
ret=$?
if [ $ret -ne 0 ]; then
echo failed building $example
exit
fi
echo "-----------------------------------------------------------------"
fi
echo running $example
echo "-----------------------------------------------------------------"
"$example"/bin/$(basename $example).app/Contents/MacOS/$(basename $example)
echo "-----------------------------------------------------------------"
done
done