blob: 39d93e2bbf15a039ebb8c925f80591d66e6bcd5e [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#!/bin/sh
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002# Without --ignore-exit, the tap harness causes any FAILs within a
3# test plan to raise ERRORs; this is just noise.
Patrick Williams03514f12024-04-05 07:04:11 -05004
5#Detecting whether current system has lttng kernel modules
6LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko
7function validate_lttng_modules_present()
8{
9 # Check for loadable modules.
10 if [ -f "$LTTNG_KMOD_PATH" ]; then
11 return 0
12 fi
13
14 # Check for builtin modules.
15 ls /proc/lttng > /dev/null 2>&1
16 if [ $? -eq 0 ]; then
17 return 0
18 fi
19
20 return 1
21}
22
Andrew Geissler5199d832021-09-24 16:47:35 -050023export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050024makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH"
Patrick Williams03514f12024-04-05 07:04:11 -050025
26#If current system doesn't have lttng kernel modules, disable lttng kernel related tests.
27validate_lttng_modules_present || {
28 makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1"
29}
30
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050031make -k -t all >error.log 2>&1
32# Can specify a test e.g.:
33# -C tests/regression/ check TESTS='kernel/test_callstack'
34make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g'
35exitcode=$?
36if [ -e error.log ]; then
37 cat error.log
38fi
39if [ -e tests/unit/test-suite.log ]; then
40 cat tests/unit/test-suite.log
41fi
42if [ -e tests/regression/test-suite.log ]; then
43 cat tests/regression/test-suite.log
44fi
45exit $exitcode