Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | # Without --ignore-exit, the tap harness causes any FAILs within a |
| 3 | # test plan to raise ERRORs; this is just noise. |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 4 | |
| 5 | #Detecting whether current system has lttng kernel modules |
| 6 | LTTNG_KMOD_PATH=/lib/modules/$(uname -r)/kernel/lttng-modules/lttng-tracer.ko |
| 7 | function 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 Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame] | 23 | export LD_LIBRARY_PATH=FIXMEPTESTPATH/tests/utils/testapp/userspace-probe-elf-binary/.libs |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 24 | makeargs="LOG_DRIVER_FLAGS=--ignore-exit top_srcdir=FIXMEPTESTPATH top_builddir=FIXMEPTESTPATH" |
Patrick Williams | 03514f1 | 2024-04-05 07:04:11 -0500 | [diff] [blame] | 25 | |
| 26 | #If current system doesn't have lttng kernel modules, disable lttng kernel related tests. |
| 27 | validate_lttng_modules_present || { |
| 28 | makeargs="$makeargs LTTNG_TOOLS_DISABLE_KERNEL_TESTS=1" |
| 29 | } |
| 30 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 31 | make -k -t all >error.log 2>&1 |
| 32 | # Can specify a test e.g.: |
| 33 | # -C tests/regression/ check TESTS='kernel/test_callstack' |
| 34 | make -k -s $makeargs check 2>error.log | sed -e 's#/tmp/tmp\...........#/tmp/tmp.XXXXXXXXXX#g' |
| 35 | exitcode=$? |
| 36 | if [ -e error.log ]; then |
| 37 | cat error.log |
| 38 | fi |
| 39 | if [ -e tests/unit/test-suite.log ]; then |
| 40 | cat tests/unit/test-suite.log |
| 41 | fi |
| 42 | if [ -e tests/regression/test-suite.log ]; then |
| 43 | cat tests/regression/test-suite.log |
| 44 | fi |
| 45 | exit $exitcode |