6e2bc892d441acce629564031d68f03e1c98b862
[lttng-ci.git] / lttng-tools / lttng-tools-master.sh
1 # Create build directory
2 rm -rf $WORKSPACE/build
3 mkdir -p $WORKSPACE/build
4
5 # liburcu
6 URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/"
7 URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/"
8
9 # lttng-ust
10 UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/"
11 UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/"
12
13 # babeltrace
14 BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/"
15 BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/"
16
17 PREFIX="$WORKSPACE/build"
18
19 if [ "$conf" = "no_ust" ]
20 then
21 export CPPFLAGS="-I$URCU_INCS"
22 export LDFLAGS="-L$URCU_LIBS"
23 export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
24 else
25 export CPPFLAGS="-I$URCU_INCS -I$UST_INCS"
26 export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS"
27 export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
28 fi
29
30 ./bootstrap
31
32 CONF_OPTS=""
33 case "$conf" in
34 # Currently disabled, ust doesn't seem to be built right for static linking.
35 #static)
36 # echo "Static build"
37 # CONF_OPTS="--enable-static --disable-shared"
38 # ;;
39 python_bindings)
40 echo "Build with python bindings"
41 # We only support bindings built with Python 3
42 export PYTHON="python3"
43 export PYTHON_CONFIG="/usr/bin/python3-config"
44 CONF_OPTS="--enable-python-bindings"
45 ;;
46 no_ust)
47 echo "Build without UST support"
48 CONF_OPTS="--disable-lttng-ust"
49 ;;
50 *)
51 echo "Standard build"
52 CONF_OPTS=""
53 ;;
54 esac
55
56 ./configure --prefix=$PREFIX $CONF_OPTS
57
58 make
59 make install
60
61 # Run tests
62 # Allow core dumps
63 ulimit -c unlimited
64
65 chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace
66 export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin"
67
68 rm -rf $WORKSPACE/tap
69 mkdir -p $WORKSPACE/tap
70 mkdir -p $WORKSPACE/tap/unit
71 mkdir -p $WORKSPACE/tap/fast_regression
72 mkdir -p $WORKSPACE/tap/with_bindings_regression
73
74 cd $WORKSPACE/tests
75
76 if [ "$conf" = "std" ]
77 then
78 prove --merge --exec '' - < $WORKSPACE/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
79 prove --merge --exec '' - < $WORKSPACE/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
80 fi
81
82 if [ "$conf" = "no_ust" ]
83 then
84 # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
85 echo "Testsuite disabled. See job configuration for more info."
86 fi
87
88 if [ "$conf" = "python_bindings" ]
89 then
90 # Disabled due to race conditions in tests
91 echo "Testsuite disabled. See job configuration for more info."
92 prove --merge --exec '' - < $WORKSPACE/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
93 prove --merge --exec '' - < $WORKSPACE/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
94 prove --merge --exec '' - < $WORKSPACE/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true
95 fi
96
97 # TAP plugin is having a hard time with .yml files.
98 rm -f $WORKSPACE/tap/unit/meta.yml
99 rm -f $WORKSPACE/tap/fast_regression/meta.yml
100 rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml
101
102 # And also with files without extension, so rename all result to *.tap
103 find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
104 find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \;
105 find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \;
106
107 # Cleanup
108 make clean
109
110 # Cleanup rpath and libtool .la files
111 find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
112 find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
113 find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
This page took 0.032515 seconds and 4 git commands to generate.