forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
142 lines (128 loc) · 5.18 KB
/
.travis.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
os:
- linux
- osx
language: cpp
sudo: required
dist: trusty
osx_image: xcode7
before_install:
# Install nodejs via nvm
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash;
source ~/.bashrc;
nvm install 6 && nvm use 6;
npm install -g node-gyp;
npm install -g mocha;
fi
# Remove duplicated python 2.x, only leave python2.7; Otherwise node-gyp will complain and stop
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
for i in `pyenv versions|sed 's/ //g'|grep "^2"`; do if [ $i = "2.7" ]; then continue; else pyenv uninstall -f $i; fi; done;
fi
# Run linter
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git;
export OLDPATH=$PATH && export PATH=$PATH:$(pwd)/depot_tools;
cd wrappers/nodejs/tools && npm install && cd ..;
node ./tools/linter.js;
export PATH=$OLDPATH && unset OLDPATH && cd ../../;
fi
# Get logical CPU number
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export CPU_NUM=`grep -c ^processor /proc/cpuinfo`;
elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
export CPU_NUM=`sysctl -n hw.logicalcpu_max`;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew uninstall xctool;
brew install xctool --HEAD;
brew install homebrew/core/glfw3;
brew list libusb || brew install libusb;
fi
# Install linux required packages
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
sudo apt-get install -qq build-essential xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev libglm-dev;
sudo apt-get install -qq libusb-1.0-0-dev;
sudo apt-get install -qq libgtk-3-dev;
sudo apt-get install -qq python python-dev;
sudo apt-get install gcc-5 g++-5;
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5;
fi
install:
# Install nodejs via nvm
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://github.com/glfw/glfw/releases/download/3.1.1/glfw-3.1.1.zip;
unzip glfw-3.1.1.zip && cd glfw-3.1.1;
cmake -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON;
make -j $CPU_NUM;
sudo make install && cd ..;
fi
#Unit-Test Suite
# Each successful build will invoke a set of predefined unit-test that will run from recorded live test sessions
# The records are available for download from the location specified in the tests, and are arranged in the following convention
# |
# |---| ..
# | | Records.txt
# | |
# | | single_cam
# | | ..
# | | Recorded_Test_1
# | | Recorded_Test_2
# | | ......
# |
# | | multi_cam
# | | ..
# | | Recorded_Test_3
# | | Recorded_Test_4
# | | ......
# |
# The content of Records.txt is a list of all record paths one per line, e.g:
# single_cam/Recorded_Test_1
# single_cam/Recorded_Test_2
# multi_cam/Recorded_Test_3
# multi_cam/Recorded_Test_4
#
script:
# Exit immediately if a command exits with a non-zero status
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
set -e;
pyenv install 3.6.1;
pyenv local `pyenv versions|sed 's/ //g'|grep "^3"|tail -1`;
cd scripts;
./api_check.sh;
cd ..;
mkdir build && cd build;
cmake .. -DBUILD_EXAMPLES:BOOL=true -DBUILD_PYTHON_BINDINGS:BOOL=true -DBUILD_NODEJS_BINDINGS:BOOL=true -DBUILD_UNIT_TESTS:BOOL=true;
make -j $CPU_NUM;
sudo "PATH=$PATH" make install;
export LRS_LOG_LEVEL="DEBUG";
url_records_path="http://realsense-hw-public.s3.amazonaws.com/rs-tests/lrs_2.8.3/";
records_name="records.txt";
url_records_list=$url_records_path$records_name;
wget $url_records_path$records_name;
tests_list=`cat $records_name`;
echo "Downloading unit-test records...";
for record in $tests_list; do echo $url_records_path$record; wget $url_records_path$record -P "records/"$(echo $record | cut -d '/' -f 1); done;
./unit-tests/live-test -d yes -i [software-device];
for i in ./records/single_cam/*; do ./unit-tests/live-test -d yes -i ~[multicam] from "$i"; done;
for i in ./records/multi_cam/*; do ./unit-tests/live-test -d yes -i [multicam] from "$i"; done;
echo "Build RealSense SDK for Android...";
cd ../;
wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip;
unzip android-ndk-r16b-linux-x86_64.zip -d ./;
mkdir build_android && cd build_android;
cmake .. -DCMAKE_TOOLCHAIN_FILE=../android-ndk-r16b/build/cmake/android.toolchain.cmake;
make -j $CPU_NUM;
fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
mkdir build && cd build;
cmake .. -DBUILD_EXAMPLES:BOOL=true -DBUILD_WITH_OPENMP=false -DHWM_OVER_XU=false;
make -j $CPU_NUM;
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
cd ../wrappers/nodejs/test;
wget http://realsense-hw-public.s3.amazonaws.com/rs-tests/nodejs_record.rec;
mocha test-functional.js --playback nodejs_record.rec;
cd ../../..;
fi