add debug flag
[lttng-ci.git] / lttng-tools / lttng-tools-master-test-joraj.sh
1 set -x
2 # Create build directory
3 rm -rf $WORKSPACE/build
4 mkdir -p $WORKSPACE/build
5
6 # liburcu
7 URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/"
8 URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/"
9
10 # lttng-ust
11 UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/"
12 UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/"
13 UST_PREFIX="$WORKSPACE/dependencies/lttng-ust/build/"
14
15 # babeltrace
16 BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/"
17 BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/"
18
19 PREFIX="$WORKSPACE/build"
20
21 CONF_OPTS=""
22 if [ "$conf" = "no_ust" ]
23 then
24 export CPPFLAGS="-I$URCU_INCS"
25 export LDFLAGS="-L$URCU_LIBS"
26 export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH"
27 else
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"
32 fi
33
34 ./bootstrap
35
36 case "$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 # ;;
42 python_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"
47 CONF_OPTS+=" --enable-python-bindings"
48 ;;
49 no_ust)
50 echo "Build without UST support"
51 CONF_OPTS+=" --disable-lttng-ust"
52 ;;
53 java_jul)
54 echo "Build with java-jul UST support"
55 CONF_OPTS+=" --enable-java-agent-tests-jul --with-java-classpath=$UST_PREFIX/share/java/\*"
56 ;;
57 java_log4j)
58 echo "Build with java-log4j UST support"
59 CONF_OPTS+=" --enable-java-agent-tests-log4j --with-java-classpath=/usr/share/java/log4j-1.2.jar"
60 ;;
61 *)
62 echo "Standard build"
63 CONF_OPTS+=" "
64 ;;
65 esac
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
74 echo "**************************************************"
75 echo $CONF_OPTS
76 echo "**************************************************"
77
78 BUILD_PATH=$WORKSPACE
79 case "$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
92 ./configure $CONF_OPTS
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 ;;
109 esac
110
111
112 make
113 make install
114
115 # Run tests
116 # Allow core dumps
117 ulimit -c unlimited
118
119 chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace
120 export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin"
121
122 rm -rf $WORKSPACE/tap
123 mkdir -p $WORKSPACE/tap
124 mkdir -p $WORKSPACE/tap/unit
125 mkdir -p $WORKSPACE/tap/fast_regression
126 mkdir -p $WORKSPACE/tap/with_bindings_regression
127
128 cd $BUILD_PATH/tests
129
130 if [ "$conf" = "std" ]
131 then
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
134 fi
135
136 if [ "$conf" = "java_jul" ]
137 then
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
140 fi
141
142 if [ "$conf" = "no_ust" ]
143 then
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."
146 fi
147
148 if [ "$conf" = "python_bindings" ]
149 then
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
155 fi
156
157 # TAP plugin is having a hard time with .yml files.
158 rm -f $WORKSPACE/tap/unit/meta.yml
159 rm -f $WORKSPACE/tap/fast_regression/meta.yml
160 rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml
161
162 # And also with files without extension, so rename all result to *.tap
163 find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \;
164 find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \;
165 find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \;
166
167 # Cleanup
168 make clean
169
170 # Cleanup rpath and libtool .la files
171 find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \;
172 find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \;
173 find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \;
174
175 # Clean temp dir for dist build
176 if [ $build = "dist" ]; then
177 rm -rf $BUILD_PATH
178 fi
179 set +x
This page took 0.035253 seconds and 5 git commands to generate.