diff --git a/tests/seek_test.sh b/tests/seek_test.sh
index ef8c571959dca9900b2c6a4d4a708e93769364ad..af829d157693d5d1d1882f3ba3b146dabb5b6fe9 100755
--- a/tests/seek_test.sh
+++ b/tests/seek_test.sh
@@ -8,7 +8,7 @@ datadir="tests/data"
 logfile="$datadir/seek.regression"
 reffile="$1"
 
-list=`ls tests/data/a-* tests/data/b-* | sort`
+list=`grep '^tests/data/[ab]-' "$reffile"`
 rm -f $logfile
 for i in $list ; do
     echo ---------------- >> $logfile