yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [3/5] yetus git commit: YETUS-86. add C/C++ compile support
Date Wed, 21 Oct 2015 03:33:10 GMT
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/80f44728
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/80f44728
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/80f44728

Branch: refs/heads/YETUS-83
Commit: 80f44728cab610b0dbcaad1df1600046f22acaee
Parents: cfaa40a
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 20:33:01 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/80f44728/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/80f44728/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


Mime
View raw message