summaryrefslogtreecommitdiffstats
path: root/gcc/fixinc/check.tpl
blob: 56276a0280c5350562d4132c47da2fc851706b2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
[= autogen template sh=check.sh =]
[=
#
#  This file contanes the shell template to run tests on the fixes
#
=]#!/bin/sh

set -e
[ -d testdir ] && rm -rf testdir
mkdir testdir
cd testdir

TARGET_MACHINE='*'
DESTDIR=`pwd`/res
SRCDIR=`pwd`/inc
FIND_BASE='.'
VERBOSE=1

export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE

mkdir ${DESTDIR} ${SRCDIR}

( cd ${SRCDIR}
  mkdir sys X11 Xm sundev sunwindow )

[=

_FOR fix =][=

  _IF test_text _exist ! =][=
    _IF replace _exist ! =]
echo No test for [=hackname=][=
    _ENDIF =][=
  _ELSE =]
cat >> inc/[=
    _IF files _exist =][=
      files[0] =][=
    _ELSE =]testing.h[=
    _ENDIF =] <<- '_HACK_EOF_'


	#ifndef [=hackname _up=]_CHECK
[=test_text "\t" _prefix=]
	#endif  /* [=hackname _up=]_CHECK */
_HACK_EOF_
[=_ENDIF =][=

/fix

=]

cd inc
find . -type f | sed 's;\./;;' | sort > ../LIST
../../fixincl < ../LIST
cd ..

while read f
do
  if [ ! -f res/$f ]
  then
    echo "Only in inc:  inc/$f"
  else
    diff -c inc/$f res/$f | \
      sed -e '1,2s;	.*;;'
  fi
done > NEWDIFF < LIST

echo
echo Test output check:
[=

_FOR fix =][=

  _IF test_text _exist =]
fgrep [=hackname _up=]_CHECK NEWDIFF > /dev/null 2>&1 || \
  echo "[=_eval hackname _get "#%32s test failed.  See testdir/inc/"
          _printf =][=
    _IF files _exist =][=
      files[0] =][=
    _ELSE =]testing.h[=
    _ENDIF =]"[=
  _ENDIF =][=

/fix

=][=
_eval _outfile "chmod +x %s" _printf _shell
=]
OpenPOWER on IntegriCloud