mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
Exclude flex-generated code from coverage testing
Flex generates a lot of functions that are not actually used. In order to avoid coverage figures being ruined by that, mark up the part of the .l files where the generated code appears by lcov exclusion markers. That way, lcov will typically only reported on coverage for the .l file, which is under our control, but not for the .c file. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
parent
cf5ba7c30c
commit
4211673622
@ -4,6 +4,8 @@
|
|||||||
* contrib/cube/cubescan.l
|
* contrib/cube/cubescan.l
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
/* No reason to constrain amount of data slurped */
|
/* No reason to constrain amount of data slurped */
|
||||||
#define YY_READ_BUF_SIZE 16777216
|
#define YY_READ_BUF_SIZE 16777216
|
||||||
|
|
||||||
@ -56,6 +58,8 @@ NaN [nN][aA][nN]
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
/* result is not used, but Bison expects this signature */
|
/* result is not used, but Bison expects this signature */
|
||||||
void
|
void
|
||||||
yyerror(NDBOX **result, const char *message)
|
yyerror(NDBOX **result, const char *message)
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
* A scanner for EMP-style numeric ranges
|
* A scanner for EMP-style numeric ranges
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
/* No reason to constrain amount of data slurped */
|
/* No reason to constrain amount of data slurped */
|
||||||
#define YY_READ_BUF_SIZE 16777216
|
#define YY_READ_BUF_SIZE 16777216
|
||||||
|
|
||||||
@ -51,6 +53,8 @@ float ({integer}|{real})([eE]{integer})?
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
void
|
void
|
||||||
yyerror(SEG *result, const char *message)
|
yyerror(SEG *result, const char *message)
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
/* Not needed now that this file is compiled as part of bootparse. */
|
/* Not needed now that this file is compiled as part of bootparse. */
|
||||||
/* #include "bootparse.h" */
|
/* #include "bootparse.h" */
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
|
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
|
||||||
#undef fprintf
|
#undef fprintf
|
||||||
@ -134,6 +135,8 @@ insert { return INSERT_TUPLE; }
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
void
|
void
|
||||||
yyerror(const char *message)
|
yyerror(const char *message)
|
||||||
{
|
{
|
||||||
|
@ -41,6 +41,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
|
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
|
||||||
#undef fprintf
|
#undef fprintf
|
||||||
#define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg)
|
#define fprintf(file, fmt, msg) fprintf_to_ereport(fmt, msg)
|
||||||
@ -1011,6 +1014,8 @@ other .
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Arrange access to yyextra for subroutines of the main yylex() function.
|
* Arrange access to yyextra for subroutines of the main yylex() function.
|
||||||
* We expect each subroutine to have a yyscanner parameter. Rather than
|
* We expect each subroutine to have a yyscanner parameter. Rather than
|
||||||
|
@ -38,6 +38,8 @@ static char *litbufdup(void);
|
|||||||
static void addlit(char *ytext, int yleng);
|
static void addlit(char *ytext, int yleng);
|
||||||
static void addlitchar(unsigned char ychar);
|
static void addlitchar(unsigned char ychar);
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option 8bit
|
%option 8bit
|
||||||
@ -186,6 +188,7 @@ WAIT { return K_WAIT; }
|
|||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
startlit(void)
|
startlit(void)
|
||||||
|
@ -32,6 +32,8 @@ static YY_BUFFER_STATE scanbufhandle;
|
|||||||
|
|
||||||
static StringInfoData xdbuf;
|
static StringInfoData xdbuf;
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option 8bit
|
%option 8bit
|
||||||
@ -112,6 +114,7 @@ xdinside [^"]+
|
|||||||
. { return JUNK; }
|
. { return JUNK; }
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
/* Needs to be here for access to yytext */
|
/* Needs to be here for access to yytext */
|
||||||
void
|
void
|
||||||
|
@ -57,6 +57,8 @@ static void record_config_file_error(const char *errmsg,
|
|||||||
static int GUC_flex_fatal(const char *msg);
|
static int GUC_flex_fatal(const char *msg);
|
||||||
static char *GUC_scanstr(const char *s);
|
static char *GUC_scanstr(const char *s);
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option 8bit
|
%option 8bit
|
||||||
@ -107,7 +109,7 @@ STRING \'([^'\\\n]|\\.|\'\')*\'
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exported function to read and process the configuration file. The
|
* Exported function to read and process the configuration file. The
|
||||||
|
@ -43,6 +43,8 @@ static bool last_was_newline = false;
|
|||||||
extern int expr_yyget_column(yyscan_t yyscanner);
|
extern int expr_yyget_column(yyscan_t yyscanner);
|
||||||
extern void expr_yyset_column(int column_no, yyscan_t yyscanner);
|
extern void expr_yyset_column(int column_no, yyscan_t yyscanner);
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* Except for the prefix, these options should match psqlscan.l */
|
/* Except for the prefix, these options should match psqlscan.l */
|
||||||
@ -190,6 +192,8 @@ continuation \\{newline}
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
void
|
void
|
||||||
expr_yyerror_more(yyscan_t yyscanner, const char *message, const char *more)
|
expr_yyerror_more(yyscan_t yyscanner, const char *message, const char *more)
|
||||||
{
|
{
|
||||||
|
@ -67,6 +67,8 @@ static void evaluate_backtick(PsqlScanState state);
|
|||||||
extern int slash_yyget_column(yyscan_t yyscanner);
|
extern int slash_yyget_column(yyscan_t yyscanner);
|
||||||
extern void slash_yyset_column(int column_no, yyscan_t yyscanner);
|
extern void slash_yyset_column(int column_no, yyscan_t yyscanner);
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
/* Except for the prefix, these options should match psqlscan.l */
|
/* Except for the prefix, these options should match psqlscan.l */
|
||||||
@ -468,6 +470,8 @@ other .
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Scan the command name of a psql backslash command. This should be called
|
* Scan the command name of a psql backslash command. This should be called
|
||||||
* after psql_scan() returns PSCAN_BACKSLASH. It is assumed that the input
|
* after psql_scan() returns PSCAN_BACKSLASH. It is assumed that the input
|
||||||
|
@ -71,6 +71,8 @@ typedef int YYSTYPE;
|
|||||||
extern int psql_yyget_column(yyscan_t yyscanner);
|
extern int psql_yyget_column(yyscan_t yyscanner);
|
||||||
extern void psql_yyset_column(int column_no, yyscan_t yyscanner);
|
extern void psql_yyset_column(int column_no, yyscan_t yyscanner);
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option reentrant
|
%option reentrant
|
||||||
@ -899,6 +901,8 @@ other .
|
|||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a lexer working state struct.
|
* Create a lexer working state struct.
|
||||||
*
|
*
|
||||||
|
@ -79,6 +79,8 @@ static struct _if_value
|
|||||||
short else_branch;
|
short else_branch;
|
||||||
} stacked_if_value[MAX_NESTED_IF];
|
} stacked_if_value[MAX_NESTED_IF];
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option 8bit
|
%option 8bit
|
||||||
@ -1249,7 +1251,11 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
<INITIAL>{other}|\n { mmfatal(PARSE_ERROR, "internal error: unreachable state; please report this to <pgsql-bugs@postgresql.org>"); }
|
<INITIAL>{other}|\n { mmfatal(PARSE_ERROR, "internal error: unreachable state; please report this to <pgsql-bugs@postgresql.org>"); }
|
||||||
|
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
void
|
void
|
||||||
lex_init(void)
|
lex_init(void)
|
||||||
{
|
{
|
||||||
|
@ -17,6 +17,8 @@ static int litbufpos = 0;
|
|||||||
|
|
||||||
static void addlitchar(char c);
|
static void addlitchar(char c);
|
||||||
|
|
||||||
|
/* LCOV_EXCL_START */
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%option 8bit
|
%option 8bit
|
||||||
@ -93,6 +95,8 @@ teardown { return TEARDOWN; }
|
|||||||
}
|
}
|
||||||
%%
|
%%
|
||||||
|
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
addlitchar(char c)
|
addlitchar(char c)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user