add debug flag
[lttng-ci.git] / lttng-tools / lttng-tools-master-test-joraj.sh
CommitLineData
6ab8a284 1set -x
4749cca8
JR
2# Create build directory
3rm -rf $WORKSPACE/build
4mkdir -p $WORKSPACE/build
5
6# liburcu
7URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/"
8URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/"
9
10# lttng-ust
11UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/"
12UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/"
6ab8a284 13UST_PREFIX="$WORKSPACE/dependencies/lttng-ust/build/"
4749cca8
JR
14
15# babeltrace
16BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/"
17BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/"
18
19PREFIX="$WORKSPACE/build"
20
73f32895 21CONF_OPTS=""
4749cca8
JR
22if [ "$conf" = "no_ust" ]
23then
24 export CPPFLAGS="-I$URCU_INCS"
25 export LDFLAGS="-L$URCU_LIBS"
26 export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
27else
65d81e88 28 CONF_OPTS+=" --with-lttng-ust-prefix="$UST_PREFIX
4749cca8
JR
29 export CPPFLAGS="-I$URCU_INCS"
30 export LDFLAGS="-L$URCU_LIBS"
31 export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
32fi
33
34./bootstrap
35
4749cca8
JR
36case "$conf" in
37# Currently disabled, ust doesn't seem to be built right for static linking.
38#static)
39# echo "Static build"
40# CONF_OPTS="--enable-static --disable-shared"
41# ;;
42python_bindings)
43 echo "Build with python bindings"
44 # We only support bindings built with Python 3
45 export PYTHON="python3"
46 export PYTHON_CONFIG="/usr/bin/python3-config"
65d81e88 47 CONF_OPTS+=" --enable-python-bindings"
4749cca8
JR
48 ;;
49no_ust)
50 echo "Build without UST support"
65d81e88 51 CONF_OPTS+=" --disable-lttng-ust"
4749cca8
JR
52 ;;
53java_jul)
54 echo "Build with java-jul UST support"
65d81e88 55 CONF_OPTS+=" --enable-java-agent-tests-jul --with-java-classpath=$UST_PREFIX/share/java/\*"
4749cca8 56 ;;
73f32895
JR
57java_log4j)
58 echo "Build with java-log4j UST support"
65d81e88 59 CONF_OPTS+=" --enable-java-agent-tests-log4j --with-java-classpath=/usr/share/java/log4j-1.2.jar"
1813294c 60 ;;
4749cca8
JR
61*)
62 echo "Standard build"
65d81e88 63 CONF_OPTS+=" "
4749cca8
JR
64 ;;
65esac
66
67# Build type
68# oot : out-of-tree build
69# dist: build via make dist
70# * : normal tree build
71#
72# Make sure to move to the build_path and configure
73# before continuing
cf668c08 74echo "**************************************************"
6a863564 75echo $CONF_OPTS
cf668c08 76echo "**************************************************"
4749cca8
JR
77
78BUILD_PATH=$WORKSPACE
79case "$build" in
80 oot)
81 echo "Out of tree build"
82 BUILD_PATH=$WORKSPACE/oot
83 mkdir -p $BUILD_PATH
84 cd $BUILD_PATH
85 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
86 ;;
87 dist)
88 echo "Distribution out of tree build"
89 BUILD_PATH=`mktemp -d`
90
91 # Initial configure and generate tarball
6a863564 92 ./configure $CONF_OPTS
4749cca8
JR
93 make dist
94
95 mkdir -p $BUILD_PATH
96 cp *.tar.* $BUILD_PATH/
97 cd $BUILD_PATH
98
99 # Ignore level 1 of tar
100 tar xvf *.tar.* --strip 1
101
102 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
103 ;;
104 *)
105 BUILD_PATH=$WORKSPACE
106 echo "Standard tree build"
107 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
108 ;;
109esac
110
111
112make
113make install
114
115# Run tests
116# Allow core dumps
117ulimit -c unlimited
118
119chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace
120export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin"
121
122rm -rf $WORKSPACE/tap
123mkdir -p $WORKSPACE/tap
124mkdir -p $WORKSPACE/tap/unit
125mkdir -p $WORKSPACE/tap/fast_regression
126mkdir -p $WORKSPACE/tap/with_bindings_regression
127
128cd $BUILD_PATH/tests
129
130if [ "$conf" = "std" ]
131then
132 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
133 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
134fi
135
136if [ "$conf" = "java_jul" ]
137then
138 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
139 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
140fi
141
142if [ "$conf" = "no_ust" ]
143then
144 # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
145 echo "Testsuite disabled. See job configuration for more info."
146fi
147
148if [ "$conf" = "python_bindings" ]
149then
150 # Disabled due to race conditions in tests
151 echo "Testsuite disabled. See job configuration for more info."
152 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
153 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
154 prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true
155fi
156
157# TAP plugin is having a hard time with .yml files.
158rm -f $WORKSPACE/tap/unit/meta.yml
159rm -f $WORKSPACE/tap/fast_regression/meta.yml
160rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml
161
162# And also with files without extension, so rename all result to *.tap
163find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
164find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \;
165find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \;
166
167# Cleanup
168make clean
169
170# Cleanup rpath and libtool .la files
171find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
172find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
173find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
174
175# Clean temp dir for dist build
176if [ $build = "dist" ]; then
177 rm -rf $BUILD_PATH
178fi
6ab8a284 179set +x
This page took 0.029143 seconds and 4 git commands to generate.