Thread: ecpg tests broken by pgindent run

ecpg tests broken by pgindent run

From
Tom Lane
Date:
Hey Bruce, I thought the ecpg test files were supposed to be excluded
from pgindenting?  The buildfarm is all red, or would be if you could
see it.        regards, tom lane


Re: ecpg tests broken by pgindent run

From
Bruce Momjian
Date:
Tom Lane wrote:
> Hey Bruce, I thought the ecpg test files were supposed to be excluded
> from pgindenting?  The buildfarm is all red, or would be if you could
> see it.

Well, I am excluding them:
       find . -name '*.[ch]' -type f -print |       egrep -v '/s_lock.h|/ecpg/test/expected/|/snowball/libstemmer/' |
   xargs -n100 pgindent src/tools/pgindent/typedefs.list
 

with '/ecpg/test/expected/'.  When I run the the ecpg regression tests 
I do see failures like:
*** /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c    Wed Jan  6
06:59:522010--- /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/ecpg/test/results/compat_informix-sqlda.c Fri
Feb26 11:20:25 2010****************** 32,49 ****  #ifdef _ECPG_INFORMIX_H  #include "sqlda-compat.h"! typedef struct
sqlvar_compat sqlvar_t;! typedef struct sqlda_compat   sqlda_t;!  #else  #include "sqlda-native.h"! typedef struct
sqlvar_struct sqlvar_t;! typedef struct sqlda_struct   sqlda_t;!  #endif! #endif /* ECPG_SQLDA_H */  #line 7
"sqlda.pgc"---32,47 ----  #ifdef _ECPG_INFORMIX_H  #include "sqlda-compat.h"! typedef struct sqlvar_compat sqlvar_t;!
typedefstruct sqlda_compat sqlda_t;  #else  #include "sqlda-native.h"! typedef struct sqlvar_struct sqlvar_t;! typedef
structsqlda_struct sqlda_t;  #endif! #endif   /* ECPG_SQLDA_H */  #line 7 "sqlda.pgc"
 
but if I look at the CVS history for
/cvsroot/pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
I see the last change was January 6, not from pgindent.

My only guess is that there was some boilerplate code in the ecpg C
files or outside /test which changed when ran pgindent.

I am researching now.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.comPG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do + If your life is a hard
drive,Christ can be your backup. +
 


Re: ecpg tests broken by pgindent run

From
Boszormenyi Zoltan
Date:
Bruce Momjian írta:
> Tom Lane wrote:
>   
>> Hey Bruce, I thought the ecpg test files were supposed to be excluded
>> from pgindenting?  The buildfarm is all red, or would be if you could
>> see it.
>>     
>
> Well, I am excluding them:
>
>         find . -name '*.[ch]' -type f -print |
>         egrep -v '/s_lock.h|/ecpg/test/expected/|/snowball/libstemmer/' |
>         xargs -n100 pgindent src/tools/pgindent/typedefs.list
>
> with '/ecpg/test/expected/'.  When I run the the ecpg regression tests 
> I do see failures like:
>
>     *** /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c    Wed
Jan 6 06:59:52 2010
 
>     --- /usr/var/local/src/gen/pgsql/CURRENT/pgsql/src/interfaces/ecpg/test/results/compat_informix-sqlda.c Fri Feb
2611:20:25 2010
 
>     ***************
>     *** 32,49 ****
>       #ifdef _ECPG_INFORMIX_H
>     
>       #include "sqlda-compat.h"
>     ! typedef struct sqlvar_compat  sqlvar_t;
>     ! typedef struct sqlda_compat   sqlda_t;
>     !
>       #else
>     
>       #include "sqlda-native.h"
>     ! typedef struct sqlvar_struct  sqlvar_t;
>     ! typedef struct sqlda_struct   sqlda_t;
>     !
>       #endif
>     
>     ! #endif /* ECPG_SQLDA_H */
>     
>       #line 7 "sqlda.pgc"
>     
>     --- 32,47 ----
>       #ifdef _ECPG_INFORMIX_H
>     
>       #include "sqlda-compat.h"
>     ! typedef struct sqlvar_compat sqlvar_t;
>     ! typedef struct sqlda_compat sqlda_t;
>       #else
>     
>       #include "sqlda-native.h"
>     ! typedef struct sqlvar_struct sqlvar_t;
>     ! typedef struct sqlda_struct sqlda_t;
>       #endif
>     
>     ! #endif   /* ECPG_SQLDA_H */
>     
>       #line 7 "sqlda.pgc"
>     
> but if I look at the CVS history for
> /cvsroot/pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
> I see the last change was January 6, not from pgindent.
>
> My only guess is that there was some boilerplate code in the ecpg C
> files or outside /test which changed when ran pgindent.
>
> I am researching now.
>   

Don't look further, interfaces/ecpg/include/sqlda.h has changed
by the pgindent run.


-- 
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/



Re: ecpg tests broken by pgindent run

