mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
3087738f28
Patch: Benjy Weinberger git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1386848 13f79535-47bb-0310-9956-ffa450edef68
32 lines
844 B
Bash
32 lines
844 B
Bash
#!/bin/bash
|
|
|
|
# Tests the parser, independently of whether any generators
|
|
# are correct or useful.
|
|
# Currently only tests that valid .thrift files parse cleanly.
|
|
# Doesn't test that correct information is extracted from them.
|
|
|
|
shopt -s extglob
|
|
|
|
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
ROOT_DIR=`cd $MY_DIR/../../ && pwd`
|
|
TEST_THRIFT_DIR=${ROOT_DIR}/test
|
|
THRIFT_FILES=`find ${TEST_THRIFT_DIR} -type f -name *.thrift ! -name BrokenConstants.thrift`
|
|
|
|
OUTPUT_DIR=`mktemp -d -t test_thrift_parser.XXXXX`
|
|
|
|
PASS=0
|
|
FAIL=0
|
|
for f in ${THRIFT_FILES};
|
|
do
|
|
echo "Parsing ${f}"
|
|
${MY_DIR}/thrift -o ${OUTPUT_DIR} -nowarn --allow-64bit-consts --gen cpp ${f}
|
|
EXIT_CODE=$?
|
|
if [ ${EXIT_CODE} -eq 0 ]; then
|
|
let PASS=PASS+1
|
|
else
|
|
let FAIL=FAIL+1
|
|
fi
|
|
done
|
|
echo
|
|
echo "${PASS} files parsed correctly. ${FAIL} files failed to parse."
|