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