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