diff options
-rwxr-xr-x | tools/clang/plugins/tests/test.sh | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/clang/plugins/tests/test.sh b/tools/clang/plugins/tests/test.sh index 03c583d..ef0070f 100755 --- a/tools/clang/plugins/tests/test.sh +++ b/tools/clang/plugins/tests/test.sh @@ -10,20 +10,21 @@ E_BADARGS=65 # Prints usage information. -function usage() { - echo "Usage: `basename $0` <Path to the llvm build dir, usually Release+Asserts>" +usage() { + echo "Usage: $(basename "${0}")" \ + "<Path to the llvm build dir, usually Release+Asserts>" echo "" echo " Runs all the libFindBadConstructs unit tests" echo "" } # Runs a single test case. -function do_testcase { - local output=`${CLANG_DIR}/bin/clang -cc1 \ - -load ${CLANG_DIR}/lib/libFindBadConstructs.so \ - -plugin find-bad-constructs ${1} 2>&1` - local diffout=`echo "${output}" | diff - ${2}` - if [[ ${diffout} == "" ]]; then +do_testcase() { + local output="$("${CLANG_DIR}"/bin/clang -cc1 \ + -load "${CLANG_DIR}"/lib/libFindBadConstructs.so \ + -plugin find-bad-constructs ${1} 2>&1)" + local diffout="$(echo "${output}" | diff - "${2}")" + if [ "${diffout}" = "" ]; then echo "PASS: ${1}" else echo "FAIL: ${1}" @@ -46,5 +47,5 @@ else fi for input in *.cpp; do - do_testcase $input ${input%cpp}txt + do_testcase "${input}" "${input%cpp}txt" done |