From 975aa2204fafdb2708465647c143015909c93a90 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 7 Jan 2023 12:31:49 +0000 Subject: [PATCH] tests: Break out determine-tname Signed-off-by: Ian Jackson --- test/common | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/common b/test/common index 44532b8..6a780ba 100644 --- a/test/common +++ b/test/common @@ -15,12 +15,16 @@ target_bin_prefix=${target_bin_dir}${target_bin_dir+/} fail () { echo >&2 "$0: fail: $*"; exit 1; } -test-prep () { - +determine-tname () { + local prefix=$1; shift case "${0##*/}" in - t-*) tname="${0##*/t-}" ;; + $prefix-*) tname="${0##*/$prefix-}" ;; *) fail "bad test script name $0" ;; esac +} + +test-prep () { + determine-tname t tmp=tmp/$tname rm -rf "$tmp" -- 2.30.2