-
Notifications
You must be signed in to change notification settings - Fork 32
/
.travis.yml
62 lines (56 loc) · 1.91 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
language: c
env:
matrix:
- "LUA=lua5.1 TRANSPORT=built-in EVLOOP=epoll"
- "LUA=lua5.1 TRANSPORT=built-in EVLOOP=select"
- "LUA=lua5.1 TRANSPORT=libevent"
- "LUA=lua5.1 TRANSPORT=uloop"
install:
- "sudo apt-get install -yq $LUA $lib$LUA-0-dev python-pexpect snmp luarocks"
- "sudo -H pip -q install PyYAML cpp-coveralls"
- "sudo luarocks install Lua-cURL"
- "sudo luarocks install luacov-coveralls"
- "sudo luarocks install lunitx"
- "if [ $TRANSPORT = 'libevent' ]; then
sudo apt-get install -yq libevent-dev;
fi"
- "if [ $TRANSPORT = 'uloop' ]; then
(
rm -rf json-c &&
git clone https://github.com/json-c/json-c.git &&
cd json-c &&
sh autogen.sh &&
./configure &&
make &&
sudo make install
) &&
(
rm -rf libubox &&
git clone http://git.openwrt.org/project/libubox.git &&
cd libubox &&
cmake . &&
make &&
cp libubox.so ..
);
fi"
- "wget -q https://raw.githubusercontent.com/credosemi/pub/master/net-snmp-pre-built.tar.gz"
- "tar xzf net-snmp-pre-built.tar.gz"
script:
- "if [ $TRANSPORT = 'uloop' ]; then
export LDFLAGS='-L./libubox' &&
export CFLAGS='-I.';
fi"
- "if [ $TRANSPORT = 'built-in' ]; then
scons --transport=$TRANSPORT --evloop=$EVLOOP --gcov=yes;
else
scons --transport=$TRANSPORT --gcov=yes;
fi"
- "sudo LUACOV=1 SYS_LUA_PATH=`$LUA -e 'print(package.path)'` LUA=$LUA python ./tests/test_all.py"
- "sudo chmod 666 luacov.stats.out"
- "$LUA -lluacov tests/test_utils.lua"
after_success:
- "cpp-coveralls -b . -e .sconf_temp `ls core/*.gcno | sed 's/\\.gcno$/.c/' | sed 's/^/-i /'` --dump c.report.json"
- "luacov-coveralls -j c.report.json -i bin/smartsnmpd -i lualib/smartsnmp/init.lua -i lualib/smartsnmp/utils.lua"
after_failure:
- "cat config.log"
- "cat tests/test.log"