Add test-branch recipe for jul
[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/"
12UST_PREFIX="$WORKSPACE/dependencies/lttng-ust/build/"
13
14# babeltrace
15BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/"
16BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/"
17
18PREFIX="$WORKSPACE/build"
19
20CONF_OPT=""
21
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
28 CONF_OPTS+=" --with-lttng-ust-prefix=$UST_PREFIX"
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
36CONF_OPTS=""
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"
48 CONF_OPTS="--enable-python-bindings"
49 ;;
50no_ust)
51 echo "Build without UST support"
52 CONF_OPTS="--disable-lttng-ust"
53 ;;
54java_jul)
55 echo "Build with java-jul UST support"
56 CONF_OPTS+=" --enable-java-agent-tests-jul --with-java-classpath=$UST_PREFIX/share/java/*"
57 ;;
58*)
59 echo "Standard build"
60 CONF_OPTS=""
61 ;;
62esac
63
64# Build type
65# oot : out-of-tree build
66# dist: build via make dist
67# * : normal tree build
68#
69# Make sure to move to the build_path and configure
70# before continuing
71
72BUILD_PATH=$WORKSPACE
73case "$build" in
74 oot)
75 echo "Out of tree build"
76 BUILD_PATH=$WORKSPACE/oot
77 mkdir -p $BUILD_PATH
78 cd $BUILD_PATH
79 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
80 ;;
81 dist)
82 echo "Distribution out of tree build"
83 BUILD_PATH=`mktemp -d`
84
85 # Initial configure and generate tarball
86 ./configure
87 make dist
88
89 mkdir -p $BUILD_PATH
90 cp *.tar.* $BUILD_PATH/
91 cd $BUILD_PATH
92
93 # Ignore level 1 of tar
94 tar xvf *.tar.* --strip 1
95
96 $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS
97 ;;
98 *)
99 BUILD_PATH=$WORKSPACE
100 echo "Standard tree build"
101 $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS
102 ;;
103esac
104
105
106make
107make install
108
109# Run tests
110# Allow core dumps
111ulimit -c unlimited
112
113chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace
114export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin"
115
116rm -rf $WORKSPACE/tap
117mkdir -p $WORKSPACE/tap
118mkdir -p $WORKSPACE/tap/unit
119mkdir -p $WORKSPACE/tap/fast_regression
120mkdir -p $WORKSPACE/tap/with_bindings_regression
121
122cd $BUILD_PATH/tests
123
124if [ "$conf" = "std" ]
125then
126 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
127 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
128fi
129
130if [ "$conf" = "java_jul" ]
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" = "no_ust" ]
137then
138 # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
139 echo "Testsuite disabled. See job configuration for more info."
140fi
141
142if [ "$conf" = "python_bindings" ]
143then
144 # Disabled due to race conditions in tests
145 echo "Testsuite disabled. See job configuration for more info."
146 prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
147 prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
148 prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true
149fi
150
151# TAP plugin is having a hard time with .yml files.
152rm -f $WORKSPACE/tap/unit/meta.yml
153rm -f $WORKSPACE/tap/fast_regression/meta.yml
154rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml
155
156# And also with files without extension, so rename all result to *.tap
157find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
158find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \;
159find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \;
160
161# Cleanup
162make clean
163
164# Cleanup rpath and libtool .la files
165find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
166find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
167find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
168
169# Clean temp dir for dist build
170if [ $build = "dist" ]; then
171 rm -rf $BUILD_PATH
172fi
This page took 0.027678 seconds and 4 git commands to generate.