From 59ab02a6c539a117bab93d9ed644dc6ff8d11a98 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Jan 2020 12:44:48 -0600 Subject: HDFFV-10995 adjust testing to tolerate non-US locale --- java/examples/datatypes/H5Ex_T_Float.java | 2 +- java/examples/datatypes/H5Ex_T_FloatAttribute.java | 2 +- java/test/junit.sh.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java index f677479..caad74c 100644 --- a/java/examples/datatypes/H5Ex_T_Float.java +++ b/java/examples/datatypes/H5Ex_T_Float.java @@ -173,7 +173,7 @@ public class H5Ex_T_Float { } // Output the data to the screen. - DecimalFormat df = new DecimalFormat("#,##0.0000"); + DecimalFormat df = new DecimalFormat("#,##0.0000", new DecimalFormatSymbols(Locale.US)); System.out.println(DATASETNAME + ":"); for (int indx = 0; indx < dims[0]; indx++) { System.out.print(" ["); diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java index 2e706d9..1243480 100644 --- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java +++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java @@ -201,7 +201,7 @@ public class H5Ex_T_FloatAttribute { } // Output the data to the screen. - DecimalFormat df = new DecimalFormat("#,##0.0000"); + DecimalFormat df = new DecimalFormat("#,##0.0000", new DecimalFormatSymbols(Locale.US)); System.out.println(ATTRIBUTENAME + ":"); for (int indx = 0; indx < dims[0]; indx++) { System.out.print(" ["); diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index ac09db7..91b99a9 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -330,7 +330,7 @@ TESTING JUnit-TestH5 # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5.ext > JUnit-TestH5.out -- cgit v0.12 From b73c0aeaa958d5e79e2fc9b7d97bdba8cb13bbfa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Jan 2020 12:48:48 -0600 Subject: HDFFV-10995 - Update all time instances --- java/test/junit.sh.in | 76 +++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 91b99a9..598b3d2 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -351,7 +351,7 @@ TESTING JUnit-TestH5Eparams # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Eparams.ext > JUnit-TestH5Eparams.out @@ -372,7 +372,7 @@ TESTING JUnit-TestH5Eregister # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Eregister.ext > JUnit-TestH5Eregister.out @@ -393,7 +393,7 @@ TESTING JUnit-TestH5Fparams # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Fparams.ext > JUnit-TestH5Fparams.out @@ -414,7 +414,7 @@ TESTING JUnit-TestH5Fbasic # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Fbasic.ext > JUnit-TestH5Fbasic.out @@ -435,7 +435,7 @@ TESTING JUnit-TestH5F # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5F.ext > JUnit-TestH5F.out @@ -456,7 +456,7 @@ TESTING JUnit-TestH5Fswmr # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Fswmr.ext > JUnit-TestH5Fswmr.out @@ -477,7 +477,7 @@ TESTING JUnit-TestH5Gbasic # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Gbasic.ext > JUnit-TestH5Gbasic.out @@ -498,7 +498,7 @@ TESTING JUnit-TestH5G # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5G.ext > JUnit-TestH5G.out @@ -519,7 +519,7 @@ TESTING JUnit-TestH5Sbasic # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Sbasic.ext > JUnit-TestH5Sbasic.out @@ -540,7 +540,7 @@ TESTING JUnit-TestH5S # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5S.ext > JUnit-TestH5S.out @@ -561,7 +561,7 @@ TESTING JUnit-TestH5Tparams # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Tparams.ext > JUnit-TestH5Tparams.out @@ -582,7 +582,7 @@ TESTING JUnit-TestH5Tbasic # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Tbasic.ext > JUnit-TestH5Tbasic.out @@ -603,7 +603,7 @@ TESTING JUnit-TestH5T # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5T.ext > JUnit-TestH5T.out @@ -624,7 +624,7 @@ TESTING JUnit-TestH5Dparams # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Dparams.ext > JUnit-TestH5Dparams.out @@ -645,7 +645,7 @@ TESTING JUnit-TestH5D # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5D.ext > JUnit-TestH5D.out @@ -666,7 +666,7 @@ TESTING JUnit-TestH5Dplist # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Dplist.ext > JUnit-TestH5Dplist.out @@ -687,7 +687,7 @@ TESTING JUnit-TestH5Lparams # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Lparams.ext > JUnit-TestH5Lparams.out @@ -708,7 +708,7 @@ TESTING JUnit-TestH5Lbasic # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Lbasic.ext > JUnit-TestH5Lbasic.out @@ -729,7 +729,7 @@ TESTING JUnit-TestH5Lcreate # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Lcreate.ext > JUnit-TestH5Lcreate.out @@ -750,7 +750,7 @@ TESTING JUnit-TestH5R # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5R.ext > JUnit-TestH5R.out @@ -771,7 +771,7 @@ TESTING JUnit-TestH5P # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5P.ext > JUnit-TestH5P.out @@ -792,7 +792,7 @@ TESTING JUnit-TestH5PData # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5PData.ext > JUnit-TestH5PData.out @@ -813,7 +813,7 @@ TESTING JUnit-TestH5Pfapl # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Pfapl.ext > JUnit-TestH5Pfapl.out @@ -834,7 +834,7 @@ TESTING JUnit-TestH5Pvirtual # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Pvirtual.ext > JUnit-TestH5Pvirtual.out @@ -855,7 +855,7 @@ TESTING JUnit-TestH5Plist # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Plist.ext > JUnit-TestH5Plist.out @@ -876,7 +876,7 @@ TESTING JUnit-TestH5A # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5A.ext > JUnit-TestH5A.out @@ -897,7 +897,7 @@ TESTING JUnit-TestH5Oparams # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Oparams.ext > JUnit-TestH5Oparams.out @@ -918,7 +918,7 @@ TESTING JUnit-TestH5Obasic # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Obasic.ext > JUnit-TestH5Obasic.out @@ -939,7 +939,7 @@ TESTING JUnit-TestH5Ocreate # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Ocreate.ext > JUnit-TestH5Ocreate.out @@ -960,7 +960,7 @@ TESTING JUnit-TestH5Ocopy # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Ocopy.ext > JUnit-TestH5Ocopy.out @@ -981,7 +981,7 @@ TESTING JUnit-TestH5PL # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5PL.ext > JUnit-TestH5PL.out @@ -1002,7 +1002,7 @@ TESTING JUnit-TestH5VL # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5VL.ext > JUnit-TestH5VL.out @@ -1023,7 +1023,7 @@ TESTING JUnit-TestH5Z # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Z.ext > JUnit-TestH5Z.out @@ -1044,7 +1044,7 @@ TESTING JUnit-TestH5E # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5E.ext > JUnit-TestH5E.out @@ -1065,7 +1065,7 @@ TESTING JUnit-TestH5Edefault # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Edefault.ext > JUnit-TestH5Edefault.out @@ -1087,7 +1087,7 @@ if test $USE_FILTER_SZIP = "yes"; then # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*[\.[0-9]*]*/Time: XXXX/' \ + -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Giterate.ext > JUnit-TestH5Giterate.out @@ -1109,7 +1109,7 @@ if test "X$ROS3_VFD" = "Xyes"; then # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \ + -e 's/Time: [0-9]*\.,[0-9]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Pfapls3.ext > JUnit-TestH5Pfapls3.out @@ -1131,7 +1131,7 @@ if test "X$HAVE_LIBHDFS" = "Xyes"; then # Extract file name, line number, version and thread IDs because they may be different sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ -e 's/line [0-9]*/line (number)/' \ - -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \ + -e 's/Time: [0-9]*\.,[0-9]*/Time: XXXX/' \ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ JUnit-TestH5Pfaplhdfs.ext > JUnit-TestH5Pfaplhdfs.out -- cgit v0.12 From 5a6f379420edc3a4e623b10dfa489dd921b02809 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Jan 2020 13:14:58 -0600 Subject: HDFFV-10995 - need to add import --- java/examples/datatypes/H5Ex_T_Float.java | 1 + java/examples/datatypes/H5Ex_T_FloatAttribute.java | 1 + 2 files changed, 2 insertions(+) diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java index caad74c..848550f 100644 --- a/java/examples/datatypes/H5Ex_T_Float.java +++ b/java/examples/datatypes/H5Ex_T_Float.java @@ -22,6 +22,7 @@ package examples.datatypes; import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java index 1243480..d431d6b 100644 --- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java +++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java @@ -22,6 +22,7 @@ package examples.datatypes; import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; -- cgit v0.12 From d90ef60b329ebbf145f56d5085378f31a6151ff1 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 8 Jan 2020 14:37:31 -0600 Subject: HDFFV-10995 - add missing import --- java/examples/datatypes/H5Ex_T_Float.java | 1 + java/examples/datatypes/H5Ex_T_FloatAttribute.java | 1 + 2 files changed, 2 insertions(+) diff --git a/java/examples/datatypes/H5Ex_T_Float.java b/java/examples/datatypes/H5Ex_T_Float.java index 848550f..f15f774 100644 --- a/java/examples/datatypes/H5Ex_T_Float.java +++ b/java/examples/datatypes/H5Ex_T_Float.java @@ -23,6 +23,7 @@ package examples.datatypes; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; +import java.util.Locale; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; diff --git a/java/examples/datatypes/H5Ex_T_FloatAttribute.java b/java/examples/datatypes/H5Ex_T_FloatAttribute.java index d431d6b..12831bc 100644 --- a/java/examples/datatypes/H5Ex_T_FloatAttribute.java +++ b/java/examples/datatypes/H5Ex_T_FloatAttribute.java @@ -23,6 +23,7 @@ package examples.datatypes; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; +import java.util.Locale; import hdf.hdf5lib.H5; import hdf.hdf5lib.HDF5Constants; -- cgit v0.12 From 6b1b4b3c0bdd803835efe8c531965bb9900a5363 Mon Sep 17 00:00:00 2001 From: kmu Date: Thu, 9 Jan 2020 12:06:45 -0600 Subject: fix test assert fail error --- testpar/t_mpi.c | 4 ++-- tools/test/h5dump/h5dumpgentest.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 91b8f8c..fe78317 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -303,7 +303,7 @@ static int test_mpio_gb_file(char *filename) { mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ for (j = 0; j < MB; j++) - H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int); + *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) HDfprintf(stdout, "proc %d: writing %d bytes at offset %lld\n", @@ -351,7 +351,7 @@ static int test_mpio_gb_file(char *filename) { mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE, &mpi_stat); INFO((mrc == MPI_SUCCESS), "GB size file read"); - H5_CHECKED_ASSIGN(expected, int8_t, i * mpi_size + (mpi_size - mpi_rank - 1), int); + expected = (int8_t)(i * mpi_size + (mpi_size - mpi_rank - 1)); vrfyerrs = 0; for (j = 0; j < MB; j++) { if ((*(buf + j) != expected) diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 6cf2916..d0421d2 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -10488,7 +10488,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Subtract the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp - MULTIPLIER, int); + *int_ptr = (int8_t)(temp - MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ @@ -10497,7 +10497,7 @@ H5Z_filter_dynlibud(unsigned int flags, size_t cd_nelmts, /* Add the original value with MULTIPLIER */ while(buf_left > 0) { char temp = *int_ptr; - H5_CHECKED_ASSIGN(*int_ptr, int8_t, temp + MULTIPLIER, int); + *int_ptr = (int8_t)(temp + MULTIPLIER); int_ptr++; buf_left -= sizeof(*int_ptr); } /* end while */ -- cgit v0.12 From b97daea891a8cedaf14ee2711b88b8116c65becd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 9 Jan 2020 13:30:00 -0600 Subject: Check for actual content before using file --- config/cmake/jrunTest.cmake | 227 +++++++++++++++++++----------------- config/cmake/vfdTest.cmake | 2 +- config/cmake/volTest.cmake | 2 +- config/cmake_ext_mod/grepTest.cmake | 108 +++++++++-------- config/cmake_ext_mod/runTest.cmake | 223 ++++++++++++++++++----------------- 5 files changed, 298 insertions(+), 264 deletions(-) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index ee4517c..d53860c 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -75,16 +75,19 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - if (TEST_MASK_FILE) - STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") - endif () + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (TEST_MASK_FILE) + STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") + endif () - if (NOT ERROR_APPEND) - # write back to original .err file - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - else () - # append error output to the stdout output file - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + if (NOT ERROR_APPEND) + # write back to original .err file + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + else () + # append error output to the stdout output file + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + endif () endif () endif () @@ -124,60 +127,64 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}") # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") - if (WIN32 OR MINGW) - configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) - if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") - file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (WIN32 OR MINGW) + configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) + if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") + file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) + endif () + #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () endif () - endif () - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT str_act STREQUAL str_ref) - if (str_act) - set (TEST_RESULT 1) - message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) endif () endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -190,50 +197,56 @@ if (NOT TEST_SKIP_COMPARE) # now compare the .err file with the error reference, if supplied if (TEST_ERRREF) - if (WIN32 OR MINGW) - configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) - if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") - file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) - endif () - #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - endif () + if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}") + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (WIN32 OR MINGW) + configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) + if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") + file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) + endif () + #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + endif () - # now compare the error output with the error reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} - RESULT_VARIABLE TEST_RESULT - ) - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) - math (EXPR _FP_LEN "${len_ref} - 1") - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT str_act STREQUAL str_ref) - if (str_act) - set (TEST_RESULT 1) - message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + # now compare the error output with the error reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_RESULT + ) + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) + math (EXPR _FP_LEN "${len_ref} - 1") + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () + endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") - endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) + endif () endif () endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -248,20 +261,22 @@ endif () if (TEST_GREP_COMPARE) # now grep the output with the reference file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + # TEST_REFERENCE should always be matched + string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + endif () - # TEST_REFERENCE should always be matched - string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") - endif () - - string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if (TEST_EXPECT) - # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) + if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match + string (LENGTH "${TEST_MATCH}" TEST_RESULT) + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif () endif () endif () endif () diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index 12ee40b..c07d005 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -64,7 +64,7 @@ if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out") file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM) - message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") + message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}") endif () endif () message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake index 1dcd2b1..e735109 100644 --- a/config/cmake/volTest.cmake +++ b/config/cmake/volTest.cmake @@ -64,7 +64,7 @@ if (NOT TEST_RESULT EQUAL TEST_EXPECT) if (NOT TEST_NOERRDISPLAY) if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.out") file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM) - message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}") + message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}") endif () endif () message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index a6f1c7f..ead22a7 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -86,71 +86,77 @@ if (TEST_ERRREF) # if the .err file exists grep the error output with the error reference before comparing stdout if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM) - - # TEST_ERRREF should always be matched - string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM}) - string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) - message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}") + list(LENGTH TEST_ERR_STREAM test_len) + if (test_len GREATER 0) + # TEST_ERRREF should always be matched + string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM}) + string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}") + endif () endif () endif () #always compare output file to reference unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") - if (WIN32 OR MINGW) - configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) - if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") - file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (WIN32 OR MINGW) + configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) + if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") + file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) + endif () + #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () endif () - endif () - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT str_act STREQUAL str_ref) - if (str_act) - set (TEST_RESULT 1) - message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) endif () endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 0c4a5a0..56e7add 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -90,18 +90,21 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - if (TEST_MASK_FILE) - STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") - endif () - # remove special output - string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (TEST_MASK_FILE) + STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") + endif () + # remove special output + string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}") - if (NOT ERROR_APPEND) - # write back to original .err file - file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") - else () - # append error output to the stdout output file - file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + if (NOT ERROR_APPEND) + # write back to original .err file + file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + else () + # append error output to the stdout output file + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + endif () endif () endif () @@ -205,60 +208,64 @@ endif () # compare output files to references unless this must be skipped if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") - if (WIN32 OR MINGW) - configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) - if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") - file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) + file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (WIN32 OR MINGW) + configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) + if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}.tmp") + file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE}) + endif () + #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) + #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") endif () - #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}") - endif () - if (NOT TEST_SORT_COMPARE) - # now compare the output with the reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT - ) - else () - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) - list (SORT v1) - list (SORT v2) - if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + if (NOT TEST_SORT_COMPARE) + # now compare the output with the reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + RESULT_VARIABLE TEST_RESULT + ) + else () + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} v2) + list (SORT v1) + list (SORT v2) + if (NOT v1 STREQUAL v2) + set(TEST_RESULT 1) + endif () endif () - endif () - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) - list (LENGTH test_ref len_ref) - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT str_act STREQUAL str_ref) - if (str_act) - set (TEST_RESULT 1) - message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) + list (LENGTH test_ref len_ref) + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty") endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) endif () endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -271,50 +278,54 @@ if (NOT TEST_SKIP_COMPARE) # now compare the .err file with the error reference, if supplied if (TEST_ERRREF) - if (WIN32 OR MINGW) - configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) - if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") - file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (WIN32 OR MINGW) + configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) + if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") + file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) + endif () + #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") endif () - #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") - endif () - # now compare the error output with the error reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} - RESULT_VARIABLE TEST_RESULT - ) - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) - math (EXPR _FP_LEN "${len_ref} - 1") - if (len_act GREATER 0 AND len_ref GREATER 0) + # now compare the error output with the error reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_RESULT + ) + if (TEST_RESULT) + set (TEST_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT str_act STREQUAL str_ref) - if (str_act) - set (TEST_RESULT 1) - message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + if (len_act GREATER 0 AND len_ref GREATER 0) + math (EXPR _FP_LEN "${len_ref} - 1") + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") + endif () endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") + endif () + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") + if (NOT len_act EQUAL len_ref) + set (TEST_RESULT 1) endif () endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) - endif () endif () message (STATUS "COMPARE Result: ${TEST_RESULT}") @@ -329,20 +340,22 @@ endif () if (TEST_GREP_COMPARE) # now grep the output with the reference file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + # TEST_REFERENCE should always be matched + string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) + if (NOT TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") + endif () - # TEST_REFERENCE should always be matched - string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") - endif () - - string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) - if (TEST_EXPECT) - # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) - message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) + if (TEST_EXPECT) + # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match + string (LENGTH "${TEST_MATCH}" TEST_RESULT) + if (TEST_RESULT) + message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") + endif () endif () endif () endif () -- cgit v0.12 From 21f3d628d702bfd6c9cbb4b90f18842023ea40b3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 9 Jan 2020 15:18:55 -0600 Subject: Separate result variables for the function performed --- config/cmake/jrunTest.cmake | 120 +++++++++++++++++++----------------- config/cmake_ext_mod/grepTest.cmake | 31 +++++----- config/cmake_ext_mod/runTest.cmake | 41 ++++++------ 3 files changed, 104 insertions(+), 88 deletions(-) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index d53860c..0315536 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -125,6 +125,7 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") # compare output files to references unless this must be skipped +set (TEST_COMPARE_RESULT 0) if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) @@ -143,7 +144,7 @@ if (NOT TEST_SKIP_COMPARE) # now compare the output with the reference execute_process ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT + RESULT_VARIABLE TEST_COMPARE_RESULT ) else () file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) @@ -151,12 +152,12 @@ if (NOT TEST_SKIP_COMPARE) list (SORT v1) list (SORT v2) if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + set(TEST_COMPARE_RESULT 1) endif () endif () - if (TEST_RESULT) - set (TEST_RESULT 0) + if (TEST_COMPARE_RESULT) + set (TEST_COMPARE_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) @@ -168,7 +169,7 @@ if (NOT TEST_SKIP_COMPARE) list (GET test_ref ${line} str_ref) if (NOT str_act STREQUAL str_ref) if (str_act) - set (TEST_RESULT 1) + set (TEST_COMPARE_RESULT 1) message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () @@ -182,82 +183,82 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) + set (TEST_COMPARE_RESULT 1) endif () endif () endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}") # again, if return value is !=0 scream and shout - if (TEST_RESULT) + if (TEST_COMPARE_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () # now compare the .err file with the error reference, if supplied + set (TEST_ERRREF_RESULT 0) if (TEST_ERRREF) - if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}") - file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - list(LENGTH TEST_STREAM test_len) - if (test_len GREATER 0) - if (WIN32 OR MINGW) - configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) - if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") - file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) - endif () - #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + list(LENGTH TEST_STREAM test_len) + if (test_len GREATER 0) + if (WIN32 OR MINGW) + configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) + if (EXISTS "${TEST_FOLDER}/${TEST_ERRREF}.tmp") + file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF}) endif () + #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + endif () - # now compare the error output with the error reference - execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} - RESULT_VARIABLE TEST_RESULT - ) - if (TEST_RESULT) - set (TEST_RESULT 0) - file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) - list (LENGTH test_act len_act) - file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) - list (LENGTH test_ref len_ref) + # now compare the error output with the error reference + execute_process ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_ERRREF_RESULT + ) + if (TEST_ERRREF_RESULT) + set (TEST_ERRREF_RESULT 0) + file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) + list (LENGTH test_act len_act) + file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) + list (LENGTH test_ref len_ref) + math (EXPR _FP_LEN "${len_ref} - 1") + if (len_act GREATER 0 AND len_ref GREATER 0) math (EXPR _FP_LEN "${len_ref} - 1") - if (len_act GREATER 0 AND len_ref GREATER 0) - math (EXPR _FP_LEN "${len_ref} - 1") - foreach (line RANGE 0 ${_FP_LEN}) - list (GET test_act ${line} str_act) - list (GET test_ref ${line} str_ref) - if (NOT str_act STREQUAL str_ref) - if (str_act) - set (TEST_RESULT 1) - message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") - endif () + foreach (line RANGE 0 ${_FP_LEN}) + list (GET test_act ${line} str_act) + list (GET test_ref ${line} str_ref) + if (NOT str_act STREQUAL str_ref) + if (str_act) + set (TEST_ERRREF_RESULT 1) + message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () - endforeach () - else () - if (len_act EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") - endif () - if (len_ref EQUAL 0) - message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () + endforeach () + else () + if (len_act EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty") endif () - if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) + if (len_ref EQUAL 0) + message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty") endif () endif () + if (NOT len_act EQUAL len_ref) + set (TEST_ERRREF_RESULT 1) + endif () endif () endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}") # again, if return value is !=0 scream and shout - if (TEST_RESULT) + if (TEST_ERRREF_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () endif () +set (TEST_GREP_RESULT 0) if (TEST_GREP_COMPARE) # now grep the output with the reference file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -265,22 +266,31 @@ if (TEST_GREP_COMPARE) if (test_len GREATER 0) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT) + if (NOT TEST_GREP_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (TEST_EXPECT) # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) + string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT) + if (TEST_GREP_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () endif () endif () +# dump the output unless nodisplay option is set +if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + execute_process ( + COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM} + RESULT_VARIABLE TEST_RESULT + ) +endif () + # everything went fine... message (STATUS "${TEST_PROGRAM} Passed") diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index ead22a7..c65c951 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -82,6 +82,7 @@ if (TEST_FIND_RESULT GREATER 0) endif () # if the TEST_ERRREF exists grep the error output with the error reference +set (TEST_ERRREF_RESULT 0) if (TEST_ERRREF) # if the .err file exists grep the error output with the error reference before comparing stdout if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") @@ -90,14 +91,15 @@ if (TEST_ERRREF) if (test_len GREATER 0) # TEST_ERRREF should always be matched string (REGEX MATCH "${TEST_ERRREF}" TEST_MATCH ${TEST_ERR_STREAM}) - string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) + string (COMPARE EQUAL "${TEST_ERRREF}" "${TEST_MATCH}" TEST_ERRREF_RESULT) + if (NOT TEST_ERRREF_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not contain ${TEST_ERRREF}") endif () endif () endif () #always compare output file to reference unless this must be skipped + set (TEST_COMPARE_RESULT 0) if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) @@ -115,7 +117,7 @@ if (TEST_ERRREF) # now compare the output with the reference execute_process ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT + RESULT_VARIABLE TEST_COMPARE_RESULT ) else () file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) @@ -123,12 +125,12 @@ if (TEST_ERRREF) list (SORT v1) list (SORT v2) if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + set(TEST_COMPARE_RESULT 1) endif () endif () - if (TEST_RESULT) - set (TEST_RESULT 0) + if (TEST_COMPARE_RESULT) + set (TEST_COMPARE_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) @@ -140,7 +142,7 @@ if (TEST_ERRREF) list (GET test_ref ${line} str_ref) if (NOT str_act STREQUAL str_ref) if (str_act) - set (TEST_RESULT 1) + set (TEST_COMPARE_RESULT 1) message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () @@ -154,27 +156,28 @@ if (TEST_ERRREF) endif () endif () if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) + set (TEST_COMPARE_RESULT 1) endif () endif () endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}") # again, if return value is !=0 scream and shout - if (TEST_RESULT) + if (TEST_COMPARE_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () endif () else () # else grep the output with the reference + set (TEST_GREP_RESULT 0) file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT) + if (NOT TEST_GREP_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () endif () @@ -184,8 +187,8 @@ if (TEST_FILTER) string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (TEST_EXPECT) # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) + string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT) + if (TEST_GREP_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index 56e7add..885e4f7 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -206,6 +206,7 @@ if (TEST_REF_FILTER) endif () # compare output files to references unless this must be skipped +set (TEST_COMPARE_RESULT 0) if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) @@ -224,7 +225,7 @@ if (NOT TEST_SKIP_COMPARE) # now compare the output with the reference execute_process ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} - RESULT_VARIABLE TEST_RESULT + RESULT_VARIABLE TEST_COMPARE_RESULT ) else () file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} v1) @@ -232,12 +233,12 @@ if (NOT TEST_SKIP_COMPARE) list (SORT v1) list (SORT v2) if (NOT v1 STREQUAL v2) - set(TEST_RESULT 1) + set(TEST_COMPARE_RESULT 1) endif () endif () - if (TEST_RESULT) - set (TEST_RESULT 0) + if (TEST_COMPARE_RESULT) + set (TEST_COMPARE_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref) @@ -249,7 +250,7 @@ if (NOT TEST_SKIP_COMPARE) list (GET test_ref ${line} str_ref) if (NOT str_act STREQUAL str_ref) if (str_act) - set (TEST_RESULT 1) + set (TEST_COMPARE_RESULT 1) message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () @@ -263,20 +264,21 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) + set (TEST_COMPARE_RESULT 1) endif () endif () endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_COMPARE_RESULT}") # again, if return value is !=0 scream and shout - if (TEST_RESULT) + if (TEST_COMPARE_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}") endif () endif () # now compare the .err file with the error reference, if supplied + set (TEST_ERRREF_RESULT 0) if (TEST_ERRREF) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) list(LENGTH TEST_STREAM test_len) @@ -293,10 +295,10 @@ if (NOT TEST_SKIP_COMPARE) # now compare the error output with the error reference execute_process ( COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} - RESULT_VARIABLE TEST_RESULT + RESULT_VARIABLE TEST_ERRREF_RESULT ) - if (TEST_RESULT) - set (TEST_RESULT 0) + if (TEST_ERRREF_RESULT) + set (TEST_ERRREF_RESULT 0) file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act) list (LENGTH test_act len_act) file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref) @@ -309,7 +311,7 @@ if (NOT TEST_SKIP_COMPARE) list (GET test_ref ${line} str_ref) if (NOT str_act STREQUAL str_ref) if (str_act) - set (TEST_RESULT 1) + set (TEST_ERRREF_RESULT 1) message (STATUS "line = ${line}\n***ACTUAL: ${str_act}\n****REFER: ${str_ref}\n") endif () endif () @@ -323,20 +325,21 @@ if (NOT TEST_SKIP_COMPARE) endif () endif () if (NOT len_act EQUAL len_ref) - set (TEST_RESULT 1) + set (TEST_ERRREF_RESULT 1) endif () endif () endif () - message (STATUS "COMPARE Result: ${TEST_RESULT}") + message (STATUS "COMPARE Result: ${TEST_ERRREF_RESULT}") # again, if return value is !=0 scream and shout - if (TEST_RESULT) + if (TEST_ERRREF_RESULT) message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}") endif () endif () endif () +set (TEST_GREP_RESULT 0) if (TEST_GREP_COMPARE) # now grep the output with the reference file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) @@ -344,16 +347,16 @@ if (TEST_GREP_COMPARE) if (test_len GREATER 0) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) - string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT) - if (NOT TEST_RESULT) + string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_GREP_RESULT) + if (NOT TEST_GREP_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}") endif () string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM}) if (TEST_EXPECT) # TEST_EXPECT (1) interprets TEST_FILTER as; NOT to match - string (LENGTH "${TEST_MATCH}" TEST_RESULT) - if (TEST_RESULT) + string (LENGTH "${TEST_MATCH}" TEST_GREP_RESULT) + if (TEST_GREP_RESULT) message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}") endif () endif () -- cgit v0.12