From 4cf8d660d29f0533df21c1f29cce8e4e77e10a0c Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Fri, 25 Dec 2015 02:02:40 -0500 Subject: [PATCH] Added additional Clang test on Linux when compiler is GCC --- cryptest.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/cryptest.sh b/cryptest.sh index eaba37d2..e07a5b43 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -898,6 +898,32 @@ fi ############################################ ############################################ +# If using GCC (likely Linux), then perform a quick check with Clang. +# This check was added after testing on Ubuntu 14.04 with Clang 3.4. +if [ "$CXX" == "g++" ]; then + + $(which clang++ | head -1) -x c++ -c adhoc.cpp.proto -o $TMP/adhoc > /dev/null 2>&1 + if [ "$?" -eq "0" ]; then + + ############################################ + # Basic Clang build + echo + echo "************************************" | tee -a "$TEST_RESULTS" + echo "Testing: Clang" | tee -a "$TEST_RESULTS" + echo + + unset CXX + unset CXXFLAGS + export CXX="clang++" + + "$MAKE" clean > /dev/null 2>&1 + "$MAKE" static dynamic cryptest.exe 2>&1 | tee -a "$TEST_RESULTS" + fi +fi + +############################################ +############################################ + TEST_END=$(date) echo "************************************************" | tee -a "$TEST_RESULTS" @@ -932,3 +958,10 @@ echo | tee -a "$TEST_RESULTS" echo "************************************************" | tee -a "$TEST_RESULTS" echo "************************************************" | tee -a "$TEST_RESULTS" + +# http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF +if [ "$COUNT" -eq "0" ]; then + exit 0 +else + exit 1 +fi