From 5eb8cbb1d381fc78bced3fd769033946a99c9f7a Mon Sep 17 00:00:00 2001
From: Thomas Jahns <jahns@dkrz.de>
Date: Fri, 25 Mar 2022 00:19:10 +0100
Subject: [PATCH] Prepare to make test program parameter ntfiles adjustable.

---
 tests/pio_write.run.in | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/tests/pio_write.run.in b/tests/pio_write.run.in
index a59769b47..0a3c9e1e3 100644
--- a/tests/pio_write.run.in
+++ b/tests/pio_write.run.in
@@ -65,12 +65,16 @@ test_variation ()
     ${mpi_launch} ${tool_wrap} \
     ${pio_write} "-qprefix=${prefix}" -f ${suffix} \
     ${pio_write_args} -s 7 ${variation} || exit 1
-  echo "checking ${prefix}_0.${suffix}" >&2
-  @top_builddir@/libtool --mode=execute \
-    ${tool_wrap} ./cksum_read "${prefix}_0.${suffix}" "${prefix}_0.cksum"
-  echo "checking ${prefix}_1.${suffix}" >&2
-  @top_builddir@/libtool --mode=execute \
-    ${tool_wrap} ./cksum_read "${prefix}_1.${suffix}" "${prefix}_1.cksum"
+  tfile=0
+  ntfiles=2
+  while [ "$tfile" -lt "$ntfiles" ]; do
+    p="${prefix}_${tfile}"
+    echo "checking ${p}.${suffix}" >&2
+    @top_builddir@/libtool --mode=execute \
+      ${tool_wrap} ./cksum_read "${p}.${suffix}" "${p}.cksum"
+    rm "${p}.${suffix}" "${p}.cksum"
+    tfile=`expr "$tfile" + 1`
+  done
 }
 
 eval "set dummy $variations"; shift
-- 
GitLab