You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by aw...@apache.org on 2015/10/20 17:06:24 UTC
[8/9] yetus git commit: YETUS-86. add C/C++ compile support
YETUS-86. add C/C++ compile support
Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/88a5cc17
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/88a5cc17
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/88a5cc17
Branch: refs/heads/YETUS-83
Commit: 88a5cc178befb65bea9a0d72626904895f27b5cf
Parents: 5a4d4db
Author: Allen Wittenauer <aw...@apache.org>
Authored: Fri Oct 16 20:38:11 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Tue Oct 20 08:05:44 2015 -0700
----------------------------------------------------------------------
dev-support/test-patch.d/cc.sh | 61 +++++++++++++++++++++++++++++++++++++
dev-support/test-patch.sh | 2 ++
2 files changed, 63 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/yetus/blob/88a5cc17/dev-support/test-patch.d/cc.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.d/cc.sh b/dev-support/test-patch.d/cc.sh
new file mode 100755
index 0000000..2b7d115
--- /dev/null
+++ b/dev-support/test-patch.d/cc.sh
@@ -0,0 +1,61 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+add_test_type cc
+
+function cc_filefilter
+{
+ declare filename=$1
+
+ if [[ ${filename} =~ \.c$
+ || ${filename} =~ \.cc$
+ || ${filename} =~ \.h$
+ || ${filename} =~ \.hh$
+ ]]; then
+ yetus_debug "tests/cc: ${filename}"
+ add_test cc
+ add_test compile
+ fi
+}
+
+## @description check for C/C++ compiler errors
+## @audience private
+## @stability stable
+## @replaceable no
+## @return 0 on success
+## @return 1 on failure
+function cc_compile
+{
+ declare codebase=$1
+ declare multijdkmode=$2
+
+ verify_needed_test cc
+ if [[ $? = 0 ]]; then
+ return 0
+ fi
+
+ if [[ ${codebase} = patch ]]; then
+ generic_postlog_compare compile cc "${multijdkmode}"
+ fi
+}
+
+function cc_count_probs
+{
+ declare warningfile=$1
+
+ #shellcheck disable=SC2016,SC2046
+ ${GREP} -E '^.*\.(c|cc|h|hh)\:[[:digit:]]*\:' "${warningfile}" | ${AWK} '{sum+=1} END {print sum}'
+}
http://git-wip-us.apache.org/repos/asf/yetus/blob/88a5cc17/dev-support/test-patch.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh
index 0abcf66..6d20959 100755
--- a/dev-support/test-patch.sh
+++ b/dev-support/test-patch.sh
@@ -2121,6 +2121,8 @@ function generic_count_probs
"${PROJECT_NAME}_${testtype}_count_probs" "${input}"
elif declare -f ${BUILDTOOL}_${testtype}_count_probs >/dev/null; then
"${BUILDTOOL}_${testtype}_count_probs" "${input}"
+ elif declare -f ${testtype}_count_probs >/dev/null; then
+ "${testtype}_count_probs" "${input}"
else
yetus_error "ERROR: ${testtype}: No function defined to count problems."
echo 0