source: rtems-testing/merge-helpers/check_bsp @ 62df6c5

4.11
Last change on this file since 62df6c5 was 62df6c5, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 10, 2009 at 7:42:35 PM

2009-09-10 Joel Sherrill <joel.sherrill@…>

  • check_bsp: Clean up check_bsp.
  • Makefile: New file.
  • Property mode set to 100755
File size: 2.0 KB
Line 
1#
2#  Script to test for various things we want in a BSP when it is
3#  submitted.
4#
5#  Test for:
6#    - presense of BSP_BOOTCARD_OPTIONS
7#    - XXX
8#
9
10if [ $# -ne 1 ] ; then
11  echo Usage: $0 BSPDIR
12  exit 1
13fi
14
15bspdir=${1}
16
17if [ ! -d ${bspdir} ] ; then
18  echo ${bspdir} is not a directory
19  exit 1
20fi
21
22cd ${bspdir}
23if [ $? -ne 0 ] ; then
24  echo Unable to cd to ${bspdir}
25  exit 1
26fi
27
28
29test_its_there()
30{
31  if [ $# -ne 2 ] ; then
32    echo Usage: $0 FILE pattern
33  fi
34  grep ${2} ${1} >/dev/null
35  if [ $? -ne 0 ] ; then
36    echo NOT in ${bspdir}/${1}
37  fi
38
39}
40
41test_its_NOT_there()
42{
43  if [ $# -lt 2 ] ; then
44    echo Usage: $0 FILE pattern
45  fi
46  FILE=$1
47  shift
48  grep "${*}" ${FILE} >/dev/null
49  if [ $? -eq 0 ] ; then
50    echo SHOULD NOT BE IN ${bspdir}/${FILE}
51  fi
52
53}
54
55if [ -r configure.ac ] ; then
56  echo "=== Checking for options in BSP configure.ac"
57  test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS
58  test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS
59fi
60
61# really need to make the copyright strings consistent in BSPs
62echo "=== Checking for copyright notices"
63find . -name "*.[chS]" | while read f
64do
65  grep -i COPYRIGHT ${f} >/dev/null
66  if [ $? -ne 0 ] ; then
67    echo Copyright is NOT in ${bspdir}/${f}
68  fi
69done
70
71# We want CVS Id strings everywhere possible
72echo "=== Checking for CVS Id strings"
73find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f
74do
75  test_its_there ${f} "\$Id"
76done
77
78# We do not want printf in a BSP
79echo "=== Checking for printf"
80find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f
81do
82  test_its_NOT_there ${f} printf
83done
84
85# We do not want puts in a BSP
86echo "=== Checking for puts"
87find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f
88do
89  test_its_NOT_there ${f} puts
90done
91
92# We do not want the reformatted license notice
93echo "=== Checking for reformatted RTEMS license notices"
94find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f
95do
96  test_its_NOT_there ${f} "this file may be found in the file"
97done
98
99exit 0
Note: See TracBrowser for help on using the repository browser.