Commit 7e416541 by Bruce Korb Committed by Bruce Korb

Omit testing wrap and replacement fixes during testing.

This exposes a missing result and tests a test that got hidden before.

From-SVN: r192952
parent 99a0106f
2012-09-29 Bruce Korb <bkorb@gnu.org>
* README: testing wrap and replacement fixes is pointless.
* fixincl.c: export verbosity enumerations to fixlib.h
(run_compiles): mark replacement fixes to be skipped when
in testing mode
* fixlib.h: add a test mode and enumerations from fixincl.c
* check.tpl: set TEST_MODE in environment
* fixopts.c (initialize_opts): check for TEST_MODE in environment
* inclhack.def: move AAB_darwin7_9_long_double_funcs to
darwin_9_long_double_funcs_2. It is not a replacement fix.
* fixincl.x: regenerate
* tests/base/ioLib.h: the need for this is now exposed, so add it.
* tests/base/architecture/ppc/math.h: the correct result is now needed.
2012-09-29 Robert Mason <rbmj@verizon.net>
* fixinc.in: Omit machine name checks for vxworks
......
......@@ -44,6 +44,9 @@ To make your fix, you will need to do several things:
Make sure it is now properly handled. Add tests to the
"test_text" entry(ies) that validate your fix. This will
help ensure that future fixes won't negate your work.
Do *NOT* specify test text for "wrap" or "replacement" fixes.
There is no real possibility that these fixes will fail.
If they do, you will surely know straight away.
5. Go into the fixincludes build directory and type, "make check".
You are guaranteed to have issues printed out as a result.
......
......@@ -99,6 +99,7 @@ ENDFOR fix
=]
export TEST_MODE=true
find . -type f | sed 's;^\./;;' | sort | ../../fixincl
cd ${DESTDIR}
......
......@@ -53,22 +53,8 @@ static const char z_std_preamble[] =
original, manufacturer supplied header file. */\n\n";
int find_base_len = 0;
typedef enum {
VERB_SILENT = 0,
VERB_FIXES,
VERB_APPLIES,
VERB_PROGRESS,
VERB_TESTS,
VERB_EVERYTHING
} te_verbose;
te_verbose verbose_level = VERB_PROGRESS;
int have_tty = 0;
#define VLEVEL(l) ((unsigned int) verbose_level >= (unsigned int) l)
#define NOT_SILENT VLEVEL(VERB_FIXES)
pid_t process_chain_head = (pid_t) -1;
char* pz_curr_file; /* name of the current file under test/fix */
......@@ -412,8 +398,17 @@ run_compiles (void)
/* FOR every fixup, ... */
do
{
tTestDesc *p_test = p_fixd->p_test_desc;
int test_ct = p_fixd->test_ct;
tTestDesc *p_test;
int test_ct;
if (fixinc_mode && (p_fixd->fd_flags & FD_REPLACEMENT))
{
p_fixd->fd_flags |= FD_SKIP_TEST;
continue;
}
p_test = p_fixd->p_test_desc;
test_ct = p_fixd->test_ct;
/* IF the machine type pointer is not NULL (we are not in test mode)
AND this test is for or not done on particular machines
......
......@@ -140,7 +140,10 @@ typedef int apply_fix_p_t; /* Apply Fix Predicate Type */
"amount of user entertainment" ) \
\
_ENV_( pz_find_base, BOOL_TRUE, "FIND_BASE", \
"leader to trim from file names" )
"leader to trim from file names" ) \
\
_ENV_( pz_test_mode, BOOL_FALSE, "TEST_MODE", \
"run fixincludes in test mode" )
#define _ENV_(v,m,n,t) extern tCC* v;
ENV_TABLE
......@@ -211,6 +214,27 @@ typedef struct {
extern int gnu_type_map_ct;
typedef enum {
VERB_SILENT = 0,
VERB_FIXES,
VERB_APPLIES,
VERB_PROGRESS,
VERB_TESTS,
VERB_EVERYTHING
} te_verbose;
te_verbose verbose_level;
#define VLEVEL(l) ((unsigned int) verbose_level >= (unsigned int) l)
#define NOT_SILENT VLEVEL(VERB_FIXES)
typedef enum {
TESTING_OFF = 0,
TESTING_ON = 1
} fixinc_mode_t;
fixinc_mode_t fixinc_mode;
#ifdef HAVE_MMAP_FILE
#define UNLOAD_DATA() do { if (curr_data_mapped) { \
munmap ((void*)pz_curr_data, data_map_size); close (data_map_fd); } \
......
......@@ -20,31 +20,43 @@ along with GCC; see the file COPYING3. If not see
#include "fixlib.h"
#define _ENV_(v,m,n,t) tCC* v = NULL;
te_verbose verbose_level = VERB_PROGRESS;
fixinc_mode_t fixinc_mode = TESTING_OFF;
#define _ENV_(v,m,n,t) char const * v = NULL;
ENV_TABLE
#undef _ENV_
void
initialize_opts (void)
static void
show_not_def (char const * vname)
{
static const char var_not_found[] =
#ifndef __STDC__
"fixincl ERROR: %s environment variable not defined\n"
#else
"fixincl ERROR: %s environment variable not defined\n"
"each of these must be defined:\n"
# define _ENV_(vv,mm,nn,tt) "\t" nn " - " tt "\n"
"each of these must be defined:\n";
static char const not_found_var[] = "\t%s\n";
fprintf (stderr, var_not_found, vname);
# define _ENV_(vv,mm,nn,tt) \
if (mm) fprintf (stderr, not_found_var, nn);
ENV_TABLE
# undef _ENV_
#endif
;
#define _ENV_(v,m,n,t) { tSCC var[] = n; \
v = getenv (var); if (m && (v == NULL)) { \
fprintf (stderr, var_not_found, var); \
exit (EXIT_FAILURE); } }
exit (EXIT_FAILURE);
}
ENV_TABLE
void
initialize_opts (void)
{
#define _ENV_(v,m,n,t) { \
static char const var[] = n; \
v = getenv (var); \
if (m && (v == NULL)) show_not_def (var); \
}
ENV_TABLE;
#undef _ENV_
if ((pz_test_mode != NULL) && (strcmp (pz_test_mode, "true") == 0))
fixinc_mode = TESTING_ON;
}
......@@ -46,7 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "fixlib.h"
#define _ENV_(v,m,n,t) extern tCC* v;
#define _ENV_(v,m,n,t) extern char const * v;
ENV_TABLE
#undef _ENV_
......
......@@ -196,25 +196,6 @@ fix = {
_EndOfHeader_;
};
/*
* ... and for the previous fix to be useful, you have to not use ""
* includes.
*/
fix = {
hackname = AAB_darwin7_9_long_double_funcs_2;
mach = "*-*-darwin7.9*";
files = math.h;
select = '#include[ \t]+\"';
c_fix = format;
c_fix_arg = "%1<%2.h>";
c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
test_text = '#include "architecture/ppc/math.h"';
};
/*
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
*/
......@@ -1069,7 +1050,6 @@ fix = {
test_text = "extern void exit ( int );";
};
/*
* Remove `extern double cabs' declarations from math.h.
* This conflicts with C99. Discovered on AIX.
......@@ -1105,7 +1085,7 @@ fix = {
*/
files = "architecture/ppc/math.h";
files = "architecture/*/math.h";
select = "#if defined(__APPLE_CC__) && (__APPLE_CC__ >= 1345)";
select = '#if defined\(__APPLE_CC__\) && \(__APPLE_CC__ >= 1345\)';
bypass = "powl";
c_fix = format;
c_fix_arg = "#if 1";
......@@ -1179,6 +1159,9 @@ fix = {
test_text = "#define _CTRL(c) ('c'&037)";
};
/*
* Fix various macros used to define ioctl numbers.
*/
fix = {
hackname = ctrl_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+CTRL[ \t]*\\( *[^,']";
......@@ -1215,6 +1198,23 @@ fix = {
test_text = "extern void* malloc( size_t );";
};
/*
* For the AAB_darwin7_9_long_double_funcs fix to be useful,
* you have to not use "" includes.
*/
fix = {
hackname = darwin_9_long_double_funcs_2;
mach = "*-*-darwin7.9*";
files = math.h;
select = '#include[ \t]+\"';
c_fix = format;
c_fix_arg = "%1<%2.h>";
c_fix_arg = '([ \t]*#[ \t]*include[ \t]+)"([a-z0-9/]+)\.h"';
test_text = '#include "architecture/ppc/math.h"';
};
/*
* On darwin8 and earlier, mach-o/swap.h isn't properly guarded
......@@ -2498,6 +2498,9 @@ fix = {
"#define XX_IO(x) ('x'<<8|256)";
};
/*
* Fix the usage of the ioctl macro numbers.
*/
fix = {
hackname = io_quotes_use;
select = "define[ \t]+[A-Z0-9_]+[ \t]+[A-Z0-9_]+IO[A-Z]*[ \t]*"
......
......@@ -7,82 +7,8 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
/* This file prototypes the long double functions available on Mac OS
10.3.9. */
#ifndef __MATH__
# undef __APPLE_CC__
# define __APPLE_CC__ 1345
# include_next <architecture/ppc/math.h>
# undef __APPLE_CC__
# define __APPLE_CC__ 1
# ifndef __LIBMLDBL_COMPAT
# ifdef __LONG_DOUBLE_128__
# define __LIBMLDBL_COMPAT(sym) __asm("_" #sym "$LDBL128")
# else
# define __LIBMLDBL_COMPAT(sym)
# endif /* __LONG_DOUBLE_128__ */
# endif /* __LIBMLDBL_COMPAT */
# ifdef __cplusplus
extern "C" {
# endif
extern long double acosl( long double ) __LIBMLDBL_COMPAT(acosl);
extern long double asinl( long double ) __LIBMLDBL_COMPAT(asinl);
extern long double atanl( long double ) __LIBMLDBL_COMPAT(atanl);
extern long double atan2l( long double, long double ) __LIBMLDBL_COMPAT(atan2l);
extern long double cosl( long double ) __LIBMLDBL_COMPAT(cosl);
extern long double sinl( long double ) __LIBMLDBL_COMPAT(sinl);
extern long double tanl( long double ) __LIBMLDBL_COMPAT(tanl);
extern long double acoshl( long double ) __LIBMLDBL_COMPAT(acoshl);
extern long double asinhl( long double ) __LIBMLDBL_COMPAT(asinhl);
extern long double atanhl( long double ) __LIBMLDBL_COMPAT(atanhl);
extern long double coshl( long double ) __LIBMLDBL_COMPAT(coshl);
extern long double sinhl( long double ) __LIBMLDBL_COMPAT(sinhl);
extern long double tanhl( long double ) __LIBMLDBL_COMPAT(tanhl);
extern long double expl( long double ) __LIBMLDBL_COMPAT(expl);
extern long double exp2l( long double ) __LIBMLDBL_COMPAT(exp2l);
extern long double expm1l( long double ) __LIBMLDBL_COMPAT(expm1l);
extern long double logl( long double ) __LIBMLDBL_COMPAT(logl);
extern long double log10l( long double ) __LIBMLDBL_COMPAT(log10l);
extern long double log2l( long double ) __LIBMLDBL_COMPAT(log2l);
extern long double log1pl( long double ) __LIBMLDBL_COMPAT(log1pl);
extern long double logbl( long double ) __LIBMLDBL_COMPAT(logbl);
extern long double modfl( long double, long double * ) __LIBMLDBL_COMPAT(modfl);
extern long double ldexpl( long double, int ) __LIBMLDBL_COMPAT(ldexpl);
extern long double frexpl( long double, int * ) __LIBMLDBL_COMPAT(frexpl);
extern int ilogbl( long double ) __LIBMLDBL_COMPAT(ilogbl);
extern long double scalbnl( long double, int ) __LIBMLDBL_COMPAT(scalbnl);
extern long double scalblnl( long double, long int ) __LIBMLDBL_COMPAT(scalblnl);
extern long double fabsl( long double ) __LIBMLDBL_COMPAT(fabsl);
extern long double cbrtl( long double ) __LIBMLDBL_COMPAT(cbrtl);
extern long double hypotl( long double, long double ) __LIBMLDBL_COMPAT(hypotl);
extern long double powl( long double, long double ) __LIBMLDBL_COMPAT(powl);
extern long double sqrtl( long double ) __LIBMLDBL_COMPAT(sqrtl);
extern long double erfl( long double ) __LIBMLDBL_COMPAT(erfl);
extern long double erfcl( long double ) __LIBMLDBL_COMPAT(erfcl);
extern long double lgammal( long double ) __LIBMLDBL_COMPAT(lgammal);
extern long double tgammal( long double ) __LIBMLDBL_COMPAT(tgammal);
extern long double ceill( long double ) __LIBMLDBL_COMPAT(ceill);
extern long double floorl( long double ) __LIBMLDBL_COMPAT(floorl);
extern long double nearbyintl( long double ) __LIBMLDBL_COMPAT(nearbyintl);
extern long double rintl( long double ) __LIBMLDBL_COMPAT(rintl);
extern long int lrintl( long double ) __LIBMLDBL_COMPAT(lrintl);
extern long long int llrintl( long double ) __LIBMLDBL_COMPAT(llrintl);
extern long double roundl( long double ) __LIBMLDBL_COMPAT(roundl);
extern long int lroundl( long double ) __LIBMLDBL_COMPAT(lroundl);
extern long long int llroundl( long double ) __LIBMLDBL_COMPAT(llroundl);
extern long double truncl( long double ) __LIBMLDBL_COMPAT(truncl);
extern long double fmodl( long double, long double) __LIBMLDBL_COMPAT(fmodl);
extern long double remainderl( long double, long double ) __LIBMLDBL_COMPAT(remainderl);
extern long double remquol( long double, long double, int * ) __LIBMLDBL_COMPAT(remquol);
extern long double copysignl( long double, long double ) __LIBMLDBL_COMPAT(copysignl);
extern long double nanl( const char * ) __LIBMLDBL_COMPAT(nanl);
extern long double nextafterl( long double, long double ) __LIBMLDBL_COMPAT(nextafterl);
extern long double nexttowardl( long double, long double ) __LIBMLDBL_COMPAT(nexttowardl);
extern long double fdiml( long double, long double ) __LIBMLDBL_COMPAT(fdiml);
extern long double fmaxl( long double, long double ) __LIBMLDBL_COMPAT(fmaxl);
extern long double fminl( long double, long double ) __LIBMLDBL_COMPAT(fminl);
extern long double fmal( long double, long double, long double ) __LIBMLDBL_COMPAT(fmal);
# ifdef __cplusplus
}
# endif
#endif /* __MATH__ */
#if defined( BROKEN_NAN_CHECK )
#if 1
#endif /* BROKEN_NAN_CHECK */
/* DO NOT EDIT THIS FILE.
It has been auto-edited by fixincludes from:
"fixinc/tests/inc/ioLib.h"
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#if defined( VXWORKS_IOCTL_MACRO_CHECK )
extern int ioctl ( int asdf1234, int jkl , int qwerty ) ;
#endif /* VXWORKS_IOCTL_MACRO_CHECK */
#if defined( VXWORKS_WRITE_CONST_CHECK )
extern int write (int, const char*, size_t);
#endif /* VXWORKS_WRITE_CONST_CHECK */
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