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>
* 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:
5. Testing fixes.
The brute force method is, of course, to configure and build
GCC. There are easier ways, too. You can run the compiled
binaries in isolation. ``c_tests'' can be tested with
``fixtests'', ``c_fixes'' with ``fixfixes'' and any fix or
test can be tested with ``fixincl''.
``fixtests'' is invoked as follows:
fixtests filename.h your_test_name
if [ $? -ne 0 ]
then echo do not apply your_fix_name
else echo APPLY your_fix_name ; fi
and ``fixfixes'' is invoked thus:
fixfixes filename.h your_fix_name < filename.h > /tmp/fixed
The file name argument is required, but is only used as a hint
for use by ``your_fix_name'', it is not used for obtaining the
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.
GCC. But you can also:
cd ${top_builddir}/gcc
rm -rf fixinc.sh include/ stmp-fixinc
make stmp-fixinc
I would really recommend, however:
cd ${top_builddir}/gcc/fixinc
make check
To do this, you *must* have autogen installed on your system.
The "check" step will proceed to construct a shell script that
will exercize all the fixes, using the sample test_text
provided with each fix. Once done, the changes made will
be compared against the changes saved in the source directory.
If you are changing the tests or fixes, the change will likely
be highlighted.
......@@ -21,7 +21,21 @@ export TARGET_MACHINE DESTDIR SRCDIR FIND_BASE VERBOSE
mkdir ${DESTDIR} ${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/[=
_IF files _exist =][=
files[0] =][=
_ELSE =]testing.h[=
_ENDIF =] <<- '_HACK_EOF_'
_ENDIF =] <<- _HACK_EOF_
#ifndef [=hackname _up=]_CHECK
#if defined( [=hackname _up=]_CHECK )
[=test_text "\t" _prefix=]
#endif /* [=hackname _up=]_CHECK */
_HACK_EOF_
......@@ -65,7 +79,7 @@ do
echo "Only in inc: inc/$f"
else
diff -c inc/$f res/$f | \
sed -e '1,2s; .*;;'
sed -e '1,2s; .*;;' -e '/MACH_DIFF:/,/no uniform test,/d'
fi
done > NEWDIFF < LIST
......
......@@ -2291,13 +2291,8 @@ tTestDesc aM88k_Multi_InclTests[] = {
/*
* Fix Command Arguments for M88k_Multi_Incl
*/
const char* apzM88k_Multi_InclPatch[] = { "sh", "-c",
"echo Fixing $file, to protect against multiple inclusion. >&2\n\
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}_ */\"",
const char* apzM88k_Multi_InclPatch[] = {
"wrap",
(char*)NULL };
/* * * * * * * * * * * * * * * * * * * * * * * * * *
......@@ -5070,7 +5065,7 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
{ zM88k_Multi_InclName, zM88k_Multi_InclList,
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 },
{ zMachine_Ansi_H_Va_ListName, zMachine_Ansi_H_Va_ListList,
......
......@@ -1284,13 +1284,8 @@ fix = {
mach = "m88k-tektronix-sysv3*";
files = "time.h";
bypass = "#ifndef";
shell =
"echo Fixing $file, to protect against multiple inclusion. >&2
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}_ */\"";
c_fix = wrap;
test_text = "";
};
......@@ -1314,8 +1309,11 @@ fix = {
hackname = machine_name;
c_test = machine_name;
c_fix = machine_name;
test_text = "#ifdef i386 /* no uniform machine_name test, so\n"
" this only works on i?86 machines */";
test_text =
"#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