From fe49c075ac906f10fbcb08badcc68a8d79d216f1 Mon Sep 17 00:00:00 2001
From: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Wed, 15 Nov 2023 17:31:26 -0600
Subject: [PATCH] Fixes for CI and presets (#3853)

---
 .github/workflows/linux-auto-aocc-ompi.yml |  2 +-
 .github/workflows/netcdf.yml               |  2 +-
 config/cmake-presets/hidden-presets.json   |  2 +-
 config/cmake/grepTest.cmake                | 18 ++++++++++--------
 4 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/.github/workflows/linux-auto-aocc-ompi.yml b/.github/workflows/linux-auto-aocc-ompi.yml
index 435d93f95c7..c3700142e7a 100644
--- a/.github/workflows/linux-auto-aocc-ompi.yml
+++ b/.github/workflows/linux-auto-aocc-ompi.yml
@@ -1,4 +1,4 @@
-name: linux autotools aocc ompi
+name:  hdf5 dev autotools aocc ompi
 
 on:
   push:
diff --git a/.github/workflows/netcdf.yml b/.github/workflows/netcdf.yml
index f08361f6ea0..0ea61373539 100644
--- a/.github/workflows/netcdf.yml
+++ b/.github/workflows/netcdf.yml
@@ -1,4 +1,4 @@
-name: netCDF
+name: netCDF dev
 
 on:
   workflow_dispatch:
diff --git a/config/cmake-presets/hidden-presets.json b/config/cmake-presets/hidden-presets.json
index 81ac98f2446..3d61ebc5d37 100644
--- a/config/cmake-presets/hidden-presets.json
+++ b/config/cmake-presets/hidden-presets.json
@@ -528,7 +528,7 @@
       "generators": [
         "ZIP"
       ],
-      "configurations": ["Release"]
+      "configurations": ["RelWithDebInfo"]
     },
     {
       "name": "ci-x64-Release-Clang",
diff --git a/config/cmake/grepTest.cmake b/config/cmake/grepTest.cmake
index 6e51dec0331..2ec83872a55 100644
--- a/config/cmake/grepTest.cmake
+++ b/config/cmake/grepTest.cmake
@@ -71,8 +71,8 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
 
 # remove special output
 file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
-string (FIND TEST_STREAM "_pmi_alps" "${TEST_FIND_RESULT}")
-if (TEST_FIND_RESULT GREATER 0)
+string (FIND TEST_STREAM "_pmi_alps" TEST_FIND_RESULT)
+if (TEST_FIND_RESULT GREATER -1)
   string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
   file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_STREAM})
 endif ()
@@ -169,12 +169,14 @@ 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_GREP_RESULT)
-  if (NOT TEST_GREP_RESULT)
-    message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+  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_GREP_RESULT)
+    if (NOT TEST_GREP_RESULT)
+      message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
+    endif ()
   endif ()
 endif ()