xref: /linux/tools/perf/tests/shell/perftool-testsuite_probe.sh (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1#!/bin/bash
2# perftool-testsuite_probe
3# SPDX-License-Identifier: GPL-2.0
4
5test -d "$(dirname "$0")/base_probe" || exit 2
6cd "$(dirname "$0")/base_probe" || exit 2
7status=0
8
9PERFSUITE_RUN_DIR=$(mktemp -d /tmp/"$(basename "$0" .sh)".XXX)
10export PERFSUITE_RUN_DIR
11
12for testcase in setup.sh test_*; do                  # skip setup.sh if not present or not executable
13     test -x "$testcase" || continue
14     ./"$testcase"
15     (( status += $? ))
16done
17
18if ! [ "$PERFTEST_KEEP_LOGS" = "y" ]; then
19	rm -rf "$PERFSUITE_RUN_DIR"
20fi
21
22test $status -ne 0 && exit 1
23exit 0
24