Commit da6d3adf by Bruce Korb Committed by Bruce Korb

test_text cleanups

From-SVN: r34020
parent f2b33981
2000-05-19 Bruce Korb <bkorb@gnu.org>
* fixinc/README: cleaned up old documentation
* fixinc/check.diff: regenerated & verified on OSR5 on ix86
* fixinc/check.tpl: compute the list of needed directories
emit "#if defined(name)" because of conflict
omit machine name differences from output differences
* fixinc/inclhack.def( m88k_multi_incl ): Use `wrap' function
(machine_name): change test text to use `sed' markers
* fixinc/fixincl.x: regen
Fri May 19 06:49:35 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Fri May 19 06:49:35 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* config/elfos.h (SELECT_SECTION): Don't access DECL_INITIAL of * config/elfos.h (SELECT_SECTION): Don't access DECL_INITIAL of
......
...@@ -192,49 +192,21 @@ Here are the rules for making fixes in the inclhack.def file: ...@@ -192,49 +192,21 @@ Here are the rules for making fixes in the inclhack.def file:
5. Testing fixes. 5. Testing fixes.
The brute force method is, of course, to configure and build The brute force method is, of course, to configure and build
GCC. There are easier ways, too. You can run the compiled GCC. But you can also:
binaries in isolation. ``c_tests'' can be tested with
``fixtests'', ``c_fixes'' with ``fixfixes'' and any fix or cd ${top_builddir}/gcc
test can be tested with ``fixincl''. rm -rf fixinc.sh include/ stmp-fixinc
make stmp-fixinc
``fixtests'' is invoked as follows:
I would really recommend, however:
fixtests filename.h your_test_name
if [ $? -ne 0 ] cd ${top_builddir}/gcc/fixinc
then echo do not apply your_fix_name make check
else echo APPLY your_fix_name ; fi
To do this, you *must* have autogen installed on your system.
and ``fixfixes'' is invoked thus: The "check" step will proceed to construct a shell script that
will exercize all the fixes, using the sample test_text
fixfixes filename.h your_fix_name < filename.h > /tmp/fixed provided with each fix. Once done, the changes made will
be compared against the changes saved in the source directory.
The file name argument is required, but is only used as a hint If you are changing the tests or fixes, the change will likely
for use by ``your_fix_name'', it is not used for obtaining the be highlighted.
data. Also, ``your_fix_name'' and ``your_test_name'' may be
the same, since fix names and test names are in different
"name spaces."
The ``fixincl'' program is a little harder to work with :-}.
It was written with the expectation that it would be run
inside of the fixincl.sh script that handles everything.
Run it with no arguments to get usage hints, but here is what
you will need to do (approximately):
FI=${top_builddir}/gcc/fixinc/fixincl
TARGET_MACHINE=`sh ${top_srcdir}/config.guess`
SRCDIR=/usr/include
DESTDIR=/tmp/fixtest
VERBOSE=4
FIND_BASE="."
export TARGET_MACHINE SRCDIR DESTDIR VERBOSE FIND_BASE
rm -rf ${DESTDIR}
mkdir -p ${DESTDIR}
cd ${SRCDIR}
find * -follow -type f -name '*.h' > ${DESTDIR}/LIST
# you may edit this to the list you want
${FI} ${DESTDIR}/LIST > /dev/null 2> ${DESTDIR}/LOG
Check your results in ${DESTDIR}/LOG. The stdout output
is merely some shell commands that are relevant only to
the fixincl.sh shell script.
...@@ -21,7 +21,21 @@ export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE ...@@ -21,7 +21,21 @@ export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE
mkdir ${DESTDIR} ${SRCDIR} mkdir ${DESTDIR} ${SRCDIR}
( cd ${SRCDIR} ( cd ${SRCDIR}
mkdir netinet rpc sparc sundev sunwindow sys X11 Xm ) set +e
for f in [=
_EVAL fix.files _stack _join "echo `
for f in %s
do case $f in
*/* ) echo $f | sed 's;/[^/]*$;;' ;;
esac
done | sort -u
` " _printf _shell =]
do
mkdir $f || mkdir -p $f
done ) > /dev/null 2>&1
[= [=
...@@ -40,10 +54,10 @@ cat >> inc/[= ...@@ -40,10 +54,10 @@ cat >> inc/[=
_IF files _exist =][= _IF files _exist =][=
files[0] =][= files[0] =][=
_ELSE =]testing.h[= _ELSE =]testing.h[=
_ENDIF =] <<- '_HACK_EOF_' _ENDIF =] <<- _HACK_EOF_
#ifndef [=hackname _up=]_CHECK #if defined( [=hackname _up=]_CHECK )
[=test_text "\t" _prefix=] [=test_text "\t" _prefix=]
#endif /* [=hackname _up=]_CHECK */ #endif /* [=hackname _up=]_CHECK */
_HACK_EOF_ _HACK_EOF_
...@@ -65,7 +79,7 @@ do ...@@ -65,7 +79,7 @@ do
echo "Only in inc: inc/$f" echo "Only in inc: inc/$f"
else else
diff -c inc/$f res/$f | \ diff -c inc/$f res/$f | \
sed -e '1,2s; .*;;' sed -e '1,2s; .*;;' -e '/MACH_DIFF:/,/no uniform test,/d'
fi fi
done > NEWDIFF < LIST done > NEWDIFF < LIST
......
...@@ -2291,13 +2291,8 @@ tTestDesc aM88k_Multi_InclTests[] = { ...@@ -2291,13 +2291,8 @@ tTestDesc aM88k_Multi_InclTests[] = {
/* /*
* Fix Command Arguments for M88k_Multi_Incl * Fix Command Arguments for M88k_Multi_Incl
*/ */
const char* apzM88k_Multi_InclPatch[] = { "sh", "-c", const char* apzM88k_Multi_InclPatch[] = {
"echo Fixing $file, to protect against multiple inclusion. >&2\n\ "wrap",
cpp_wrapper=`echo $file | sed -e 's,\\.,_,g' -e 's,/,_,g'`\n\
echo \"#ifndef __GCC_GOT_${cpp_wrapper}_\"\n\
echo \"#define __GCC_GOT_${cpp_wrapper}_\"\n\
cat\n\
echo \"#endif /* ! __GCC_GOT_${cpp_wrapper}_ */\"",
(char*)NULL }; (char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * *
...@@ -5070,7 +5065,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = { ...@@ -5070,7 +5065,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zM88k_Multi_InclName, zM88k_Multi_InclList, { zM88k_Multi_InclName, zM88k_Multi_InclList,
apzM88k_Multi_InclMachs, apzM88k_Multi_InclMachs,
M88K_MULTI_INCL_TEST_CT, FD_MACH_ONLY | FD_SHELL_SCRIPT, M88K_MULTI_INCL_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aM88k_Multi_InclTests, apzM88k_Multi_InclPatch }, aM88k_Multi_InclTests, apzM88k_Multi_InclPatch },
{ zMachine_Ansi_H_Va_ListName, zMachine_Ansi_H_Va_ListList, { zMachine_Ansi_H_Va_ListName, zMachine_Ansi_H_Va_ListList,
......
...@@ -1284,13 +1284,8 @@ fix = { ...@@ -1284,13 +1284,8 @@ fix = {
mach = "m88k-tektronix-sysv3*"; mach = "m88k-tektronix-sysv3*";
files = "time.h"; files = "time.h";
bypass = "#ifndef"; bypass = "#ifndef";
shell = c_fix = wrap;
"echo Fixing $file, to protect against multiple inclusion. >&2 test_text = "";
cpp_wrapper=`echo $file | sed -e 's,\\.,_,g' -e 's,/,_,g'`
echo \"#ifndef __GCC_GOT_${cpp_wrapper}_\"
echo \"#define __GCC_GOT_${cpp_wrapper}_\"
cat
echo \"#endif /* ! __GCC_GOT_${cpp_wrapper}_ */\"";
}; };
...@@ -1314,8 +1309,11 @@ fix = { ...@@ -1314,8 +1309,11 @@ fix = {
hackname = machine_name; hackname = machine_name;
c_test = machine_name; c_test = machine_name;
c_fix = machine_name; c_fix = machine_name;
test_text = "#ifdef i386 /* no uniform machine_name test, so\n" test_text =
" this only works on i?86 machines */"; "#if /* MACH_DIFF: */ \\\n"
"\t defined( i386 ) \\\n"
"\t|| defined( sparc ) /*\n"
"no uniform test, so be careful :-) */";
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment