kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/cxx/verifier/testdata/test_verifier_regex.sh (about)

     1  #!/bin/bash
     2  # This script checks that the verifier properly applies goal regexes and
     3  # computes the correct line and column information for diagnostics.
     4  HAD_ERRORS=0
     5  VERIFIER="../verifier"
     6  cd "$(dirname "$0")"
     7  "${VERIFIER}" --file_vnames=false --goal_regex='\s*\/\/\-\s*\[(.*)\]' \
     8      regex_input.txt < /dev/null 2>&1 \
     9      | diff - regex_expected_error.txt
    10  RESULTS=( ${PIPESTATUS[0]} ${PIPESTATUS[2]} )
    11  if [ ${RESULTS[0]} -ne 1 ]; then
    12    echo "[ VERIFIER DID NOT FAIL ]"
    13    HAD_ERRORS=1
    14  elif [ ${RESULTS[1]} -ne 0 ]; then
    15    echo "[ WRONG ERROR TEXT ]"
    16    HAD_ERRORS=1
    17  else
    18    echo "[ OK ]"
    19  fi
    20  exit ${HAD_ERRORS}