diff --git a/icu4c/source/test/testdata/testdata.mk b/icu4c/source/test/testdata/testdata.mk index 16248b648b..499bb1a174 100644 --- a/icu4c/source/test/testdata/testdata.mk +++ b/icu4c/source/test/testdata/testdata.mk @@ -6,7 +6,7 @@ # invoke with # nmake /f makedata.mak icup= [Debug|Release] # -# 03/19/2001 weiv, schererm Created +# 03/19/2001 weiv, schererm Created .SUFFIXES : .res .txt @@ -15,7 +15,7 @@ ALL : "$(TESTDATAOUT)\testdata.dat" "$(TESTDATAOUT)\testdata.dat" : "$(TESTDATAOUT)\root.res" "$(TESTDATAOUT)\te.res" "$(TESTDATAOUT)\te_IN.res" "$(TESTDATAOUT)\testtypes.res" "$(TESTDATAOUT)\testempty.res" "$(TESTDATAOUT)\empty.res" $(TESTDATAOUT)test.dat @echo Building test data - @"$(ICUTOOLS)\pkgdata\$(CFG)\pkgdata" -v -m common -c -p testdata -O "$(PKGOPT)" -d "$(TESTDATAOUT)" -T "$(TESTDATAOUT)" -s "$(TESTDATAOUT)" << + @"$(ICUTOOLS)\pkgdata\$(CFG)\pkgdata" -v -m common -c -p testdata -O "$(PKGOPT)" -d "$(TESTDATAOUT)" -T "$(TESTDATAOUT)" -s "$(TESTDATAOUT)" << root.res te.res te_IN.res @@ -25,9 +25,11 @@ test.dat << # Inference rule for creating resource bundles +# Some test data resource bundles are known to have warnings and bad data. +# The -q option is there on purpose, so we don't see it normally. {$(TESTDATA)}.txt.res: - @echo Making Test Resource Bundle files - @"$(ICUTOOLS)\genrb\$(CFG)\genrb" -s$(TESTDATA) -d$(TESTDATAOUT) $(?F) + @echo Making Test Resource Bundle files + @"$(ICUTOOLS)\genrb\$(CFG)\genrb" -q -s$(TESTDATA) -d$(TESTDATAOUT) $(?F) $(TESTDATAOUT)test.dat : {"$(ICUTOOLS)\gentest\$(CFG)"}gentest.exe "$(ICUTOOLS)\gentest\$(CFG)\gentest" -d$(TESTDATAOUT) \ No newline at end of file diff --git a/icu4c/source/tools/genrb/error.c b/icu4c/source/tools/genrb/error.c index 321c1f9b57..604ec89f5a 100644 --- a/icu4c/source/tools/genrb/error.c +++ b/icu4c/source/tools/genrb/error.c @@ -31,14 +31,24 @@ void error(uint32_t linenumber, const char *msg, ...) va_end(va); } -void warning(uint32_t linenumber, const char *msg, ...) -{ - va_list va; +static gShowWarning = TRUE; - va_start(va, msg); - fprintf(stderr, "%s:%d: warning: ", gCurrentFileName, linenumber); - vfprintf(stderr, msg, va); - fprintf(stderr, "\n"); - va_end(va); +void setShowWarning(UBool val) +{ + gShowWarning = val; +} + +void warning(uint32_t linenumber, const char *msg, ...) +{ + if (gShowWarning) + { + va_list va; + + va_start(va, msg); + fprintf(stderr, "%s:%d: warning: ", gCurrentFileName, linenumber); + vfprintf(stderr, msg, va); + fprintf(stderr, "\n"); + va_end(va); + } } diff --git a/icu4c/source/tools/genrb/error.h b/icu4c/source/tools/genrb/error.h index dbf8c3486e..53c0238efd 100644 --- a/icu4c/source/tools/genrb/error.h +++ b/icu4c/source/tools/genrb/error.h @@ -38,4 +38,7 @@ extern const char *gCurrentFileName; void error (uint32_t linenumber, const char *msg, ...); void warning (uint32_t linenumber, const char *msg, ...); +/* Show warnings? */ +void setShowWarning(UBool val); + #endif diff --git a/icu4c/source/tools/genrb/genrb.c b/icu4c/source/tools/genrb/genrb.c index 5c4c5dc7de..5ccd4cbf02 100644 --- a/icu4c/source/tools/genrb/genrb.c +++ b/icu4c/source/tools/genrb/genrb.c @@ -54,7 +54,8 @@ enum { HELP1, HELP2, - VERBOSE, +/* VERBOSE, */ + QUIET, VERSION, SOURCEDIR, DESTDIR, @@ -65,7 +66,8 @@ enum UOption options[]={ UOPTION_HELP_H, UOPTION_HELP_QUESTION_MARK, - UOPTION_VERBOSE, +/* UOPTION_VERBOSE, */ + UOPTION_QUIET, UOPTION_VERSION, UOPTION_SOURCEDIR, UOPTION_DESTDIR, @@ -86,7 +88,7 @@ main(int argc, const char *outputDir = NULL; /* NULL = no output directory, use current */ const char *inputDir = NULL; const char *encoding = ""; - UBool verbose; +/* UBool verbose; */ int i; #ifdef XP_MAC_CONSOLE @@ -116,22 +118,27 @@ main(int argc, "Usage: %s [OPTIONS] [FILES]\n" "\treads the list of resource bundle source files and creates\n" "\tbinary version of reosurce bundles (.res files)\n" - "\tOptions:\n" - "\t\t-h, -? or --help this usage text\n" - "\t\t-V or --version prints out version number and exits\n" - "\t\t-d of --destdir destination directory, followed by the path, defaults to %s\n" - "\t\t-v or --verbose be verbose\n" - "\t\t-e or --encoding encoding of source files, leave empty for system default encoding\n" - "\t\t NOTE: ICU must be completely built to use this option\n" - "\t\t-s or --sourcedir source directory for files followed by path, defaults to %s\n" - "\t\t-i or --icudatadir directory for locating any needed intermediate data files,\n" - "\t\t followed by path, defaults to %s\n", + "Options:\n" + "\t-h, -? or --help this usage text\n" + "\t-V or --version prints out version number and exits\n" + "\t-d of --destdir destination directory, followed by the path, defaults to %s\n" +/* "\t-v or --verbose be verbose\n"*/ + "\t-q or --quiet do not display warnings\n" + "\t-e or --encoding encoding of source files, leave empty for system default encoding\n" + "\t NOTE: ICU must be completely built to use this option\n" + "\t-s or --sourcedir source directory for files followed by path, defaults to %s\n" + "\t-i or --icudatadir directory for locating any needed intermediate data files,\n" + "\t followed by path, defaults to %s\n", argv[0], u_getDataDirectory(), u_getDataDirectory(),u_getDataDirectory()); return argc < 0 ? U_ILLEGAL_ARGUMENT_ERROR : U_ZERO_ERROR; } - if(options[VERBOSE].doesOccur) { +/* if(options[VERBOSE].doesOccur) { verbose = TRUE; + }*/ + + if(options[QUIET].doesOccur) { + setShowWarning(FALSE); } if(options[SOURCEDIR].doesOccur) {