Changeset edf7492 in rtems-testing


Ignore:
Timestamp:
Aug 1, 2011, 2:23:15 PM (8 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
828eab3
Parents:
8c4e654
Message:

2011-08-01 Joel Sherrill <joel.sherrill@…>

  • Makefile: Enhance to check more than a BSP.
  • check_submission: New file.
  • check_bsp: Removed.
Location:
merge-helpers
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • merge-helpers/ChangeLog

    r8c4e654 redf7492  
     12011-08-01      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile: Enhance to check more than a BSP.
     4        * check_submission: New file.
     5        * check_bsp: Removed.
     6
    172011-01-24      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • merge-helpers/Makefile

    r8c4e654 redf7492  
    44
    55INSTALL_DIR=../bin
    6 SCRIPTS=check_bsp
     6SCRIPTS=check_submission
    77
    88all: prep ${SCRIPTS} install
  • merge-helpers/check_submission

    r8c4e654 redf7492  
    44#
    55#  Test for:
    6 #    - presense of BSP_BOOTCARD_OPTIONS
    76#    - XXX
    8 #    - XXX
    97#
    108#  $Id$
    119#
    1210
    13 if [ $# -ne 1 ] ; then
    14   echo Usage: $0 BSPDIR
     11usage()
     12{
     13cat <<EOF
     14check_submission [options] directory
     15  -v - verbose
     16EOF
     17}
     18
     19fatal()
     20{
     21  usage
     22  exit 1
     23}
     24
     25toggle()
     26{
     27  case $1 in
     28    no)  echo "yes" ;;
     29    yes) echo "no" ;;
     30    *)   fatal "Unknown value to toggle ($1)" ;;
     31  esac
     32}
     33
     34verbose="no"
     35do_bsp="no"
     36do_test="no"
     37
     38while getopts vbt OPT
     39do
     40    case "$OPT" in
     41        b) do_bsp="yes" ; do_test="no"  ;;
     42        t) do_bsp="no"  ; do_test="yes" ;;
     43        v) verbose=`toggle ${verbose}` ;;
     44        *) fatal ;;
     45    esac
     46done
     47
     48########################### Grab Directory ###########################
     49
     50shiftcount=`expr $OPTIND - 1`
     51shift $shiftcount
     52
     53basedir=${1}
     54
     55if [ ${do_bsp} = "no" -a ${do_test} = "no" ] ; then
     56  fatal must select test or bsp check mode
     57fi
     58
     59if [ ! -d ${basedir} ] ; then
     60  fatal ${basedir} is not a directory
     61fi
     62
     63
     64cd ${basedir}
     65if [ $? -ne 0 ] ; then
     66  echo Unable to cd to ${basedir}
    1567  exit 1
    1668fi
    1769
    18 bspdir=${1}
    19 
    20 if [ ! -d ${bspdir} ] ; then
    21   echo ${bspdir} is not a directory
    22   exit 1
    23 fi
    24 
    25 cd ${bspdir}
    26 if [ $? -ne 0 ] ; then
    27   echo Unable to cd to ${bspdir}
    28   exit 1
    29 fi
    30 
    3170
    3271test_its_there()
     
    3776  grep ${2} ${1} >/dev/null
    3877  if [ $? -ne 0 ] ; then
    39     echo "${2} is NOT in ${bspdir}/${1}"
     78    echo "${2} is NOT in ${basedir}/${1}"
    4079  fi
    4180
     
    4988  grep -i ${2} ${1} >/dev/null
    5089  if [ $? -ne 0 ] ; then
    51     echo "${2} is NOT in ${bspdir}/${1} - case independent check"
     90    echo "${2} is NOT in ${basedir}/${1} - case independent check"
    5291  fi
    5392
     
    63102  grep -i "${*}" ${FILE} >/dev/null
    64103  if [ $? -eq 0 ] ; then
    65     echo "(${*}) SHOULD NOT BE IN ${bspdir}/${FILE} - case independent check"
     104    echo "(${*}) SHOULD NOT BE IN ${basedir}/${FILE} - case independent check"
    66105  fi
    67106}
     
    76115  grep "${*}" ${FILE} >/dev/null
    77116  if [ $? -eq 0 ] ; then
    78     echo "(${*}) SHOULD NOT BE IN ${bspdir}/${FILE}"
     117    echo "(${*}) SHOULD NOT BE IN ${basedir}/${FILE}"
    79118  fi
    80119}
     
    101140}
    102141
    103 if [ -r configure.ac ] ; then
    104   echo "=== Checking for RTEMS_BSP_BOOTCARD_OPTIONS in BSP configure.ac"
    105   test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS
    106   echo "=== Checking for RTEMS_BSP_CLEANUP_OPTIONS in BSP configure.ac"
    107   test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS
    108 fi
    109 
    110142# Verify no lines longer than 80 columns
    111143echo "=== Checking for lines greater than 79 columns"
     
    114146  grep  ".\{80,\}" ${f} >/dev/null
    115147  if [ $? -eq 0 ] ; then
    116     echo "${bspdir}/${FILE} has the following lines that are too long"
     148    echo "*** ${basedir}/${f} has the following lines that are too long"
    117149    grep -n '.\{80,\}' ${f}
    118150  fi
     
    133165done
    134166
    135 # We do not want stdio in a BSP
    136 echo "=== Checking for stdio"
    137 find_source -m -c -C | while read f
    138 do
    139   test_its_NOT_there ${f} printf
    140   test_its_NOT_there ${f} puts
    141 done
    142 
    143167# We do not want the reformatted license notice
    144168echo "=== Checking for reformatted RTEMS license notices"
     
    167191
    168192# If not using -O2, then we really want to know
    169 echo "=== Checking for not using -O2"
    170 grep -H "\-O[013456789]" make/custom/*.cfg
    171 
    172 # BSPs should not turn on extra warnings
    173 echo "=== Checking for turning on extra GCC warning checks"
    174 grep -H "\-W" make/custom/*.cfg
    175 
    176 # Hopefully have some output from the tmtests
    177 echo "=== Checking for timing information"
    178 c=`ls -1 times* 2>/dev/null | wc -l`
    179 if [ ${c} -eq 0 ] ; then
    180   echo "Please run the timing tests and include the results."
    181 fi
     193if [ ${do_bsp} = "yes" ] ; then
     194  # We do not want stdio in a BSP
     195  echo "=== Checking for stdio"
     196  find_source -m -c -C | while read f
     197  do
     198    test_its_NOT_there ${f} printf
     199    test_its_NOT_there ${f} puts
     200  done
     201
     202  # BSPs should include RTEMS_BSP_CLEANUP_OPTIONS and maybe
     203  #   RTEMS_BSP_BOOTCARD_OPTIONS
     204  if [ -r configure.ac ] ; then
     205    echo "=== Checking for RTEMS_BSP_BOOTCARD_OPTIONS in BSP configure.ac"
     206    test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS
     207    echo "=== Checking for RTEMS_BSP_CLEANUP_OPTIONS in BSP configure.ac"
     208    test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS
     209  fi
     210
     211  # BSPs should normally use -O2
     212  echo "=== Checking for not using -O2"
     213  grep -H "\-O[013456789]" make/custom/*.cfg
     214
     215  # BSPs should not turn on extra warnings
     216  echo "=== Checking for turning on extra GCC warning checks"
     217  grep -H "\-W" make/custom/*.cfg
     218
     219  # Hopefully have some output from the tmtests
     220  echo "=== Checking for timing information"
     221  c=`ls -1 times* 2>/dev/null | wc -l`
     222  if [ ${c} -eq 0 ] ; then
     223    echo "Please run the timing tests and include the results."
     224  fi
     225fi  ## END OF IF BSP
     226
    182227exit 0
Note: See TracChangeset for help on using the changeset viewer.