change log for rtems-testing (2011-08-01)

rtems-vc at rtems.org rtems-vc at rtems.org
Mon Aug 1 15:10:03 UTC 2011


 *joel*:
2011-08-01	Joel Sherrill <joel.sherrill at oarcorp.com>

	* Makefile: Enhance to check more than a BSP.
	* check_submission: New file.
	* check_bsp: Removed.

M   1.10  merge-helpers/ChangeLog
M    1.2  merge-helpers/Makefile
R    1.9  merge-helpers/check_bsp
A    1.1  merge-helpers/check_submission

diff -u rtems-testing/merge-helpers/ChangeLog:1.9 rtems-testing/merge-helpers/ChangeLog:1.10
--- rtems-testing/merge-helpers/ChangeLog:1.9	Mon Jan 24 09:33:04 2011
+++ rtems-testing/merge-helpers/ChangeLog	Mon Aug  1 09:23:14 2011
@@ -1,3 +1,9 @@
+2011-08-01	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* Makefile: Enhance to check more than a BSP. 
+	* check_submission: New file.
+	* check_bsp: Removed.
+
 2011-01-24	Joel Sherrill <joel.sherrill at oarcorp.com>
 
 	* check_bsp: Fix copyright check to allow Copyright.

diff -u rtems-testing/merge-helpers/Makefile:1.1 rtems-testing/merge-helpers/Makefile:1.2
--- rtems-testing/merge-helpers/Makefile:1.1	Thu Sep 10 14:42:35 2009
+++ rtems-testing/merge-helpers/Makefile	Mon Aug  1 09:23:14 2011
@@ -3,7 +3,7 @@
 #
 
 INSTALL_DIR=../bin
-SCRIPTS=check_bsp
+SCRIPTS=check_submission
 
 all: prep ${SCRIPTS} install
 

