When a test case has test_device(), blktests prints the name of the test target device provided to test_device(). The commit 653ace845911 ("check, new: introduce test_device_array()") introduced the support for test_device_array() which runs the test for multiple devices. However, when the test case has test_device_array(), blktests does not print the names of the test target devices. Modify the check script to print the test target device names. For that purpose, factor out two _output_status() calls into a new helper function _output_test_name(). In that function, print TEST_DEV_ARRAY elements which are provided to test_dev_array() as the test target. After this commit, md/003 run will look like as follows: md/003 => nvme1n1 nvme2n1 nvme3n1 nvme4n1 (test md atomic writes for NVMe drives) [passed] runtime 18.678s ... 18.446s Signed-off-by: Shin'ichiro Kawasaki --- check | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/check b/check index ca0faca..6d77d8e 100755 --- a/check +++ b/check @@ -252,12 +252,25 @@ _output_notrun() { _output_skip_reasons } -_output_last_test_run() { +_output_test_name() { + local dev + local -a devs + local status="$1" + if [[ "${TEST_DEV:-}" ]]; then - _output_status "$TEST_NAME => $(basename "$TEST_DEV")" "" + _output_status "$TEST_NAME => $(basename "$TEST_DEV")" "$status" + elif [[ "${TEST_DEV_ARRAY:-}" ]]; then + for dev in "${TEST_DEV_ARRAY[@]}"; do + devs+=("${dev##*/}") + done + _output_status "$TEST_NAME => ${devs[*]}" "$status" else - _output_status "$TEST_NAME" "" + _output_status "$TEST_NAME" "$status" fi +} + +_output_last_test_run() { + _output_test_name "" { local key @@ -277,11 +290,7 @@ _output_test_run() { if [[ $status = pass || $status = fail ]]; then status+="ed" fi - if [[ "${TEST_DEV:-}" ]]; then - _output_status "$TEST_NAME => $(basename "$TEST_DEV")" "$status" - else - _output_status "$TEST_NAME" "$status" - fi + _output_test_name "$status" { local key last_value value -- 2.51.0