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/21 16:52:42 UTC
yetus git commit: YETUS-86. add C/C++ compile support
Repository: yetus
Updated Branches:
refs/heads/master cfaa40aa5 -> 1fec6c91f
YETUS-86. add C/C++ compile support
Signed-off-by: Allen Wittenauer <aw...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/1fec6c91
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/1fec6c91
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/1fec6c91
Branch: refs/heads/master
Commit: 1fec6c91f517dd2bc333c70ab6e80644d940ce0d
Parents: cfaa40a
Author: Allen Wittenauer <aw...@apache.org>
Authored: Fri Oct 16 20:38:11 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Wed Oct 21 07:52:36 2015 -0700
----------------------------------------------------------------------
dev-support/test-patch.d/cc.sh | 63 +++++++++++++++++++++++++++++++++++++
dev-support/test-patch.sh | 2 ++
2 files changed, 65 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/yetus/blob/1fec6c91/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..cae91d3
--- /dev/null
+++ b/dev-support/test-patch.d/cc.sh
@@ -0,0 +1,63 @@
+#!/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} =~ \.cpp$
+ || ${filename} =~ \.cxx$
+ || ${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/1fec6c91/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