chiark / gitweb /
Test suite: Make t-ref-same* errors better by tracking and printing names
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 15:03:39 +0000 (15:03 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 30 Oct 2016 19:50:48 +0000 (19:50 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/lib

index 401331a..039484d 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -492,14 +492,16 @@ t-ref-same-val () {
        case "${t_ref_val-unset}" in
        unset)          ;;
        "$val")         ;;
-       *)              fail "ref varies: $name:\
- ${val:-nothing} != ${t_ref_val:-nothing}" ;;
+       *)              fail "ref varies: ($name)\
+ ${val:-nothing} != ${t_ref_val:-nothing} (${t_ref_names[*]})" ;;
        esac
        t_ref_val="$val"
+       t_ref_names+=("$name")
 }
 
 t-refs-same-start () {
        unset t_ref_val
+       t_ref_names=()
 }
 
 t-refs-same () {