-# Allow core dumps
-ulimit -c unlimited
-
-# Add 'babeltrace' binary to PATH
-chmod +x $BABEL_BINS/babeltrace
-export PATH="$PATH:$BABEL_BINS"
-
-# Prepare tap output dirs
-rm -rf $WORKSPACE/tap
-mkdir -p $WORKSPACE/tap
-mkdir -p $WORKSPACE/tap/unit
-mkdir -p $WORKSPACE/tap/fast_regression
-mkdir -p $WORKSPACE/tap/with_bindings_regression
-
-cd $BUILD_PATH/tests
-
-# Run 'unit_tests' and 'fast_regression' test suites for all configs except 'no-ust'
-if [ "$conf" != "no-ust" ]; then
- prove --merge -v --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true
- prove --merge -v --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true
-else
- # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
- echo "Testsuite disabled for 'no-ust'. See job configuration for more info."
+if [ "$RUN_TESTS" = "yes" ]; then
+ cd tests || exit 1
+
+ # Allow core dumps
+ ulimit -c unlimited
+
+ # Add 'babeltrace' binary to PATH
+ chmod +x "$BABEL_BINS/babeltrace"
+ export PATH="$PATH:$BABEL_BINS"
+
+ # Prepare tap output dirs
+ rm -rf "$TAPDIR"
+ mkdir -p "$TAPDIR"
+ mkdir -p "$TAPDIR/unit"
+ mkdir -p "$TAPDIR/fast_regression"
+ mkdir -p "$TAPDIR/with_bindings_regression"
+ if [ "$RUN_TESTS_LONG_REGRESSION" = "yes" ]; then
+ mkdir -p "$TAPDIR/long_regression"
+ fi
+
+ # Force the lttng-sessiond path to /bin/true to prevent the spawing of a
+ # lttng-sessiond --daemonize on "lttng create"
+ export LTTNG_SESSIOND_PATH="/bin/true"
+
+ # Run 'unit_tests' and 'fast_regression' test suites for all configs except 'no-ust'
+ if [ "$conf" != "no-ust" ]; then
+ # Run 'unit_tests', 2.8 and up has a new test suite
+ if vergte "$PACKAGE_VERSION" "2.8"; then
+ make --keep-going check
+ rsync -a --exclude 'test-suite.log' --include '*/' --include '*.log' --exclude='*'" $BUILD_PATH/tests/" "$TAPDIR"
+ else
+ prove --merge -v --exec '' - < "$BUILD_PATH/tests/unit_tests" --archive "$TAPDIR/unit/" || true
+ prove --merge -v --exec '' - < "$BUILD_PATH/tests/fast_regression" --archive "$TAPDIR/fast_regression/" || true
+ prove --merge -v --exec '' - < "$BUILD_PATH/tests/with_bindings_regression" --archive "$TAPDIR/with_bindings_regression/" || true
+ fi
+ if [ "$RUN_TESTS_LONG_REGRESSION" = "yes" ]; then
+ prove --merge -v --exec '' - < "$BUILD_PATH/tests/long_regression" --archive "$TAPDIR/long_regression/" || true
+ fi
+ else
+ # Regression is disabled for now, we need to adjust the testsuite for no ust builds.
+ echo "Tests disabled for 'no-ust'."
+ fi
+
+ # TAP plugin is having a hard time with .yml files.
+ find "$TAPDIR" -name "meta.yml" -exec rm -f {} \;
+
+ # And also with files without extension, so rename all result to *.tap
+ find "$TAPDIR/" -type f -exec mv {} {}.tap \;
+
+ cd -