From
Bruce Momjian
Date:
Boszormenyi Zoltan wrote:
> > but if I look at the CVS history for
> > /cvsroot/pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
> > I see the last change was January 6, not from pgindent.
> >
> > My only guess is that there was some boilerplate code in the ecpg C
> > files or outside /test which changed when ran pgindent.
> >
> > I am researching now.
> >   
> 
> Don't look further, interfaces/ecpg/include/sqlda.h has changed
> by the pgindent run.

Yea, it is that, and sqltypes.h and one other file I am trying to find
now.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.comPG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do + If your life is a hard
drive,Christ can be your backup. +
 


Re: ecpg tests broken by pgindent run

From
Bruce Momjian
Date:
Bruce Momjian wrote:
> Boszormenyi Zoltan wrote:
> > > but if I look at the CVS history for
> > > /cvsroot/pgsql/src/interfaces/ecpg/test/expected/compat_informix-sqlda.c
> > > I see the last change was January 6, not from pgindent.
> > >
> > > My only guess is that there was some boilerplate code in the ecpg C
> > > files or outside /test which changed when ran pgindent.
> > >
> > > I am researching now.
> > >
> >
> > Don't look further, interfaces/ecpg/include/sqlda.h has changed
> > by the pgindent run.
>
> Yea, it is that, and sqltypes.h and one other file I am trying to find
> now.

I have reverted changes to three include files who's output appears in
the regression tests.   I asssume this is new 9.0 behavior because I
didn't have this issue before.   I also updated the pgindent script to
prevent these from being changed in the future.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com
  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do
  + If your life is a hard drive, Christ can be your backup. +
Index: src/interfaces/ecpg/include/sqlda.h
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/ecpg/include/sqlda.h,v
retrieving revision 1.7
diff -c -c -r1.7 sqlda.h
*** src/interfaces/ecpg/include/sqlda.h    26 Feb 2010 02:01:31 -0000    1.7
--- src/interfaces/ecpg/include/sqlda.h    26 Feb 2010 17:06:54 -0000
***************
*** 4,16 ****
  #ifdef _ECPG_INFORMIX_H

  #include "sqlda-compat.h"
! typedef struct sqlvar_compat sqlvar_t;
! typedef struct sqlda_compat sqlda_t;
  #else

  #include "sqlda-native.h"
! typedef struct sqlvar_struct sqlvar_t;
! typedef struct sqlda_struct sqlda_t;
  #endif

! #endif   /* ECPG_SQLDA_H */
--- 4,18 ----
  #ifdef _ECPG_INFORMIX_H

  #include "sqlda-compat.h"
! typedef struct sqlvar_compat    sqlvar_t;
! typedef struct sqlda_compat    sqlda_t;
!
  #else

  #include "sqlda-native.h"
! typedef struct sqlvar_struct    sqlvar_t;
! typedef struct sqlda_struct    sqlda_t;
!
  #endif

! #endif /* ECPG_SQLDA_H */
Index: src/interfaces/ecpg/include/sqltypes.h
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/ecpg/include/sqltypes.h,v
retrieving revision 1.12
diff -c -c -r1.12 sqltypes.h
*** src/interfaces/ecpg/include/sqltypes.h    26 Feb 2010 02:01:31 -0000    1.12
--- src/interfaces/ecpg/include/sqltypes.h    26 Feb 2010 17:06:54 -0000
***************
*** 32,57 ****
  /*
   * Values used in sqlda->sqlvar[i]->sqltype
   */
! #define SQLCHAR        ECPGt_char
! #define SQLSMINT    ECPGt_short
! #define SQLINT        ECPGt_int
! #define SQLFLOAT    ECPGt_double
! #define SQLSMFLOAT    ECPGt_float
! #define SQLDECIMAL    ECPGt_decimal
! #define SQLSERIAL    ECPGt_int
! #define SQLDATE        ECPGt_date
! #define SQLDTIME    ECPGt_timestamp
! #define SQLTEXT        ECPGt_char
! #define SQLVCHAR    ECPGt_char
! #define SQLINTERVAL        ECPGt_interval
! #define SQLNCHAR    ECPGt_char
! #define SQLNVCHAR    ECPGt_char
  #ifdef HAVE_LONG_LONG_INT_64
! #define SQLINT8        ECPGt_long_long
! #define SQLSERIAL8    ECPGt_long_long
  #else
! #define SQLINT8        ECPGt_long
! #define SQLSERIAL8    ECPGt_long
  #endif

  #endif   /* ndef ECPG_SQLTYPES_H */
--- 32,57 ----
  /*
   * Values used in sqlda->sqlvar[i]->sqltype
   */
! #define    SQLCHAR        ECPGt_char
! #define    SQLSMINT    ECPGt_short
! #define    SQLINT        ECPGt_int
! #define    SQLFLOAT    ECPGt_double
! #define    SQLSMFLOAT    ECPGt_float
! #define    SQLDECIMAL    ECPGt_decimal
! #define    SQLSERIAL    ECPGt_int
! #define    SQLDATE        ECPGt_date
! #define    SQLDTIME    ECPGt_timestamp
! #define    SQLTEXT        ECPGt_char
! #define    SQLVCHAR    ECPGt_char
! #define SQLINTERVAL     ECPGt_interval
! #define    SQLNCHAR    ECPGt_char
! #define    SQLNVCHAR    ECPGt_char
  #ifdef HAVE_LONG_LONG_INT_64
