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

     1  #!/bin/bash
     2  # Copyright 2015 The Kythe Authors. All rights reserved.
     3  #
     4  # Licensed under the Apache License, Version 2.0 (the "License");
     5  # you may not use this file except in compliance with the License.
     6  # You may obtain a copy of the License at
     7  #
     8  #   http://www.apache.org/licenses/LICENSE-2.0
     9  #
    10  # Unless required by applicable law or agreed to in writing, software
    11  # distributed under the License is distributed on an "AS IS" BASIS,
    12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  # See the License for the specific language governing permissions and
    14  # limitations under the License.
    15  set -eo pipefail
    16  TEST_NAME="test_stdin_names"
    17  . ./kythe/cxx/extractor/testdata/test_common.sh
    18  rm -rf -- "${OUT_DIR}/*"
    19  OUT_INDEX="out.kzip"
    20  echo '#define STDIN_OK 1\n' | \
    21      KYTHE_OUTPUT_FILE="${OUT_DIR}/${OUT_INDEX}" \
    22      KYTHE_VNAMES="${BASE_DIR}/stdin.vnames" "${EXTRACTOR}" -x c -
    23  
    24  # Make sure that the indexer can handle <stdin:> paths.
    25  "${INDEXER}" --ignore_unimplemented=true "${OUT_DIR}/${OUT_INDEX}" | \
    26    "${VERIFIER}" --nofile_vnames "${BASE_DIR}/test_stdin_names_verify.cc"