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