! #define    SQLINT8        ECPGt_long_long
! #define    SQLSERIAL8    ECPGt_long_long
  #else
! #define    SQLINT8        ECPGt_long
! #define    SQLSERIAL8    ECPGt_long
  #endif

  #endif   /* ndef ECPG_SQLTYPES_H */
Index: src/interfaces/ecpg/test/preproc/struct.h
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/ecpg/test/preproc/struct.h,v
retrieving revision 1.2
diff -c -c -r1.2 struct.h
*** src/interfaces/ecpg/test/preproc/struct.h    26 Feb 2010 02:01:32 -0000    1.2
--- src/interfaces/ecpg/test/preproc/struct.h    26 Feb 2010 17:06:55 -0000
***************
*** 1,20 ****

! struct mytype
! {
!     int            id;
!     char        t[64];
!     double        d1;                /* dec_t */
!     double        d2;
!     char        c[30];
  };
  typedef struct mytype MYTYPE;

! struct mynulltype
! {
!     int            id;
!     int            t;
!     int            d1;
!     int            d2;
!     int            c;
  };
  typedef struct mynulltype MYNULLTYPE;
--- 1,18 ----

! struct mytype {
!     int    id;
!     char    t[64];
!     double    d1; /* dec_t */
!     double    d2;
!     char    c[30];
  };
  typedef struct mytype MYTYPE;

! struct mynulltype {
!     int    id;
!     int    t;
!     int    d1;
!     int    d2;
!     int    c;
  };
  typedef struct mynulltype MYNULLTYPE;
Index: src/tools/pgindent/README
===================================================================
RCS file: /cvsroot/pgsql/src/tools/pgindent/README,v
retrieving revision 1.37
diff -c -c -r1.37 README
*** src/tools/pgindent/README    26 Feb 2010 15:57:34 -0000    1.37
--- src/tools/pgindent/README    26 Feb 2010 17:06:55 -0000
***************
*** 20,25 ****
--- 20,27 ----

      find . -name '*.[ch]' -type f -print |
      egrep -v '/s_lock.h|/ecpg/test/expected/|/snowball/libstemmer/' |
+     egrep -v '/ecpg/include/(sqlda|sqltypes)\.h$' |
+     egrep -v '/ecpg/include/preproc/struct\.h$' |
      xargs -n100 pgindent src/tools/pgindent/typedefs.list

  5) Remove any files that generate errors.
***************
*** 44,56 ****
  src/include/storage/s_lock.h is excluded because it contains assembly code
  that pgindent tends to mess up.

- src/interfaces/ecpg/test/expected/ is excluded to avoid breaking the ecpg
- regression tests.
-
  src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/
  are excluded because those files are imported from an external project,
  not maintained locally, and are machine-generated anyway.

  ---------------------------------------------------------------------------

  Obsolete typedef list creation instructions:
--- 46,59 ----
  src/include/storage/s_lock.h is excluded because it contains assembly code
  that pgindent tends to mess up.

  src/include/snowball/libstemmer/ and src/backend/snowball/libstemmer/
  are excluded because those files are imported from an external project,
  not maintained locally, and are machine-generated anyway.

+ src/interfaces/ecpg/test/expected/ is excluded to avoid breaking the ecpg
+ regression tests.  Several *.h files are included in regression output so
+ should not be changed.
+
  ---------------------------------------------------------------------------

  Obsolete typedef list creation instructions:

Re: ecpg tests broken by pgindent run

From
Andrew Dunstan
Date:

Bruce Momjian wrote:
>>>>   
>>>>         
>>> Don't look further, interfaces/ecpg/include/sqlda.h has changed
>>> by the pgindent run.
>>>       
>> Yea, it is that, and sqltypes.h and one other file I am trying to find
>> now.
>>     
>
> I have reverted changes to three include files who's output appears in
> the regression tests.   I asssume this is new 9.0 behavior because I
> didn't have this issue before.   I also updated the pgindent script to
> prevent these from being changed in the future.
>
>   

Should not the instructions include doing a full set of regression tests 
to ensure that nothing breaks? The new installcheck-world target should 
help there.

cheers

andrew


Re: ecpg tests broken by pgindent run

From
Bruce Momjian
Date:
Andrew Dunstan wrote:
> 
> 
> Bruce Momjian wrote:
> >>>>   
> >>>>         
> >>> Don't look further, interfaces/ecpg/include/sqlda.h has changed
> >>> by the pgindent run.
> >>>       
> >> Yea, it is that, and sqltypes.h and one other file I am trying to find
> >> now.
> >>     
> >
> > I have reverted changes to three include files who's output appears in
> > the regression tests.   I asssume this is new 9.0 behavior because I
> > didn't have this issue before.   I also updated the pgindent script to
> > prevent these from being changed in the future.
> >
> >   
> 
> Should not the instructions include doing a full set of regression tests 
> to ensure that nothing breaks? The new installcheck-world target should 
> help there.

Wow, I didn't know that was available.  I have updated the pgindent
README.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.comPG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do + If your life is a hard
drive,Christ can be your backup. +