diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-04-24 14:16:15 -0700 |
commit | 943a48fc5c0a59b892eb746073c71b8dd88815e7 (patch) | |
tree | 421cfedbc60603d02e0b314d9204e9f85dd781c5 /cpp/test | |
parent | minor fix to IcePHP getLogger (diff) | |
download | ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.bz2 ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.tar.xz ice-943a48fc5c0a59b892eb746073c71b8dd88815e7.zip |
python 3 support
Diffstat (limited to 'cpp/test')
79 files changed, 1336 insertions, 1017 deletions
diff --git a/cpp/test/Freeze/complex/Grammar.cpp b/cpp/test/Freeze/complex/Grammar.cpp index ba6b0d6bee4..b77c4a3fe56 100644 --- a/cpp/test/Freeze/complex/Grammar.cpp +++ b/cpp/test/Freeze/complex/Grammar.cpp @@ -1,30 +1,39 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* A Bison parser, made by GNU Bison 2.4.1. */ - This program is free software; you can redistribute it and/or modify +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,32 +45,29 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.4.1" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 - +/* Push parsers. */ +#define YYPUSH 0 +/* Pull parsers. */ +#define YYPULL 1 -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - TOK_NUMBER = 258 - }; -#endif -#define TOK_NUMBER 258 - +/* Using locations. */ +#define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ #line 1 "Grammar.y" @@ -96,6 +102,9 @@ yyerror(const char* s) +/* Line 189 of yacc.c */ +#line 107 "Grammar.tab.c" + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -109,70 +118,202 @@ yyerror(const char* s) # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + TOK_NUMBER = 258 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 126 "Grammar.tab.c" +/* Line 264 of yacc.c */ +#line 152 "Grammar.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif -# ifndef YYFREE -# define YYFREE free +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int # endif -# ifndef YYMALLOC -# define YYMALLOC malloc +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid # endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# endif -# else -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif +# else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; - YYSTYPE yyvs; - }; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) @@ -180,24 +321,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -206,48 +347,42 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 6 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 11 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 8 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 3 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 6 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 12 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 258 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -280,28 +415,28 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned char yyprhs[] = +static const yytype_uint8 yyprhs[] = { 0, 0, 3, 5, 7, 11, 15 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { 9, 0, -1, 10, -1, 3, -1, 10, 4, 10, -1, 5, 10, 6, -1, 10, 7, 10, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned char yyrline[] = +static const yytype_uint8 yyrline[] = { 0, 42, 42, 49, 53, 57, 61 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "TOK_NUMBER", "'+'", "'('", "')'", "'*'", @@ -312,20 +447,20 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 43, 40, 41, 42 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 8, 9, 10, 10, 10, 10 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 3, 3, 3 }; @@ -333,14 +468,14 @@ static const unsigned char yyr2[] = /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { 0, 3, 0, 0, 2, 0, 1, 0, 0, 5, 4, 6 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = { -1, 3, 4 }; @@ -348,14 +483,14 @@ static const yysigned_char yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -4 -static const yysigned_char yypact[] = +static const yytype_int8 yypact[] = { 6, -4, 6, 2, 3, -3, -4, 6, 6, -4, 3, 3 }; /* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = +static const yytype_int8 yypgoto[] = { -4, -4, -2 }; @@ -365,13 +500,13 @@ static const yysigned_char yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const unsigned char yytable[] = +static const yytype_uint8 yytable[] = { 5, 7, 6, 9, 8, 10, 11, 7, 0, 1, 8, 2 }; -static const yysigned_char yycheck[] = +static const yytype_int8 yycheck[] = { 2, 4, 0, 6, 7, 7, 8, 4, -1, 3, 7, 5 @@ -379,28 +514,12 @@ static const yysigned_char yycheck[] = /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { 0, 3, 5, 9, 10, 10, 0, 4, 7, 6, 10, 10 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -426,30 +545,63 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - ((Current).first_line = (Rhs)[1].first_line, \ - (Current).first_column = (Rhs)[1].first_column, \ - (Current).last_line = (Rhs)[N].last_line, \ - (Current).last_column = (Rhs)[N].last_column) +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -470,43 +622,100 @@ while (0) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - short *bottom; - short *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -514,45 +723,52 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -567,13 +783,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -583,45 +795,47 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -631,84 +845,204 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) { - default: - break; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: - break; + break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -719,20 +1053,23 @@ int yyparse (); - -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -742,68 +1079,75 @@ yyparse () #endif #endif { - /* The lookahead symbol. */ +/* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; + /* Number of syntax errors so far. */ + int yynerrs; - register int yystate; - register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; -#define YYPOPSTACK (yyvsp--, yyssp--) + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; - YYSIZE_T yystacksize = YYINITDEPTH; + YYSIZE_T yystacksize; + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; @@ -814,8 +1158,7 @@ int yynerrs; `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -828,21 +1171,19 @@ int yynerrs; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; - + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); yyss = yyss1; @@ -850,24 +1191,23 @@ int yynerrs; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -878,7 +1218,6 @@ int yynerrs; yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); @@ -888,6 +1227,9 @@ int yynerrs; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -895,12 +1237,10 @@ int yynerrs; `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; @@ -922,7 +1262,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -939,25 +1279,20 @@ yybackup: goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + yystate = yyn; + *++yyvsp = yylval; + goto yynewstate; @@ -993,55 +1328,64 @@ yyreduce: switch (yyn) { case 2: + +/* Line 1455 of yacc.c */ #line 43 "Grammar.y" { - parser->setResult(yyval); + parser->setResult((yyval)); ;} break; case 3: + +/* Line 1455 of yacc.c */ #line 50 "Grammar.y" { - yyval = yyvsp[0]; + (yyval) = (yyvsp[(1) - (1)]); ;} break; case 4: + +/* Line 1455 of yacc.c */ #line 54 "Grammar.y" { - yyval = new Complex::AddNodeI(yyvsp[-2], yyvsp[0]); + (yyval) = new Complex::AddNodeI((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} break; case 5: + +/* Line 1455 of yacc.c */ #line 58 "Grammar.y" { - yyval = yyvsp[-1]; + (yyval) = (yyvsp[(2) - (3)]); ;} break; case 6: + +/* Line 1455 of yacc.c */ #line 62 "Grammar.y" { - yyval = new Complex::MultiplyNodeI(yyvsp[-2], yyvsp[0]); + (yyval) = new Complex::MultiplyNodeI((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); ;} break; - } - -/* Line 1000 of yacc.c. */ -#line 1035 "Grammar.tab.c" - - yyvsp -= yylen; - yyssp -= yylen; +/* Line 1455 of yacc.c */ +#line 1379 "Grammar.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -1065,66 +1409,41 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } - } - yyerror (yymsg); - YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } @@ -1135,25 +1454,16 @@ yyerrlab: error, discard it. */ if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + { + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - } - } + YYABORT; + } else { - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); + yydestruct ("Error: discarding", + yytoken, &yylval); yychar = YYEMPTY; - } } @@ -1167,15 +1477,17 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) goto yyerrorlab; -#endif - yyvsp -= yylen; - yyssp -= yylen; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; @@ -1204,21 +1516,20 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - YYPOPSTACK; + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -1237,25 +1548,45 @@ yyabortlab: yyresult = 1; goto yyreturn; -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } + +/* Line 1675 of yacc.c */ #line 67 "Grammar.y" diff --git a/cpp/test/Freeze/complex/Grammar.h b/cpp/test/Freeze/complex/Grammar.h index ff8b73a45bb..b7f7c2131d8 100644 --- a/cpp/test/Freeze/complex/Grammar.h +++ b/cpp/test/Freeze/complex/Grammar.h @@ -1,27 +1,37 @@ -/* A Bison parser, made by GNU Bison 1.875c. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +/* A Bison parser, made by GNU Bison 2.4.1. */ - This program is free software; you can redistribute it and/or modify +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -32,19 +42,16 @@ TOK_NUMBER = 258 }; #endif -#define TOK_NUMBER 258 - -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif - diff --git a/cpp/test/Freeze/complex/run.py b/cpp/test/Freeze/complex/run.py index deae63146e1..86316dce547 100755 --- a/cpp/test/Freeze/complex/run.py +++ b/cpp/test/Freeze/complex/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil testdir = os.path.dirname(os.path.abspath(__file__)) @@ -33,15 +33,17 @@ client = os.path.join(os.getcwd(), "client") if TestUtil.appverifier: TestUtil.setAppVerifierSettings([client]) -print "starting populate...", +sys.stdout.write("starting populate... ") +sys.stdout.flush() populateProc = TestUtil.startClient(client, ' --dbdir "%s" populate' % os.getcwd(), startReader = False) -print "ok" +print("ok") populateProc.startReader() populateProc.waitTestSuccess() -print "starting verification client...", +sys.stdout.write("starting verification client... ") +sys.stdout.flush() clientProc = TestUtil.startClient(client, ' --dbdir "%s" validate' % os.getcwd(), startReader = False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() diff --git a/cpp/test/Freeze/dbmap/run.py b/cpp/test/Freeze/dbmap/run.py index f1809a84d4d..89ea23b3d22 100755 --- a/cpp/test/Freeze/dbmap/run.py +++ b/cpp/test/Freeze/dbmap/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) diff --git a/cpp/test/Freeze/evictor/run.py b/cpp/test/Freeze/evictor/run.py index abac1bca7f4..b4b226b2727 100755 --- a/cpp/test/Freeze/evictor/run.py +++ b/cpp/test/Freeze/evictor/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil dbdir = os.path.join(os.getcwd(), "db") TestUtil.cleanDbDir(dbdir) @@ -26,4 +26,3 @@ TestUtil.cleanDbDir(dbdir) testOptions = ' --Freeze.DbEnv.db.DbHome="%s" --Ice.Config="%s"' % (dbdir, os.path.join(os.getcwd(), "config")) TestUtil.clientServerTest(additionalServerOptions= testOptions, additionalClientOptions= testOptions) - diff --git a/cpp/test/Freeze/fileLock/run.py b/cpp/test/Freeze/fileLock/run.py index 423aa1e2987..621efd35f3d 100755 --- a/cpp/test/Freeze/fileLock/run.py +++ b/cpp/test/Freeze/fileLock/run.py @@ -16,11 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "testing Freeze file lock...", +sys.stdout.write("testing Freeze file lock... ") sys.stdout.flush() client = os.path.join(os.getcwd(), "client") @@ -46,4 +46,4 @@ clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.waitTestSuccess() -print "ok" +print("ok") diff --git a/cpp/test/FreezeScript/dbmap/run.py b/cpp/test/FreezeScript/dbmap/run.py index 4cee776f276..da971d3385c 100755 --- a/cpp/test/FreezeScript/dbmap/run.py +++ b/cpp/test/FreezeScript/dbmap/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * - + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil transformdb = '%s' % os.path.join(TestUtil.getCppBinDir(), "transformdb") @@ -52,10 +51,10 @@ for file in os.listdir(os.path.join(os.getcwd(), "fail")): regex2 = re.compile(r"^.*transf(ormdb|~1)(\.exe)?", re.IGNORECASE) -print "testing error detection...", +sys.stdout.write("testing error detection... ") sys.stdout.flush() if TestUtil.debug: - print + sys.stdout.write("\n") files.sort() for oldfile in files: @@ -71,7 +70,7 @@ for oldfile in files: os.path.join(os.getcwd(), "fail", newfile) + '" -o tmp.xml --key string --value ' + value if TestUtil.debug: - print command + print(command) p = TestUtil.runCommand(command) (stdin, stdout, stderr) = (p.stdin, p.stdout, p.stderr) @@ -79,36 +78,40 @@ for oldfile in files: lines1 = stderr.readlines() lines2 = open(os.path.join(os.getcwd(), "fail", oldfile.replace("_old.ice", ".err")), "r").readlines() if len(lines1) != len(lines2): - print "failed! (1)" + print("failed! (1)") sys.exit(1) i = 0 while i < len(lines1): - line1 = regex2.sub("", lines1[i]).strip() - line2 = regex2.sub("", lines2[i]).strip() + if sys.version_info[0] == 2: + line1 = regex2.sub("", lines1[i]).strip() + line2 = regex2.sub("", lines2[i]).strip() + else: + line1 = regex2.sub("", lines1[i].decode("utf-8")).strip() + line2 = regex2.sub("", lines2[i]).strip() if line1 != line2: - print "failed! (2)" - print "line1 = " + line1 - print "line2 = " + line2 + print("failed! (2)") + print("line1 = " + line1) + print("line2 = " + line2) # sys.exit(1) i = i + 1 -print "ok" +print("ok") -print "creating test database...", +sys.stdout.write("creating test database... ") sys.stdout.flush() makedb = '"%s" "%s"'% (os.path.join(os.getcwd(), "makedb"), os.getcwd()) proc = TestUtil.spawn(makedb) proc.waitTestSuccess() -print "ok" +print("ok") testold = os.path.join(os.getcwd(), "TestOld.ice") testnew = os.path.join(os.getcwd(), "TestNew.ice") initxml = os.path.join(os.getcwd(), "init.xml") checkxml = os.path.join(os.getcwd(), "check.xml") -print "initializing test database...", +sys.stdout.write("initializing test database... ") sys.stdout.flush() command = '"' + transformdb + '" --old "' + testold + '" --new "' + testold + '" -f "' + initxml + '" "' + dbdir + \ @@ -116,9 +119,9 @@ command = '"' + transformdb + '" --old "' + testold + '" --new "' + testold + '" TestUtil.spawn(command).waitTestSuccess() -print "ok" +print("ok") -print "executing default transformations...", +sys.stdout.write("executing default transformations... ") sys.stdout.flush() command = '"' + transformdb + '" --old "' + testold + '" --new "' + testnew + '" --key int --value ::Test::S "' + init_dbdir + \ @@ -126,9 +129,9 @@ command = '"' + transformdb + '" --old "' + testold + '" --new "' + testnew + '" TestUtil.spawn(command).waitTestSuccess() -print "ok" +print("ok") -print "validating database...", +sys.stdout.write("validating database... ") sys.stdout.flush() command = '"' + transformdb + '" --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + check_dbdir + \ @@ -136,7 +139,7 @@ command = '"' + transformdb + '" --old "' + testnew + '" --new "' + testnew + '" TestUtil.spawn(command).waitTestSuccess() -print "ok" +print("ok") if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd([transformdb]) diff --git a/cpp/test/FreezeScript/evictor/run.py b/cpp/test/FreezeScript/evictor/run.py index 5f4391559dd..a197c80fec4 100755 --- a/cpp/test/FreezeScript/evictor/run.py +++ b/cpp/test/FreezeScript/evictor/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel os.getcwd()!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel os.getcwd()!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil transformdb = os.path.join(TestUtil.getCppBinDir(), "transformdb") @@ -38,36 +38,36 @@ if os.path.exists(tmp_dbdir): shutil.rmtree(tmp_dbdir) os.mkdir(tmp_dbdir) -print "creating test database...", +sys.stdout.write("creating test database... ") sys.stdout.flush() makedb = '"%s" "%s"' % (os.path.join(os.getcwd(), "makedb"), os.getcwd()) proc = TestUtil.spawn(makedb) proc.waitTestSuccess() -print "ok" +print("ok") testold = os.path.join(os.getcwd(), "TestOld.ice") testnew = os.path.join(os.getcwd(), "TestNew.ice") transformxml = os.path.join(os.getcwd(), "transform.xml") checkxml = os.path.join(os.getcwd(), "check.xml") -print "executing evictor transformations...", +sys.stdout.write("executing evictor transformations... ") sys.stdout.flush() command = '"' + transformdb + '" -e -p --old "' + testold + '" --new "' + testnew + '" -f "' + transformxml + '" "' + dbdir + \ '" evictor.db "' + check_dbdir + '" ' proc = TestUtil.spawn(command) proc.waitTestSuccess() -print "ok" +print("ok") -print "validating database...", +sys.stdout.write("validating database... ") sys.stdout.flush() command = '"' + transformdb + '" -e --old "' + testnew + '" --new "' + testnew + '" -f "' + checkxml + '" "' + check_dbdir + \ '" evictor.db "' + tmp_dbdir + '"' proc = TestUtil.spawn(command) proc.waitTestSuccess() -print "ok" +print("ok") if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd([transformdb]) diff --git a/cpp/test/Glacier2/attack/run.py b/cpp/test/Glacier2/attack/run.py index 624dc1f7e5c..8b510507d5f 100755 --- a/cpp/test/Glacier2/attack/run.py +++ b/cpp/test/Glacier2/attack/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil testdir = os.getcwd() router = TestUtil.getGlacier2Router() @@ -32,9 +32,10 @@ args = ' --Glacier2.RoutingTable.MaxSize=10' + \ ' --Ice.Admin.InstanceName=Glacier2' + \ ' --Glacier2.CryptPasswords="' + os.path.join(testdir, "passwords") + '"' -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() starterProc = TestUtil.startServer(router, args, count=2) -print "ok" +print("ok") TestUtil.clientServerTest() diff --git a/cpp/test/Glacier2/dynamicFiltering/run.py b/cpp/test/Glacier2/dynamicFiltering/run.py index 44e72842f45..69cc0cf4aac 100755 --- a/cpp/test/Glacier2/dynamicFiltering/run.py +++ b/cpp/test/Glacier2/dynamicFiltering/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil server = os.path.join(os.getcwd(), "server") client = os.path.join(os.getcwd(), "client") @@ -30,9 +30,10 @@ if TestUtil.appverifier: TestUtil.setAppVerifierSettings(targets) -print "starting server...", +sys.stdout.write("starting server... ") +sys.stdout.flush() serverProc = TestUtil.startServer(server, count=3) -print "ok" +print("ok") args = r' --Glacier2.Client.Endpoints="default -p 12347"' + \ r' --Ice.Admin.Endpoints="tcp -p 12348"' + \ @@ -42,15 +43,15 @@ args = r' --Glacier2.Client.Endpoints="default -p 12347"' + \ r' --Glacier2.PermissionsVerifier="Glacier2/NullPermissionsVerifier"' + \ r' --Ice.Default.Locator="locator:default -p 12012"' -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() starterProc = TestUtil.startServer(router, args, count=2) -print "ok" +print("ok") - - -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() proc = TestUtil.startClient(client, startReader = False) -print "ok" +print("ok") proc.startReader() proc.waitTestSuccess() diff --git a/cpp/test/Glacier2/override/run.py b/cpp/test/Glacier2/override/run.py index c531f9dec1b..cd2173e01b4 100755 --- a/cpp/test/Glacier2/override/run.py +++ b/cpp/test/Glacier2/override/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil router = TestUtil.getGlacier2Router() @@ -46,9 +46,10 @@ def startRouter(): ' --Glacier2.Client.Buffered=1 --Glacier2.Server.Buffered=1' + \ ' --Glacier2.Client.SleepTime=50 --Glacier2.Server.SleepTime=50' - print "starting router in buffered mode...", + sys.stdout.write("starting router in buffered mode... ") + sys.stdout.flush() starterProc = TestUtil.startServer(router, args, count=2) - print "ok" + print("ok") return starterProc name = os.path.join("Glacier2", "override") @@ -59,4 +60,3 @@ starterProc.waitTestSuccess() if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd([router]) - diff --git a/cpp/test/Glacier2/router/run.py b/cpp/test/Glacier2/router/run.py index b8194611f80..05234c93d7c 100755 --- a/cpp/test/Glacier2/router/run.py +++ b/cpp/test/Glacier2/router/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil router = TestUtil.getGlacier2Router() @@ -40,14 +40,16 @@ def startRouter(buffered): if buffered: args += ' --Glacier2.Client.Buffered=1 --Glacier2.Server.Buffered=1' - print "starting router in buffered mode...", + sys.stdout.write("starting router in buffered mode... ") + sys.stdout.flush() else: args += ' --Glacier2.Client.Buffered=0 --Glacier2.Server.Buffered=0' - print "starting router in unbuffered mode...", + sys.stdout.write("starting router in unbuffered mode... ") + sys.stdout.flush() starterProc = TestUtil.startServer(router, args, count=2) - print "ok" + print("ok") return starterProc name = os.path.join("Glacier2", "router") @@ -76,4 +78,3 @@ starterProc.waitTestSuccess() if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd([router]) - diff --git a/cpp/test/Glacier2/sessionControl/run.py b/cpp/test/Glacier2/sessionControl/run.py index 500ac7668bb..f4564493786 100755 --- a/cpp/test/Glacier2/sessionControl/run.py +++ b/cpp/test/Glacier2/sessionControl/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil server = os.path.join(os.getcwd(), "server") router = TestUtil.getGlacier2Router() @@ -29,9 +29,10 @@ if TestUtil.appverifier: targets = [server, client, router] TestUtil.setAppVerifierSettings(targets) -print "starting server...", +sys.stdout.write("starting server... ") +sys.stdout.flush() serverProc = TestUtil.startServer(server) -print "ok" +print("ok") args = ' --Glacier2.Client.Endpoints="default -p 12347"' + \ ' --Ice.Admin.Endpoints="tcp -p 12348"' + \ @@ -40,20 +41,20 @@ args = ' --Glacier2.Client.Endpoints="default -p 12347"' + \ ' --Glacier2.SessionManager="SessionManager:tcp -p 12010"' \ ' --Glacier2.PermissionsVerifier="Glacier2/NullPermissionsVerifier"' -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() starterProc = TestUtil.startServer(router, args, count = 2) -print "ok" - - +print("ok") # # The test may sporadically fail without this slight pause. # time.sleep(1) -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient(client, startReader = False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() @@ -62,4 +63,3 @@ starterProc.waitTestSuccess() if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets) - diff --git a/cpp/test/Glacier2/sessionHelper/run.py b/cpp/test/Glacier2/sessionHelper/run.py index 1705881b750..7284609bbda 100755 --- a/cpp/test/Glacier2/sessionHelper/run.py +++ b/cpp/test/Glacier2/sessionHelper/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil router = os.path.join(TestUtil.getCppBinDir(), "glacier2router") @@ -31,15 +31,13 @@ args = ' --Ice.Warn.Dispatch=0' + \ ' --Ice.Admin.InstanceName=Glacier2' + \ ' --Glacier2.CryptPasswords="' + os.path.join(os.getcwd(), "passwords") + '"' -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() routerConfig = TestUtil.DriverConfig("server") routerConfig.lang = "cpp" starterProc = TestUtil.startServer(router, args, count=2, config=routerConfig) -print "ok" - - +print("ok") TestUtil.clientServerTest(additionalClientOptions=" --shutdown") starterProc.waitTestSuccess() - diff --git a/cpp/test/Glacier2/ssl/run.py b/cpp/test/Glacier2/ssl/run.py index 72dd1ada03a..903540c602e 100755 --- a/cpp/test/Glacier2/ssl/run.py +++ b/cpp/test/Glacier2/ssl/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil server = os.path.join(os.getcwd(), "server") client = os.path.join(os.getcwd(), "client") @@ -29,9 +29,10 @@ if TestUtil.appverifier: targets = [server, client, router] TestUtil.setAppVerifierSettings(targets) -print "starting server...", +sys.stdout.write("starting server... ") +sys.stdout.flush() serverProc = TestUtil.startServer(server) -print "ok" +print("ok") args = ' --Ice.Warn.Dispatch=0' + \ ' --Glacier2.AddSSLContext=1' + \ @@ -47,16 +48,18 @@ args = ' --Ice.Warn.Dispatch=0' + \ routerCfg = TestUtil.DriverConfig("server") routerCfg.protocol = "ssl" -print "starting router...", +sys.stdout.write("starting router... ") +sys.stdout.flush() starterProc = TestUtil.startServer(router, args, routerCfg, count = 2) -print "ok" +print("ok") clientCfg = TestUtil.DriverConfig("client") clientCfg.protocol = "ssl" -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient(client, "", clientCfg, startReader = False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() diff --git a/cpp/test/Glacier2/staticFiltering/run.py b/cpp/test/Glacier2/staticFiltering/run.py index ca0c7147623..e3807da41fc 100755 --- a/cpp/test/Glacier2/staticFiltering/run.py +++ b/cpp/test/Glacier2/staticFiltering/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil hostname = socket.gethostname() fqdn = socket.getfqdn() @@ -224,13 +224,13 @@ if not limitedTests: ]) if len(testcases) == 0: - print "WARNING: You are running this test with SSL disabled and the network " - print " configuration for this host does not permit the other tests " - print " to run correctly." + print("WARNING: You are running this test with SSL disabled and the network ") + print(" configuration for this host does not permit the other tests ") + print(" to run correctly.") sys.exit(0) elif len(testcases) < 6: - print "WARNING: The network configuration for this host does not permit all " - print " tests to run correctly, some tests have been disabled." + print("WARNING: The network configuration for this host does not permit all ") + print(" tests to run correctly, some tests have been disabled.") def pingProgress(): sys.stdout.write('.') @@ -244,7 +244,7 @@ for testcase in testcases: # use command line arguments to pass the test cases in, but a # configuration file is easier. # - attackcfg = file(os.path.join(os.getcwd(), 'attack.cfg'), 'w') + attackcfg = open(os.path.join(os.getcwd(), 'attack.cfg'), 'w') accepts=0 rejects=0 sys.stdout.write(description) @@ -285,7 +285,7 @@ for testcase in testcases: ' --Ice.Admin.InstanceName=Glacier2' + \ ' --Glacier2.CryptPasswords="' + os.path.join(os.getcwd(), "passwords") + '"' - routerConfig = file(os.path.join(os.getcwd(), "router.cfg"), "w") + routerConfig = open(os.path.join(os.getcwd(), "router.cfg"), "w") routerConfig.write("Ice.Default.Locator=locator:tcp -h %s -p 12010\n" % hostname) routerConfig.write("Glacier2.Client.Trace.Reject=0\n") @@ -327,7 +327,7 @@ for testcase in testcases: pingProgress() if TestUtil.protocol != "ssl": - serverConfig = file(os.path.join(os.getcwd(), "server.cfg"), "w") + serverConfig = open(os.path.join(os.getcwd(), "server.cfg"), "w") serverOptions = ' --Ice.Config="' + os.path.join(os.getcwd(), "server.cfg") + '" ' serverConfig.write("BackendAdapter.Endpoints=tcp -p 12010\n") serverConfig.close() diff --git a/cpp/test/Ice/adapterDeactivation/run.py b/cpp/test/Ice/adapterDeactivation/run.py index 099ce110107..db68ff30b9a 100755 --- a/cpp/test/Ice/adapterDeactivation/run.py +++ b/cpp/test/Ice/adapterDeactivation/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/ami/run.py b/cpp/test/Ice/ami/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/ami/run.py +++ b/cpp/test/Ice/ami/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/background/run.py b/cpp/test/Ice/background/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/background/run.py +++ b/cpp/test/Ice/background/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/binding/run.py b/cpp/test/Ice/binding/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/binding/run.py +++ b/cpp/test/Ice/binding/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/checksum/run.py b/cpp/test/Ice/checksum/run.py index f6f62b28c1f..564355252bc 100755 --- a/cpp/test/Ice/checksum/run.py +++ b/cpp/test/Ice/checksum/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil server = os.path.join(os.getcwd(), "server", "server") TestUtil.clientServerTest(server = server) - diff --git a/cpp/test/Ice/custom/run.py b/cpp/test/Ice/custom/run.py index 43526feb98b..f1fb492a715 100755 --- a/cpp/test/Ice/custom/run.py +++ b/cpp/test/Ice/custom/run.py @@ -16,14 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server = "serveramd") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/defaultServant/run.py b/cpp/test/Ice/defaultServant/run.py index de6f75c19e5..21a39b058b8 100755 --- a/cpp/test/Ice/defaultServant/run.py +++ b/cpp/test/Ice/defaultServant/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/Ice/defaultValue/run.py b/cpp/test/Ice/defaultValue/run.py index 3c4472ca289..86e9aba519e 100755 --- a/cpp/test/Ice/defaultValue/run.py +++ b/cpp/test/Ice/defaultValue/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/Ice/dispatcher/run.py b/cpp/test/Ice/dispatcher/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/dispatcher/run.py +++ b/cpp/test/Ice/dispatcher/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/exceptions/run.py b/cpp/test/Ice/exceptions/run.py index 43526feb98b..f1fb492a715 100755 --- a/cpp/test/Ice/exceptions/run.py +++ b/cpp/test/Ice/exceptions/run.py @@ -16,14 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server = "serveramd") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/facets/run.py b/cpp/test/Ice/facets/run.py index 099ce110107..db68ff30b9a 100755 --- a/cpp/test/Ice/facets/run.py +++ b/cpp/test/Ice/facets/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/faultTolerance/run.py b/cpp/test/Ice/faultTolerance/run.py index d1473a0250a..2dce603e0a8 100755 --- a/cpp/test/Ice/faultTolerance/run.py +++ b/cpp/test/Ice/faultTolerance/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil server = os.path.join(os.getcwd(), "server") client = os.path.join(os.getcwd(), "client") @@ -28,20 +28,21 @@ base = 12340 serverProc = [] for i in range(0, num): - print "starting server #%d..." % (i + 1), + sys.stdout.write("starting server #%d... " % (i + 1)) + sys.stdout.flush() serverProc.append(TestUtil.startServer(server, "%d" % (base + i))) - print "ok" + print("ok") ports = "" for i in range(0, num): ports = "%s %d" % (ports, base + i) -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient(client, ports, startReader = False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() for p in serverProc: p.waitTestSuccess() - diff --git a/cpp/test/Ice/gc/run.py b/cpp/test/Ice/gc/run.py index 51dea83141e..dcf09c04d79 100755 --- a/cpp/test/Ice/gc/run.py +++ b/cpp/test/Ice/gc/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") @@ -27,4 +27,3 @@ seedfile = os.path.join(os.getcwd(), "seed") TestUtil.simpleTest(client, '"%s"' % seedfile) os.remove(seedfile) - diff --git a/cpp/test/Ice/hold/run.py b/cpp/test/Ice/hold/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/hold/run.py +++ b/cpp/test/Ice/hold/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/info/run.py b/cpp/test/Ice/info/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/info/run.py +++ b/cpp/test/Ice/info/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/inheritance/run.py b/cpp/test/Ice/inheritance/run.py index 099ce110107..db68ff30b9a 100755 --- a/cpp/test/Ice/inheritance/run.py +++ b/cpp/test/Ice/inheritance/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/interceptor/run.py b/cpp/test/Ice/interceptor/run.py index 1be74428998..384e0ed4805 100755 --- a/cpp/test/Ice/interceptor/run.py +++ b/cpp/test/Ice/interceptor/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client, " --Ice.Warn.Dispatch=0") - diff --git a/cpp/test/Ice/invoke/run.py b/cpp/test/Ice/invoke/run.py index 719a5ffbd39..361d84543dc 100755 --- a/cpp/test/Ice/invoke/run.py +++ b/cpp/test/Ice/invoke/run.py @@ -16,16 +16,15 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with Blobject server." +print("tests with Blobject server.") TestUtil.clientServerTest() -print "tests with BlobjectArray server." +print("tests with BlobjectArray server.") TestUtil.clientServerTest(additionalServerOptions = "--array") -print "tests with BlobjectAsync server." +print("tests with BlobjectAsync server.") TestUtil.clientServerTest(additionalServerOptions = "--async") -print "tests with BlobjectAsyncArray server." +print("tests with BlobjectAsyncArray server.") TestUtil.clientServerTest(additionalServerOptions = "--array --async") - diff --git a/cpp/test/Ice/location/run.py b/cpp/test/Ice/location/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/location/run.py +++ b/cpp/test/Ice/location/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/objects/run.py b/cpp/test/Ice/objects/run.py index 099ce110107..db68ff30b9a 100755 --- a/cpp/test/Ice/objects/run.py +++ b/cpp/test/Ice/objects/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/operations/run.py b/cpp/test/Ice/operations/run.py index 17b74635d79..698206c03ca 100755 --- a/cpp/test/Ice/operations/run.py +++ b/cpp/test/Ice/operations/run.py @@ -16,14 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0") -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0", server = "serveramd") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/properties/run.py b/cpp/test/Ice/properties/run.py index 18f78f00db1..e0193967f47 100755 --- a/cpp/test/Ice/properties/run.py +++ b/cpp/test/Ice/properties/run.py @@ -17,25 +17,34 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") # # Write config # -configPath = u"./config/ä¸å›½_client.config" - -TestUtil.createConfig(configPath, - ["# Automatically generated by Ice test driver.", - "Ice.Trace.Protocol=1", - "Ice.Trace.Network=1", - "Ice.ProgramName=PropertiesClient", - "Config.Path=./config/ä¸å›½_client.config"]) +if sys.version_info[0] == 2: + configPath = "./config/\xe4\xb8\xad\xe5\x9b\xbd_client.config".decode("utf-8") + TestUtil.createConfig(configPath, + ["# Automatically generated by Ice test driver.", + "Ice.Trace.Protocol=1", + "Ice.Trace.Network=1", + "Ice.ProgramName=PropertiesClient", + "Config.Path=./config/ä¸å›½_client.config"]) +else: + configPath = "./config/\u4e2d\u56fd_client.config" + TestUtil.createConfig(configPath, + ["# Automatically generated by Ice test driver.", + "Ice.Trace.Protocol=1", + "Ice.Trace.Network=1", + "Ice.ProgramName=PropertiesClient", + "Config.Path=" + configPath], + "utf-8") TestUtil.simpleTest(client) if os.path.exists(configPath): - os.remove(configPath)
\ No newline at end of file + os.remove(configPath) diff --git a/cpp/test/Ice/proxy/run.py b/cpp/test/Ice/proxy/run.py index 43526feb98b..f1fb492a715 100755 --- a/cpp/test/Ice/proxy/run.py +++ b/cpp/test/Ice/proxy/run.py @@ -16,14 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server = "serveramd") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/retry/run.py b/cpp/test/Ice/retry/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/retry/run.py +++ b/cpp/test/Ice/retry/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/servantLocator/run.py b/cpp/test/Ice/servantLocator/run.py index 43526feb98b..f1fb492a715 100755 --- a/cpp/test/Ice/servantLocator/run.py +++ b/cpp/test/Ice/servantLocator/run.py @@ -16,14 +16,13 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server = "serveramd") -print "tests with collocated server." +print("tests with collocated server.") TestUtil.collocatedTest() - diff --git a/cpp/test/Ice/slicing/exceptions/run.py b/cpp/test/Ice/slicing/exceptions/run.py index 7056fe381ec..0dc8f723956 100755 --- a/cpp/test/Ice/slicing/exceptions/run.py +++ b/cpp/test/Ice/slicing/exceptions/run.py @@ -16,12 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server = "serveramd") - diff --git a/cpp/test/Ice/slicing/objects/run.py b/cpp/test/Ice/slicing/objects/run.py index a3051e1fc42..c5200040d14 100755 --- a/cpp/test/Ice/slicing/objects/run.py +++ b/cpp/test/Ice/slicing/objects/run.py @@ -16,12 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests with regular server." +print("tests with regular server.") TestUtil.clientServerTest() -print "tests with AMD server." +print("tests with AMD server.") TestUtil.clientServerTest(server = "serveramd") - diff --git a/cpp/test/Ice/stream/run.py b/cpp/test/Ice/stream/run.py index 3c4472ca289..86e9aba519e 100755 --- a/cpp/test/Ice/stream/run.py +++ b/cpp/test/Ice/stream/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/Ice/stringConverter/run.py b/cpp/test/Ice/stringConverter/run.py index c864d65fafb..247405f3610 100755 --- a/cpp/test/Ice/stringConverter/run.py +++ b/cpp/test/Ice/stringConverter/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/Ice/threadPoolPriority/run.py b/cpp/test/Ice/threadPoolPriority/run.py index 26f66ec7fac..cdf273409f3 100755 --- a/cpp/test/Ice/threadPoolPriority/run.py +++ b/cpp/test/Ice/threadPoolPriority/run.py @@ -16,12 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "tests default server thread pool." +print("tests default server thread pool.") TestUtil.clientServerTest() -print "tests custom server thread pool." +print("tests custom server thread pool.") TestUtil.clientServerTest(server = "servercustom") - diff --git a/cpp/test/Ice/timeout/run.py b/cpp/test/Ice/timeout/run.py index 32ea526c3b4..2265a40ca12 100755 --- a/cpp/test/Ice/timeout/run.py +++ b/cpp/test/Ice/timeout/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest() - diff --git a/cpp/test/Ice/udp/run.py b/cpp/test/Ice/udp/run.py index edb57a0f46c..012688ce120 100755 --- a/cpp/test/Ice/udp/run.py +++ b/cpp/test/Ice/udp/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil # # COMPILERFIX: The server fails to start on Solaris when IPv6 is @@ -26,7 +26,7 @@ from scripts import * # linked-local configured link. # if TestUtil.isSolaris() and TestUtil.ipv6: - print "test not supported on Solaris with IPv6" + print("test not supported on Solaris with IPv6") sys.exit(0) server = os.path.join(os.getcwd(), "server") @@ -36,16 +36,17 @@ num = 5 serverProc = [] for i in range(0, num): - print "starting server #%d..." % (i + 1), + sys.stdout.write("starting server #%d... " % (i + 1)) + sys.stdout.flush() serverProc.append(TestUtil.startServer(server, "%d" % i , adapter="McastTestAdapter")) - print "ok" + print("ok") -print "starting client...", +sys.stdout.write("starting client... ") +sys.stdout.flush() clientProc = TestUtil.startClient(client, "%d" % num, startReader = False) -print "ok" +print("ok") clientProc.startReader() clientProc.waitTestSuccess() for p in serverProc: p.waitTestSuccess() - diff --git a/cpp/test/IceBox/configuration/run.py b/cpp/test/IceBox/configuration/run.py index 1c9c186b581..1b006c54318 100755 --- a/cpp/test/IceBox/configuration/run.py +++ b/cpp/test/IceBox/configuration/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil icebox = TestUtil.getIceBox() @@ -27,4 +27,3 @@ config2 = os.path.join(os.getcwd(), "config.icebox2") TestUtil.clientServerTest(additionalServerOptions= '--Ice.Config="%s"' % config, server = icebox) TestUtil.clientServerTest(additionalServerOptions= '--Ice.Config="%s"' % config2, server = icebox) - diff --git a/cpp/test/IceGrid/activation/run.py b/cpp/test/IceGrid/activation/run.py index 9baa8b2f02e..c3bcd3f1405 100755 --- a/cpp/test/IceGrid/activation/run.py +++ b/cpp/test/IceGrid/activation/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin IceGridAdmin.iceGridTest("application.xml", "", "properties-override='%s'" % IceGridAdmin.iceGridNodePropertiesOverride()) - diff --git a/cpp/test/IceGrid/admin/run.py b/cpp/test/IceGrid/admin/run.py index 67d30e16921..835aa346838 100755 --- a/cpp/test/IceGrid/admin/run.py +++ b/cpp/test/IceGrid/admin/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(path[0]) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin if not TestUtil.isWin32() and os.getuid() == 0: - print - print "*** can't run test as root ***" - print + sys.stdout.write("\n") + sys.stdout.write("*** can't run test as root ***\n") + sys.stdout.write("\n") sys.exit(0) testdir = os.getcwd(); @@ -37,7 +37,7 @@ if TestUtil.appverifier: registryProcs = IceGridAdmin.startIceGridRegistry(testdir) nodeProc = IceGridAdmin.startIceGridNode(testdir) -print "starting glacier2...", +sys.stdout.write("starting glacier2... ") sys.stdout.flush() args = ' --Glacier2.SessionTimeout=5' + \ @@ -50,9 +50,9 @@ args = ' --Glacier2.SessionTimeout=5' + \ ' --Ice.Default.Locator="IceGrid/Locator:default -p 12010"' + \ ' --IceSSL.VerifyPeer=1' routerProc = TestUtil.startServer(router, args, count=2) -print "ok" +print("ok") -print "testing login with username/password...", +sys.stdout.write("testing login with username/password... ") sys.stdout.flush() # Direct registry connection with username/password @@ -77,11 +77,11 @@ admin.sendline("server list") admin.expect('>>> ') admin.sendline('exit') admin.waitTestSuccess(timeout=120) -print "ok" +print("ok") if TestUtil.protocol == "ssl": - print "testing login with ssl...", + sys.stdout.write("testing login with ssl... ") sys.stdout.flush() # Direct registry connection with SSL @@ -103,9 +103,9 @@ if TestUtil.protocol == "ssl": admin.sendline('exit') admin.waitTestSuccess(timeout=120) - print "ok" + print("ok") -print "testing commands...", +sys.stdout.write("testing commands... ") sys.stdout.flush() icegridadmin = TestUtil.getIceGridAdmin() args = ' --Ice.Default.Locator="IceGrid/Locator:default -p 12010"' + \ @@ -195,9 +195,9 @@ admin.expect('node is up') admin.expect('>>> ') admin.sendline('exit') admin.waitTestSuccess(timeout=120) -print "ok" +print("ok") -# print "testing icegridadmin...", +# sys.stdout.write("testing icegridadmin... ") # sys.stdout.flush() # admin = Util.spawn('icegridadmin --Ice.Config=config.admin --Ice.Default.Router="DemoGlacier2/router:ssl -p 4064"') @@ -224,7 +224,7 @@ print "ok" # admin.sendline('exit') # admin.waitTestSuccess(timeout=120) -# print "ok" +# print("ok") # print "completing shutdown...", # sys.stdout.flush() @@ -243,11 +243,11 @@ print "ok" # admin.sendline('exit') # admin.waitTestSuccess(timeout=120) -print "stopping glacier2...", +sys.stdout.write("stopping glacier2... ") sys.stdout.flush() routerProc.kill(signal.SIGINT) routerProc.waitTestSuccess() -print "ok" +print("ok") IceGridAdmin.iceGridAdmin("node shutdown localnode") IceGridAdmin.shutdownIceGridRegistry(registryProcs) @@ -255,4 +255,3 @@ nodeProc.waitTestSuccess() if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets) - diff --git a/cpp/test/IceGrid/allocation/run.py b/cpp/test/IceGrid/allocation/run.py index f44b04e16f5..9cddd6c3179 100755 --- a/cpp/test/IceGrid/allocation/run.py +++ b/cpp/test/IceGrid/allocation/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin IceGridAdmin.iceGridTest("application.xml") - diff --git a/cpp/test/IceGrid/deployer/run.py b/cpp/test/IceGrid/deployer/run.py index 20ca3c73a22..6f66f393364 100755 --- a/cpp/test/IceGrid/deployer/run.py +++ b/cpp/test/IceGrid/deployer/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin os.environ["MY_FOO"] = "12" @@ -27,4 +27,3 @@ IceGridAdmin.iceGridTest("application.xml", '--TestDir="%s"' % os.getcwd(), "ice # Tests with targets IceGridAdmin.iceGridTest("application.xml", '-t --TestDir="%s"' % os.getcwd(), "icebox.exe='%s' moreservers moreservices moreproperties" % TestUtil.getIceBox()) - diff --git a/cpp/test/IceGrid/distribution/run.py b/cpp/test/IceGrid/distribution/run.py index 8c9f3bcab43..bf345146953 100755 --- a/cpp/test/IceGrid/distribution/run.py +++ b/cpp/test/IceGrid/distribution/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin def icepatch2Calc(datadir, dirname): icePatch2Calc = "" @@ -43,7 +43,8 @@ files = [ ] -print "creating IcePatch2 data directory...", +sys.stdout.write("creating IcePatch2 data directory... ") +sys.stdout.flush() if not os.path.exists(datadir): os.mkdir(datadir) else: @@ -59,7 +60,7 @@ for [file, content] in files: icepatch2Calc(datadir, "original") icepatch2Calc(datadir, "updated") -print "ok" +print("ok") IceGridAdmin.iceGridTest("application.xml") diff --git a/cpp/test/IceGrid/fileLock/run.py b/cpp/test/IceGrid/fileLock/run.py index 8068eb87cff..41f6b82ee41 100755 --- a/cpp/test/IceGrid/fileLock/run.py +++ b/cpp/test/IceGrid/fileLock/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin testdir = os.getcwd(); @@ -52,11 +52,10 @@ def runIceGridRegistry(): registryProcs = IceGridAdmin.startIceGridRegistry(testdir) -print "testing IceGrid file lock...", +sys.stdout.write("testing IceGrid file lock... ") iceGrid = runIceGridRegistry() iceGrid.expect(".*IceUtil::FileLockedException.*") iceGrid.wait() -print "ok" +print("ok") IceGridAdmin.shutdownIceGridRegistry(registryProcs) - diff --git a/cpp/test/IceGrid/replicaGroup/run.py b/cpp/test/IceGrid/replicaGroup/run.py index 4bd32ee230f..a3079355940 100755 --- a/cpp/test/IceGrid/replicaGroup/run.py +++ b/cpp/test/IceGrid/replicaGroup/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin IceGridAdmin.iceGridTest("application.xml", "--Ice.RetryIntervals=\"0 50 100 250\"", "icebox.exe='%s'" % TestUtil.getIceBox()) - diff --git a/cpp/test/IceGrid/replication/run.py b/cpp/test/IceGrid/replication/run.py index c1ff43bf060..cc61946c6b2 100755 --- a/cpp/test/IceGrid/replication/run.py +++ b/cpp/test/IceGrid/replication/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin TestUtil.addLdPath(os.getcwd()) if TestUtil.sqlType != None and TestUtil.sqlType != "QSQLITE": - print "*** This test only supports Freeze or SQLite databases" + print("*** This test only supports Freeze or SQLite databases") sys.exit(0) variables = "properties-override='%s'" % IceGridAdmin.iceGridNodePropertiesOverride() diff --git a/cpp/test/IceGrid/session/run.py b/cpp/test/IceGrid/session/run.py index 2f9e95a01d4..4e20e9f655f 100755 --- a/cpp/test/IceGrid/session/run.py +++ b/cpp/test/IceGrid/session/run.py @@ -16,14 +16,14 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin if not TestUtil.isWin32() and os.getuid() == 0: - print - print "*** can't run test as root ***" - print + sys.stdout.write("\n") + sys.stdout.write("*** can't run test as root ***\n") + sys.stdout.write("\n") sys.exit(0) name = os.path.join("IceGrid", "session") @@ -34,9 +34,9 @@ if not os.path.exists(node1Dir): else: IceGridAdmin.cleanDbDir(node1Dir) -print "starting admin permissions verifier...", +sys.stdout.write("starting admin permissions verifier... ") verifierProc = TestUtil.startServer(os.path.join(os.getcwd(), "verifier"), config=TestUtil.DriverConfig("server")) -print "ok" +print("ok") IceGridAdmin.registryOptions += \ r' --IceGrid.Registry.DynamicRegistration' + \ @@ -51,4 +51,3 @@ IceGridAdmin.iceGridTest("application.xml", 'properties-override=\'%s\'' % IceGridAdmin.iceGridNodePropertiesOverride()) verifierProc.waitTestSuccess() - diff --git a/cpp/test/IceGrid/simple/run.py b/cpp/test/IceGrid/simple/run.py index 568bbe5fa53..c0e31578fda 100755 --- a/cpp/test/IceGrid/simple/run.py +++ b/cpp/test/IceGrid/simple/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin # # Test client/server without on demand activation. @@ -29,4 +29,3 @@ IceGridAdmin.iceGridClientServerTest("", "--TestAdapter.Endpoints=default --Test # Test client/server with on demand activation. # IceGridAdmin.iceGridTest("simple_server.xml", "--with-deploy") - diff --git a/cpp/test/IceGrid/update/run.py b/cpp/test/IceGrid/update/run.py index 8435dad3012..093afe59055 100755 --- a/cpp/test/IceGrid/update/run.py +++ b/cpp/test/IceGrid/update/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceGridAdmin name = os.path.join("IceGrid", "update") @@ -39,4 +39,3 @@ nodeOverrideOptions = '--IceBinDir="%s" --TestDir="%s" ' % (TestUtil.getCppBinDi IceGridAdmin.iceGridNodePropertiesOverride() IceGridAdmin.iceGridTest("", nodeOverrideOptions) - diff --git a/cpp/test/IceSSL/configuration/run.py b/cpp/test/IceSSL/configuration/run.py index 5235efd9276..8942615d408 100755 --- a/cpp/test/IceSSL/configuration/run.py +++ b/cpp/test/IceSSL/configuration/run.py @@ -16,9 +16,8 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil TestUtil.clientServerTest(additionalClientOptions = '"%s"' % os.getcwd()) - diff --git a/cpp/test/IceStorm/federation/run.py b/cpp/test/IceStorm/federation/run.py index 62b48b15fa6..bf0d91e32b5 100755 --- a/cpp/test/IceStorm/federation/run.py +++ b/cpp/test/IceStorm/federation/run.py @@ -17,9 +17,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil publisher = os.path.join(os.getcwd(), "publisher") subscriber = os.path.join(os.getcwd(), "subscriber") @@ -53,33 +53,34 @@ def runtest(type, **args): icestorm.start() - print "setting up topics...", + sys.stdout.write("setting up topics... ") sys.stdout.flush() icestorm.admin("create fed1 fed2 fed3; link fed1 fed2 10; link fed2 fed3 5") - print "ok" + print("ok") # # Test oneway subscribers. # - print "testing oneway subscribers...", + sys.stdout.write("testing oneway subscribers... ") sys.stdout.flush() doTest(icestorm, 0) - print "ok" + print("ok") # # Test batch oneway subscribers. # - print "testing batch subscribers...", + sys.stdout.write("testing batch subscribers... ") sys.stdout.flush() doTest(icestorm, 1) - print "ok" + print("ok") # # Destroy the topics. # - print "destroying topics...", + sys.stdout.write("destroying topics... ") + sys.stdout.flush() icestorm.admin("destroy fed1 fed2 fed3") - print "ok" + print("ok") # # Shutdown icestorm. diff --git a/cpp/test/IceStorm/federation2/run.py b/cpp/test/IceStorm/federation2/run.py index d9d89192a5a..0981cd3a81b 100755 --- a/cpp/test/IceStorm/federation2/run.py +++ b/cpp/test/IceStorm/federation2/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil, Expect iceStormAdmin = "" if TestUtil.isBCC2010(): @@ -81,26 +81,26 @@ def runtest(type, **args): adminIceStormReference = ' --IceStormAdmin.TopicManager.Proxy="%s" --IceStormAdmin.TopicManager.Proxy2="%s"' % ( icestorm1.proxy(), icestorm2.proxy()) - print "setting up the topics...", + sys.stdout.write("setting up the topics... ") sys.stdout.flush() admin(adminIceStormReference, "create TestIceStorm1/fed1 TestIceStorm2/fed1; link TestIceStorm1/fed1 TestIceStorm2/fed1") - print "ok" + print("ok") # # Test oneway subscribers. # - print "testing federation with oneway subscribers...", + sys.stdout.write("testing federation with oneway subscribers... ") sys.stdout.flush() doTest(icestorm1, icestorm2, 0) - print "ok" + print("ok") # # Test batch oneway subscribers. # - print "testing federation with batch subscribers...", + sys.stdout.write("testing federation with batch subscribers... ") sys.stdout.flush() doTest(icestorm1, icestorm2, 1) - print "ok" + print("ok") # # Test #2: @@ -108,7 +108,7 @@ def runtest(type, **args): # Stop and restart the service and repeat the test. This ensures that # the database is correct. # - print "restarting services to ensure that the database content is preserved...", + sys.stdout.write("restarting services to ensure that the database content is preserved... ") sys.stdout.flush() # @@ -119,23 +119,23 @@ def runtest(type, **args): icestorm1.start(echo=False) icestorm2.start(echo=False) - print "ok" + print("ok") # # Test oneway subscribers. # - print "retesting federation with oneway subscribers... ", + sys.stdout.write("retesting federation with oneway subscribers... ") sys.stdout.flush() doTest(icestorm1, icestorm2, 0) - print "ok" + print("ok") # # Test batch oneway subscribers. # - print "retesting federation with batch subscribers... ", + sys.stdout.write("retesting federation with batch subscribers... ") sys.stdout.flush() doTest(icestorm1, icestorm2, 1) - print "ok" + print("ok") # # Shutdown icestorm. @@ -151,31 +151,31 @@ def runtest(type, **args): # Ensure they are received by the linked server. # if type != "replicated": - print "restarting only one IceStorm server...", + sys.stdout.write("restarting only one IceStorm server... ") sys.stdout.flush() proc = icestorm1.start(echo=False) #proc.expect("topic.fed1.*subscriber offline") #proc.expect("connection refused") - print "ok" + print("ok") # # Test oneway subscribers. # - print "testing that the federation link reports an error...", + sys.stdout.write("testing that the federation link reports an error... ") sys.stdout.flush() doTest(icestorm1, icestorm2, 0, icestorm1.reference()) - # Give some time for the output to be sent. - time.sleep(2) + # Give some time for the output to be sent. + time.sleep(2) proc.expect("topic.fed1.*subscriber offline") - print "ok" + print("ok") - print "starting downstream icestorm server...", + sys.stdout.write("starting downstream icestorm server... ") sys.stdout.flush() icestorm2.start(echo=False) - print "ok" + print("ok") # # Need to sleep for at least the discard interval. @@ -185,10 +185,10 @@ def runtest(type, **args): # # Test oneway subscribers. # - print "testing link is reestablished...", + sys.stdout.write("testing link is reestablished... ") sys.stdout.flush() doTest(icestorm1, icestorm2, 0) - print "ok" + print("ok") try: proc.expect("topic.fed1.*subscriber offline") @@ -205,26 +205,27 @@ def runtest(type, **args): # Trash the TestIceStorm2 database. Then restart the servers and # verify that the link is removed. # - print "destroying the downstream IceStorm service database...", + sys.stdout.write("destroying the downstream IceStorm service database... ") sys.stdout.flush() icestorm2.clean() - print "ok" + print("ok") - print "restarting IceStorm servers...", + sys.stdout.write("restarting IceStorm servers... ") sys.stdout.flush() icestorm1.start(echo = False) icestorm2.start(echo = False) - print "ok" + print("ok") - print "checking link still exists...", + sys.stdout.write("checking link still exists... ") + sys.stdout.flush() line = admin(adminIceStormReference, "links TestIceStorm1") if not re.compile("fed1 with cost 0").search(line): - print line + print(line) sys.exit(1) - print "ok" + print("ok") - print "publishing some events...", + sys.stdout.write("publishing some events... ") sys.stdout.flush() # The publisher must be run twice because all the events can be # sent out in one batch to the linked subscriber which means that @@ -232,13 +233,13 @@ def runtest(type, **args): # sent. Furthermore, with a replicated IceStorm both sets of # events must be set to the same replica. runPublisher(icestorm1, opt = " --count 2") - print "ok" + print("ok") # Give the unsubscription time to propagate. time.sleep(1) # Verify that the link has disappeared. - print "verifying that the link has been destroyed...", + sys.stdout.write("verifying that the link has been destroyed... ") sys.stdout.flush() line = admin(adminIceStormReference, "links TestIceStorm1") nRetry = 5 @@ -247,25 +248,26 @@ def runtest(type, **args): time.sleep(1) # Give more time for unsubscription to propagate. nRetry -= 1 if len(line) > 0: - print line + print(line) sys.exit(1) - print "ok" + print("ok") # # Destroy the remaining topic. # - print "destroying topics...", + sys.stdout.write("destroying topics... ") + sys.stdout.flush() admin(adminIceStormReference, "destroy TestIceStorm1/fed1") - print "ok" + print("ok") # # Shutdown icestorm. # - print "shutting down icestorm services...", + sys.stdout.write("shutting down icestorm services... ") sys.stdout.flush() icestorm1.stop() icestorm2.stop() - print "ok" + print("ok") runtest("persistent") runtest("replicated", replicatedPublisher = False) diff --git a/cpp/test/IceStorm/rep1/run.py b/cpp/test/IceStorm/rep1/run.py index b1f62dc216f..358090cdf82 100755 --- a/cpp/test/IceStorm/rep1/run.py +++ b/cpp/test/IceStorm/rep1/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil publisher = os.path.join(os.getcwd(), "publisher") subscriber = os.path.join(os.getcwd(), "subscriber") @@ -77,23 +77,23 @@ icestorm = IceStormUtil.init(TestUtil.toplevel, os.getcwd(), "replicated", repli ' --IceStorm.Election.ResponseTimeout=2') icestorm.start() -print "testing topic creation across replicas...", +sys.stdout.write("testing topic creation across replicas... ") sys.stdout.flush() icestorm.admin("create single") for replica in range(0, 3): icestorm.adminForReplica(replica, "create single", "error: topic `single' exists") -print "ok" +print("ok") -print "testing topic destruction across replicas...", +sys.stdout.write("testing topic destruction across replicas... ") sys.stdout.flush() icestorm.admin("destroy single") for replica in range(0, 3): icestorm.adminForReplica(replica, "destroy single", "error: couldn't find topic `single'") -print "ok" +print("ok") -print "testing topic creation without replica...", +sys.stdout.write("testing topic creation without replica... ") sys.stdout.flush() icestorm.stopReplica(0) @@ -107,11 +107,11 @@ icestorm.adminForReplica(0, "create single", "ConnectionRefused") icestorm.startReplica(0, echo=False) icestorm.adminForReplica(0, "create single", "error: topic `single' exists") -print "ok" +print("ok") icestorm.admin("destroy single") -print "testing topic creation without master...", +sys.stdout.write("testing topic creation without master... ") sys.stdout.flush() icestorm.stopReplica(2) @@ -125,11 +125,11 @@ icestorm.adminForReplica(2, "create single", "ConnectionRefused") icestorm.startReplica(2, echo=False) icestorm.adminForReplica(2, "create single", "error: topic `single' exists") -print "ok" +print("ok") # All replicas are running -print "testing topic destruction without replica...", +sys.stdout.write("testing topic destruction without replica... ") sys.stdout.flush() icestorm.stopReplica(0) @@ -143,9 +143,9 @@ icestorm.adminForReplica(0, "destroy single", "ConnectionRefused") icestorm.startReplica(0, echo=False) icestorm.adminForReplica(0, "destroy single", "error: couldn't find topic `single'") -print "ok" +print("ok") -print "testing topic destruction without master...", +sys.stdout.write("testing topic destruction without master... ") sys.stdout.flush() icestorm.admin("create single") @@ -161,29 +161,29 @@ icestorm.adminForReplica(2, "destroy single", "ConnectionRefused") icestorm.startReplica(2, echo=False) icestorm.adminForReplica(2, "destroy single", "error: couldn't find topic `single'") -print "ok" +print("ok") # Now test subscription/unsubscription on all replicas. icestorm.admin("create single") -print "testing subscription across replicas...", +sys.stdout.write("testing subscription across replicas... ") sys.stdout.flush() runsub2() for replica in range(0, 3): runsub2(replica, "IceStorm::AlreadySubscribed") -print "ok" +print("ok") -print "testing unsubscription across replicas...", +sys.stdout.write("testing unsubscription across replicas... ") sys.stdout.flush() rununsub2() for replica in range(0, 3): rununsub2(replica) -print "ok" +print("ok") -print "testing subscription without master...", +sys.stdout.write("testing subscription without master... ") sys.stdout.flush() icestorm.stopReplica(2) @@ -197,9 +197,9 @@ runsub2(2, "ConnectionRefused") icestorm.startReplica(2, echo=False) runsub2(2, "IceStorm::AlreadySubscribed") -print "ok" +print("ok") -print "testing unsubscription without master...", +sys.stdout.write("testing unsubscription without master... ") sys.stdout.flush() icestorm.stopReplica(2) @@ -213,9 +213,9 @@ rununsub2(2, "ConnectionRefused") icestorm.startReplica(2, echo=False) rununsub2(2) -print "ok" +print("ok") -print "testing subscription without replica...", +sys.stdout.write("testing subscription without replica... ") sys.stdout.flush() icestorm.stopReplica(0) @@ -229,9 +229,9 @@ runsub2(0, "ConnectionRefused") icestorm.startReplica(0, echo=False) runsub2(0, "IceStorm::AlreadySubscribed") -print "ok" +print("ok") -print "testing unsubscription without replica...", +sys.stdout.write("testing unsubscription without replica... ") sys.stdout.flush() icestorm.stopReplica(0) @@ -245,48 +245,48 @@ rununsub2(0, "ConnectionRefused") icestorm.startReplica(0, echo=False) rununsub2(0) -print "ok" +print("ok") # All replicas are running -print "running twoway subscription test...", +sys.stdout.write("running twoway subscription test... ") sys.stdout.flush() runtest("twoway", icestorm.reference()) -print "ok" +print("ok") -print "running ordered subscription test...", +sys.stdout.write("running ordered subscription test... ") sys.stdout.flush() runtest("ordered", icestorm.reference()) -print "ok" +print("ok") icestorm.stopReplica(2) -print "running twoway, ordered subscription test without master...", +sys.stdout.write("running twoway, ordered subscription test without master... ") sys.stdout.flush() runtest("twoway", icestorm.reference()) runtest("ordered", icestorm.reference()) -print "ok" +print("ok") icestorm.startReplica(2, echo = False) icestorm.stopReplica(0) -print "running twoway, ordered subscription test without replica...", +sys.stdout.write("running twoway, ordered subscription test without replica... ") sys.stdout.flush() runtest("twoway", icestorm.reference()) runtest("ordered", icestorm.reference()) -print "ok" +print("ok") icestorm.startReplica(0, echo = False) -print "running cycle publishing test...", +sys.stdout.write("running cycle publishing test... ") sys.stdout.flush() runtest("twoway", icestorm.reference(), pubopt=" --cycle") -print "ok" +print("ok") -print "stopping replicas...", +sys.stdout.write("stopping replicas... ") sys.stdout.flush() icestorm.stop() -print "ok" +print("ok") if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets, cwd = os.getcwd()) diff --git a/cpp/test/IceStorm/repgrid/run.py b/cpp/test/IceStorm/repgrid/run.py index 834e9ff9783..1fb8a64dc8c 100755 --- a/cpp/test/IceStorm/repgrid/run.py +++ b/cpp/test/IceStorm/repgrid/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil, IceGridAdmin targets = [] if TestUtil.appverifier: diff --git a/cpp/test/IceStorm/repstress/run.py b/cpp/test/IceStorm/repstress/run.py index 67096c750c6..08aa574ea6b 100755 --- a/cpp/test/IceStorm/repstress/run.py +++ b/cpp/test/IceStorm/repstress/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil publisher = os.path.join(os.getcwd(), "publisher") subscriber = os.path.join(os.getcwd(), "subscriber") @@ -40,86 +40,86 @@ icestorm = IceStormUtil.init(TestUtil.toplevel, os.getcwd(), "replicated", repli ' --IceStorm.Election.ResponseTimeout=2') icestorm.start() -print "creating topic...", +sys.stdout.write("creating topic... ") sys.stdout.flush() icestorm.admin("create single") -print "ok" +print("ok") -print "running subscriber...", +sys.stdout.write("running subscriber... ") sys.stdout.flush() subscriberProc = TestUtil.startServer(subscriber, ' --Ice.ServerIdleTime=0 ' + icestorm.reference(), echo = False) subscriberProc.expect("([^\n]+)\n") subControl = subscriberProc.match.group(1) -print "ok" +print("ok") -print "running publisher...", +sys.stdout.write("running publisher... ") sys.stdout.flush() publisherProc = TestUtil.startServer(publisher, ' --Ice.ServerIdleTime=0 ' + icestorm.reference(), echo = False) publisherProc.expect("([^\n]+)\n") pubControl = publisherProc.match.group(1) -print "ok" +print("ok") time.sleep(2) for i in range(0, 3): # 0, 1 - print "stopping replica 2 (0, 1 running)...", + sys.stdout.write("stopping replica 2 (0, 1 running)... ") sys.stdout.flush() icestorm.stopReplica(2) - print "ok" + print("ok") time.sleep(2) # 1, 2 - print "starting 2, stopping 0 (1, 2 running)...", + sys.stdout.write("starting 2, stopping 0 (1, 2 running)... ") sys.stdout.flush() icestorm.startReplica(2, echo=False) icestorm.stopReplica(0) - print "ok" + print("ok") # This waits for the replication to startup #icestorm.admin("list") time.sleep(2) # 0, 2 - print "starting 0, stopping 1 (0, 2 running)...", + sys.stdout.write("starting 0, stopping 1 (0, 2 running)... ") sys.stdout.flush() icestorm.startReplica(0, echo=False) icestorm.stopReplica(1) - print "ok" + print("ok") # This waits for the replication to startup #icestorm.admin("list") time.sleep(2) - print "starting 1 (all running)...", + sys.stdout.write("starting 1 (all running)... ") sys.stdout.flush() icestorm.startReplica(1, echo=False) - print "ok" + print("ok") # This waits for the replication to startup #icestorm.admin("list") time.sleep(2) -print "stopping publisher...", +sys.stdout.write("stopping publisher... ") sys.stdout.flush() runcontrol(pubControl) publisherProc.expect("([^\n]+)\n") publisherCount = publisherProc.match.group(1) publisherProc.waitTestSuccess() -print "ok" +print("ok") -print "stopping replicas...", +sys.stdout.write("stopping replicas... ") sys.stdout.flush() icestorm.stop() -print "ok" +print("ok") -print "stopping subscriber...", +sys.stdout.write("stopping subscriber... ") sys.stdout.flush() runcontrol(subControl) subscriberProc.expect("([^\n]+)\n") subscriberCount = subscriberProc.match.group(1) subscriberProc.waitTestSuccess() -print "ok" +print("ok") -print "publisher published %s events, subscriber received %s events" % (publisherCount, subscriberCount) +print("publisher published %s events, subscriber received %s events" % (publisherCount, subscriberCount)) if TestUtil.appverifier: TestUtil.appVerifierAfterTestEnd(targets, cwd = os.getcwd()) diff --git a/cpp/test/IceStorm/single/run.py b/cpp/test/IceStorm/single/run.py index 27935f821e8..bfba477917e 100755 --- a/cpp/test/IceStorm/single/run.py +++ b/cpp/test/IceStorm/single/run.py @@ -17,9 +17,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil publisher = os.path.join(os.getcwd(), "publisher") subscriber = os.path.join(os.getcwd(), "subscriber") @@ -35,24 +35,24 @@ def dotest(type): icestorm.start() - print "creating topic...", + sys.stdout.write("creating topic... ") sys.stdout.flush() icestorm.admin("create single") - print "ok" + print("ok") - print "starting subscriber...", + sys.stdout.write("starting subscriber... ") sys.stdout.flush() subscriberProc = TestUtil.startServer(subscriber, icestorm.reference(), count = 5) - print "ok" + print("ok") # # Start the publisher. This should publish 10 events which eventually # causes subscriber to terminate. # - print "starting publisher...", + sys.stdout.write("starting publisher... ") sys.stdout.flush() publisherProc = TestUtil.startClient(publisher, icestorm.reference(), startReader = False) - print "ok" + print("ok") publisherProc.startReader() subscriberProc.waitTestSuccess() @@ -61,10 +61,10 @@ def dotest(type): # # Destroy the topic. # - print "destroy topic...", + sys.stdout.write("destroy topic... ") sys.stdout.flush() icestorm.admin("destroy single") - print "ok" + print("ok") # # Shutdown icestorm. diff --git a/cpp/test/IceStorm/stress/run.py b/cpp/test/IceStorm/stress/run.py index 21a799e0667..87d6ab2541e 100755 --- a/cpp/test/IceStorm/stress/run.py +++ b/cpp/test/IceStorm/stress/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil, IceStormUtil iceStormAdmin = "" if TestUtil.isBCC2010(): @@ -57,84 +57,85 @@ def runAdmin(cmd, desc = None): global iceStormAdmin global iceStormAdminReference if desc: - print desc, + sys.stdout.write(desc + " ") sys.stdout.flush() proc = TestUtil.startClient(iceStormAdmin, adminIceStormReference + r' -e "%s"' % cmd, startReader = True) proc.waitTestSuccess() if desc: - print "ok" + print("ok") def runtest(type): # Clear the idle timeout otherwise the IceBox ThreadPool will timeout. server1 = IceStormUtil.init(TestUtil.toplevel, os.getcwd(), type, dbDir = "db", instanceName = "TestIceStorm1", - port = 12000) + port = 12000) server2 = IceStormUtil.init(TestUtil.toplevel, os.getcwd(), type, dbDir = "db2", instanceName = "TestIceStorm2", - port = 12500) + port = 12500) global adminIceStormReference adminIceStormReference = ' --IceStormAdmin.TopicManager.Proxy="%s" --IceStormAdmin.TopicManager.Proxy2="%s"' % ( server1.proxy(), server2.proxy()) - print "starting icestorm services...", + sys.stdout.write("starting icestorm services... ") sys.stdout.flush() server1.start(echo=False) server2.start(echo=False) - print "ok" + print("ok") runAdmin("create TestIceStorm1/fed1 TestIceStorm2/fed1", "setting up the topics...") - print "Sending 5000 ordered events... ", + sys.stdout.write("Sending 5000 ordered events... ") sys.stdout.flush() doTest(server1, server2, '--events 5000 --qos "reliability,ordered" ' + server1.reference(), '--events 5000') - print "ok" + print("ok") runAdmin("link TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 5000 ordered events across a link... ", + sys.stdout.write("Sending 5000 ordered events across a link... ") sys.stdout.flush() doTest(server1, server2, '--events 5000 --qos "reliability,ordered" ' + server2.reference(), '--events 5000') - print "ok" + print("ok") runAdmin("unlink TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered events... ", + sys.stdout.write("Sending 20000 unordered events... ") sys.stdout.flush() doTest(server1, server2, '--events 20000 ' + server1.reference(), '--events 20000 --oneway') - print "ok" + print("ok") runAdmin("link TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered events across a link... ", + sys.stdout.write("Sending 20000 unordered events across a link... ") sys.stdout.flush() doTest(server1, server2, '--events 20000 ' + server2.reference(), '--events 20000 --oneway') - print "ok" + print("ok") runAdmin("unlink TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered batch events... ", + sys.stdout.write("Sending 20000 unordered batch events... ") sys.stdout.flush() doTest(server1, server2, '--events 20000 --qos "reliability,batch" ' + server1.reference(), '--events 20000 --oneway') - print "ok" + print("ok") runAdmin("link TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered batch events across a link... ", + sys.stdout.write("Sending 20000 unordered batch events across a link... ") sys.stdout.flush() doTest(server1, server2, '--events 20000 --qos "reliability,batch" ' + server2.reference(), '--events 20000 --oneway') - print "ok" + print("ok") runAdmin("unlink TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered events with slow subscriber... ", + sys.stdout.write("Sending 20000 unordered events with slow subscriber... ") + sys.stdout.flush() doTest(server1, server2, ['--events 2 --slow ' + server1.reference(), '--events 20000 ' + server1.reference()], '--events 20000 --oneway') - print "ok" + print("ok") runAdmin("link TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered events with slow subscriber & link... ", + sys.stdout.write("Sending 20000 unordered events with slow subscriber & link... ") + sys.stdout.flush() doTest(server1, server2, ['--events 2 --slow' + server1.reference(), '--events 20000' + server1.reference(), '--events 2 --slow' + server2.reference(), '--events 20000' + server2.reference()], '--events 20000 --oneway') - print "ok" - + print("ok") - print "shutting down icestorm services...", + sys.stdout.write("shutting down icestorm services... ") sys.stdout.flush() server1.stop() server2.stop() - print "ok" + print("ok") - print "starting icestorm services...", + sys.stdout.write("starting icestorm services... ") sys.stdout.flush() # # The erratic tests emit lots of connection warnings so they are @@ -143,21 +144,21 @@ def runtest(type): # server1.start(echo=False, additionalOptions = ' --Ice.Warn.Connections=0') server2.start(echo=False, additionalOptions = ' --Ice.Warn.Connections=0') - print "ok" + print("ok") runAdmin("unlink TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered events with erratic subscriber... ", + sys.stdout.write("Sending 20000 unordered events with erratic subscriber... ") sys.stdout.flush() doTest(server1, server2, [ '--erratic 5 --qos "reliability,ordered" --events 20000' + server1.reference(), '--erratic 5 --events 20000' + server1.reference(), '--events 20000' + server1.reference()], '--events 20000 --oneway') - print "ok" + print("ok") runAdmin("link TestIceStorm1/fed1 TestIceStorm2/fed1") - print "Sending 20000 unordered events with erratic subscriber across a link... ", + sys.stdout.write("Sending 20000 unordered events with erratic subscriber across a link... ") sys.stdout.flush() doTest(server1, server2, [ '--events 20000' + server1.reference(), @@ -167,16 +168,16 @@ def runtest(type): '--erratic 5 --qos "reliability,ordered" --events 20000 ' + server2.reference(), '--erratic 5 --events 20000 ' + server2.reference()], '--events 20000 --oneway ') - print "ok" + print("ok") # # Shutdown icestorm. # - print "shutting down icestorm services...", + sys.stdout.write("shutting down icestorm services... ") sys.stdout.flush() server1.stop() server2.stop() - print "ok" + print("ok") runtest("persistent") runtest("replicated") diff --git a/cpp/test/IceUtil/condvar/run.py b/cpp/test/IceUtil/condvar/run.py index e82f73fb946..b04ffcce420 100755 --- a/cpp/test/IceUtil/condvar/run.py +++ b/cpp/test/IceUtil/condvar/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil workqueue = os.path.join(os.getcwd(), "workqueue") diff --git a/cpp/test/IceUtil/fileLock/run.py b/cpp/test/IceUtil/fileLock/run.py index 48760b12db2..5ed68cb4b38 100755 --- a/cpp/test/IceUtil/fileLock/run.py +++ b/cpp/test/IceUtil/fileLock/run.py @@ -16,11 +16,11 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil -print "testing process file lock...", +sys.stdout.write("testing process file lock... ") sys.stdout.flush() client = os.path.join(os.getcwd(), "client") @@ -53,4 +53,4 @@ clientExe.expect('File lock acquired.\.*') clientExe.sendline('go') clientExe.expect('File lock released.') clientExe.waitTestSuccess() -print "ok" +print("ok") diff --git a/cpp/test/IceUtil/inputUtil/run.py b/cpp/test/IceUtil/inputUtil/run.py index 1e01f6b11bf..4d6633269cd 100755 --- a/cpp/test/IceUtil/inputUtil/run.py +++ b/cpp/test/IceUtil/inputUtil/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client, os.getcwd()) - diff --git a/cpp/test/IceUtil/priority/run.py b/cpp/test/IceUtil/priority/run.py index 3fe7d3cc948..5240b248794 100755 --- a/cpp/test/IceUtil/priority/run.py +++ b/cpp/test/IceUtil/priority/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client, os.getcwd()) - diff --git a/cpp/test/IceUtil/thread/run.py b/cpp/test/IceUtil/thread/run.py index 3fe7d3cc948..5240b248794 100755 --- a/cpp/test/IceUtil/thread/run.py +++ b/cpp/test/IceUtil/thread/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client, os.getcwd()) - diff --git a/cpp/test/IceUtil/timer/run.py b/cpp/test/IceUtil/timer/run.py index 3c4472ca289..86e9aba519e 100755 --- a/cpp/test/IceUtil/timer/run.py +++ b/cpp/test/IceUtil/timer/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/IceUtil/unicode/run.py b/cpp/test/IceUtil/unicode/run.py index 0a82dd170b3..6a8bc9790bc 100755 --- a/cpp/test/IceUtil/unicode/run.py +++ b/cpp/test/IceUtil/unicode/run.py @@ -16,11 +16,10 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client, '"%s"' % os.getcwd()) - diff --git a/cpp/test/IceUtil/uuid/run.py b/cpp/test/IceUtil/uuid/run.py index 3c4472ca289..86e9aba519e 100755 --- a/cpp/test/IceUtil/uuid/run.py +++ b/cpp/test/IceUtil/uuid/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py index 0baf3c1f4b0..7a9041ed4df 100755 --- a/cpp/test/Slice/errorDetection/run.py +++ b/cpp/test/Slice/errorDetection/run.py @@ -16,9 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel os.getcwd()!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel os.getcwd()!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil slice2cpp = '"%s"' % os.path.join(TestUtil.getCppBinDir(), "slice2cpp") @@ -32,7 +32,8 @@ files.sort() for file in files: - print file + "...", + sys.stdout.write(file + "... ") + sys.stdout.flush() if file.find("Underscore") != -1: command = slice2cpp + ' --underscore -I. "%s"' % os.path.join(os.getcwd(), file) @@ -45,19 +46,23 @@ for file in files: lines1 = stderr.readlines() lines2 = open(os.path.join(os.getcwd(), regex1.sub(".err", file)), "r").readlines() if len(lines1) != len(lines2): - print "failed! " + print("failed!") sys.exit(1) regex2 = re.compile("^.*(?=" + file + ")") i = 0 while i < len(lines1): - line1 = regex2.sub("", lines1[i]).strip() - line2 = regex2.sub("", lines2[i]).strip() + if sys.version_info[0] == 2: + line1 = regex2.sub("", lines1[i]).strip() + line2 = regex2.sub("", lines2[i]).strip() + else: + line1 = regex2.sub("", lines1[i].decode("utf-8")).strip() + line2 = regex2.sub("", lines2[i]).strip() if line1 != line2: - print "failed! " + print("failed!") sys.exit(1) i = i + 1 else: - print "ok" + print("ok") sys.exit(0) diff --git a/cpp/test/Slice/keyword/run.py b/cpp/test/Slice/keyword/run.py index 3c4472ca289..86e9aba519e 100755 --- a/cpp/test/Slice/keyword/run.py +++ b/cpp/test/Slice/keyword/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - diff --git a/cpp/test/Slice/structure/run.py b/cpp/test/Slice/structure/run.py index 3c4472ca289..86e9aba519e 100755 --- a/cpp/test/Slice/structure/run.py +++ b/cpp/test/Slice/structure/run.py @@ -16,10 +16,9 @@ if len(head) > 0: path = [os.path.join(head, p) for p in path] path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] if len(path) == 0: - raise "can't find toplevel directory!" -sys.path.append(os.path.join(path[0])) -from scripts import * + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil client = os.path.join(os.getcwd(), "client") TestUtil.simpleTest(client) - |