forked from pxscene/pxCore2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_linux.sh
executable file
·80 lines (76 loc) · 1.82 KB
/
build_linux.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
78
79
80
#!/bin/sh
BUILDLOGS=$TRAVIS_BUILD_DIR/logs/build_logs
checkError()
{
if [ "$1" -ne 0 ]
then
echo "Build failed with errors !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
exit 1;
fi
}
cd $TRAVIS_BUILD_DIR/src
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "***************************** Building pxcore and rtcore ****" >> $BUILDLOGS
make -f Makefile.glut all>>$BUILDLOGS 2>&1;
checkError $?
make -f Makefile.glut rtcore>>$BUILDLOGS 2>&1;
checkError $?
else
echo "***************************** Building pxcore and rtcore ****"
make -f Makefile.glut all 1>>$BUILDLOGS;
checkError $?
make -f Makefile.glut rtcore 1>>$BUILDLOGS;
checkError $?
fi
cd $TRAVIS_BUILD_DIR/examples/pxScene2d/src
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "***************************** Building libpxscene ****" >> $BUILDLOGS;
make clean;
make libs-glut>>$BUILDLOGS 2>&1;
checkError $?
else
echo "***************************** Building libpxscene ****";
make clean;
make libs-glut 1>>$BUILDLOGS;
checkError $?
fi
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "***************************** Building pxscene app ***" >> $BUILDLOGS
make -j>>$BUILDLOGS 2>&1
checkError $?
else
echo "***************************** Building pxscene app ***"
make -j 1>>$BUILDLOGS
checkError $?
fi
cd $TRAVIS_BUILD_DIR/tests/pxScene2d;
if [ "$TRAVIS_PULL_REQUEST" = "false" ]
then
echo "***************************** Building unittests ***" >> $BUILDLOGS;
make clean;
make>>$BUILDLOGS 2>&1;
checkError $?
else
echo "***************************** Building unittests ***";
make clean;
make 1>>$BUILDLOGS;
checkError $?
fi
touch $TRAVIS_BUILD_DIR/logs/test_logs;
TESTLOGS=$TRAVIS_BUILD_DIR/logs/test_logs;
./pxscene2dtests.sh>$TESTLOGS 2>&1;
grep "FAILED" $TESTLOGS
retVal=$?
if [ "$retVal" -eq 0 ]
then
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
then
cat $TESTLOGS
exit 1;
fi
else
exit 0;
fi