[PATCH v1] perf test: Skip diff test if test_loop is missing

From: Ian Rogers
Date: Tue Dec 05 2023 - 11:49:35 EST


The diff test depends on finding the symbol test_loop in perf and will
fail if perf has been stripped and no debug object is available. In
that case, skip the test instead.

Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/tests/shell/diff.sh | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/tools/perf/tests/shell/diff.sh b/tools/perf/tests/shell/diff.sh
index 213185763688..14b87af88703 100755
--- a/tools/perf/tests/shell/diff.sh
+++ b/tools/perf/tests/shell/diff.sh
@@ -9,8 +9,15 @@ perfdata1=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
perfdata2=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
perfdata3=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
testprog="perf test -w thloop"
+
+shelldir=$(dirname "$0")
+# shellcheck source=lib/perf_has_symbol.sh
+. "${shelldir}"/lib/perf_has_symbol.sh
+
testsym="test_loop"

+skip_test_missing_symbol ${testsym}
+
cleanup() {
rm -rf "${perfdata1}"
rm -rf "${perfdata1}".old
--
2.43.0.rc2.451.g8631bc7472-goog