message: Testing new post processing of baseline test
diff: @@ -175,8 +175,12 @@ stages:
  # differentiates between the two tests.
  .baseline_script: &baseline_script |
  # locals
  - _full_out=${BASELINE_TEST}.out
  - _err=${BASELINE_TEST}.err
  + _glob_out=${BASELINE_TEST}.out
  + _glob_err=${BASELINE_TEST}.err
  + _base_diff=${BASELINE_TEST}-${SYS_TYPE}.diff
  + _base_patch=${BASELINE_TEST}-${SYS_TYPE}.patch
  + _base_out=${BASELINE_TEST}-${SYS_TYPE}.out
  +
  _out=${BASELINE_TEST}-${SYS_TYPE}.out
  _ref=../${BASELINE_TEST}-${SYS_TYPE}.saved
  _out_txt=${BASELINE_TEST}.txt
  @@ -195,22 +199,29 @@ stages:
  ${EXEC_PREFIX} ../runtest ../../mfem "${BASELINE_TEST} ${ADDITIONAL_DIR}"
  # post
  mkdir ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}
  - if [[ ! -f ${_full_out} || ! -f ${_out} ]]
  + if [[ ! -f ${_base_patch} && ! -f ${_base_out} ]]
  then
  echo "Something went WRONG in ${BASELINE_TEST}:";
  - echo "${_full_out} and/or ${_out}";
  + echo "Either ${_base_patch} or ${_base_out} should exists";
  exit 1;
  - elif [[ -s ${_full_err} ]]
  + elif [[ -s ${_glob_err} ]]
  then
  echo "ERROR during ${BASELINE_TEST} execution";
  - echo "Here is the ${_full_err} file content";
  - cat ${_full_err} && cp ${_full_err} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}
  + echo "Here is the ${_glob_err} file content";
  + cat ${_glob_err}
  + cp ${_glob_err} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${_glob_err}.txt
  exit 1;
  + elif [[ -f ${_base_patch} ]]
  + then
  + cp ${_base_patch} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${_base_patch}.txt
  + elif [[ -f ${_base_out} ]]
  + then
  + cp ${_base_patch} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${_base_patch}.txt
  fi
  - cp ${_out} ${_out_txt}
  - diff -u ${_ref} ${_out} | tee ${_diff} || true
  - cp ${_full_out} ${_out_txt} ${_diff} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}
  - if [[ ! $(head -n1 ${_diff}) ]]; then true; else false; fi
  + cat ${_base_diff}
  + cp ${_full_out} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${_full_out}.txt
  + cp ${_base_diff} ${CI_PROJECT_DIR}/${ARTIFACTS_DIR}/${_base_diff}.txt
  + if [[ ! -s ${_base_diff} ]]; then true; else false; fi
  # Actual templates for baseline checks
  .baselinecheck_mfem:
  