diff -u /dev/null rtems-testing/merge-helpers/check_submission:1.1
--- /dev/null	Mon Aug  1 10:10:03 2011
+++ rtems-testing/merge-helpers/check_submission	Mon Aug  1 09:23:15 2011
@@ -0,0 +1,227 @@
+#
+#  Script to test for various things we want in a BSP when it is
+#  submitted.
+#
+#  Test for:
+#    - XXX
+#
+#  $Id$
+#
+
+usage()
+{
+cat <<EOF
+check_submission [options] directory
+  -v - verbose
+EOF
+}
+
+fatal()
+{
+  usage
+  exit 1
+}
+
+toggle()
+{
+  case $1 in
+    no)  echo "yes" ;;
+    yes) echo "no" ;;
+    *)   fatal "Unknown value to toggle ($1)" ;;
+  esac
+}
+
+verbose="no"
+do_bsp="no"
+do_test="no"
+
+while getopts vbt OPT
+do
+    case "$OPT" in
+        b) do_bsp="yes" ; do_test="no"  ;;
+        t) do_bsp="no"  ; do_test="yes" ;;
+        v) verbose=`toggle ${verbose}` ;;
+        *) fatal ;;
+    esac
+done
+
+########################### Grab Directory ###########################
+
+shiftcount=`expr $OPTIND - 1`
+shift $shiftcount
+
+basedir=${1}
+
+if [ ${do_bsp} = "no" -a ${do_test} = "no" ] ; then
+  fatal must select test or bsp check mode
+fi
+
+if [ ! -d ${basedir} ] ; then
+  fatal ${basedir} is not a directory
+fi
+
+
+cd ${basedir}
+if [ $? -ne 0 ] ; then
+  echo Unable to cd to ${basedir}
+  exit 1
+fi
+
+
+test_its_there()
+{
+  if [ $# -ne 2 ] ; then
+    echo Usage: $0 FILE pattern
+  fi
+  grep ${2} ${1} >/dev/null
+  if [ $? -ne 0 ] ; then
+    echo "${2} is NOT in ${basedir}/${1}"
+  fi
+
+}
+
+test_its_there_all_case()
+{
+  if [ $# -ne 2 ] ; then
+    echo Usage: $0 FILE pattern
+  fi
+  grep -i ${2} ${1} >/dev/null
+  if [ $? -ne 0 ] ; then
+    echo "${2} is NOT in ${basedir}/${1} - case independent check"
+  fi
+
+}
+
+test_its_NOT_there_all_case()
+{
+  if [ $# -lt 2 ] ; then
+    echo Usage: $0 FILE pattern
+  fi
+  FILE=$1
+  shift
+  grep -i "${*}" ${FILE} >/dev/null
+  if [ $? -eq 0 ] ; then
+    echo "(${*}) SHOULD NOT BE IN ${basedir}/${FILE} - case independent check"
+  fi
+}
+
+test_its_NOT_there()
+{
+  if [ $# -lt 2 ] ; then
+    echo Usage: $0 FILE pattern
+  fi
+  FILE=$1
+  shift
+  grep "${*}" ${FILE} >/dev/null
+  if [ $? -eq 0 ] ; then
+    echo "(${*}) SHOULD NOT BE IN ${basedir}/${FILE}"
+  fi
+}
+
+find_source()
+{
+  findArgs=
+  while getopts "cCm" OPT
+  do
+   case "$OPT" in
+     c) findArgs="${findArgs} -o -name configure.ac" ;;
+     C) findArgs="${findArgs} -o -name *.cfg" ;;
+     m) findArgs="${findArgs} -o -name Makefile.am" ;;
+     *) echo "bad arg to find_source ($OPT)" ; exit 1 ;;
+   esac
+  done
+
+  shiftcount=`expr $OPTIND - 1`
+  shift $shiftcount
+
+  args=$*
+
+  find . -name "*.[chS]" ${findArgs}
+}
+
+# Verify no lines longer than 80 columns
+echo "=== Checking for lines greater than 79 columns"
+find_source -m -c -C | while read f
+do
+  grep  ".\{80,\}" ${f} >/dev/null
+  if [ $? -eq 0 ] ; then
+    echo "*** ${basedir}/${f} has the following lines that are too long"
+    grep -n '.\{80,\}' ${f}
+  fi
+done
+
+# really need to make the copyright strings consistent in BSPs
+echo "=== Checking for copyright notices"
+find_source | while read f
+do
+  test_its_there_all_case ${f} COPYRIGHT
+done
+
+# We want CVS Id strings everywhere possible
+echo "=== Checking for CVS Id strings"
+find_source | while read f
+do
+  test_its_there ${f} "\$Id"
+done
+
+# We do not want the reformatted license notice
+echo "=== Checking for reformatted RTEMS license notices"
+find_source -m -c -C | while read f
+do
+  test_its_NOT_there ${f} "this file may be found in the file"
+done
+
+# We do not want GPL code
+echo "=== Checking for hints of GPL code"
+find_source -m -c -C | while read f
+do
+  test_its_NOT_there ${f} "Free Software Foundation"
+  test_its_NOT_there ${f} "program is free software"
+  test_its_NOT_there ${f} "General Public License"
+done
+
+# We do not want hints that there are things left to do
+echo "=== Checking for TODO hints"
+find_source -m -c -C | while read f
+do
+  test_its_NOT_there ${f} XXX
+  test_its_NOT_there ${f} TODO
+  test_its_NOT_there ${f} TBD
+done
+
+# If not using -O2, then we really want to know
+if [ ${do_bsp} = "yes" ] ; then
+  # We do not want stdio in a BSP
+  echo "=== Checking for stdio"
+  find_source -m -c -C | while read f
+  do
+    test_its_NOT_there ${f} printf
+    test_its_NOT_there ${f} puts
+  done
+
+  # BSPs should include RTEMS_BSP_CLEANUP_OPTIONS and maybe
+  #   RTEMS_BSP_BOOTCARD_OPTIONS
+  if [ -r configure.ac ] ; then
+    echo "=== Checking for RTEMS_BSP_BOOTCARD_OPTIONS in BSP configure.ac"
+    test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS
+    echo "=== Checking for RTEMS_BSP_CLEANUP_OPTIONS in BSP configure.ac"
+    test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS
+  fi
+
+  # BSPs should normally use -O2
+  echo "=== Checking for not using -O2"
+  grep -H "\-O[013456789]" make/custom/*.cfg
+
+  # BSPs should not turn on extra warnings
+  echo "=== Checking for turning on extra GCC warning checks"
+  grep -H "\-W" make/custom/*.cfg
+
+  # Hopefully have some output from the tmtests
+  echo "=== Checking for timing information"
+  c=`ls -1 times* 2>/dev/null | wc -l`
+  if [ ${c} -eq 0 ] ; then
+    echo "Please run the timing tests and include the results."
+  fi
+fi  ## END OF IF BSP
+
+exit 0



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110801/162363a6/attachment.html>


More information about the vc mailing list