mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-9583 show test summary at end of make. Apropos when the trunk is broken..
X-SVN-Rev: 33895
This commit is contained in:
parent
06dcb5d4a6
commit
bfdba0df96
8 changed files with 61 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -604,6 +604,7 @@ icu4c/source/test/testmap/testmap
|
|||
icu4c/source/test/testmap/testmap.plg
|
||||
icu4c/source/test/thaitest/Makefile
|
||||
icu4c/source/test/threadtest/Makefile
|
||||
icu4c/source/test/tmp
|
||||
icu4c/source/tools/Makefile
|
||||
icu4c/source/tools/ctestfw/*.ao
|
||||
icu4c/source/tools/ctestfw/*.d
|
||||
|
|
|
@ -306,5 +306,10 @@ else
|
|||
cross_buildroot = $(top_builddir)
|
||||
endif
|
||||
|
||||
# for tests
|
||||
ifneq ($(TEST_STATUS_FILE),)
|
||||
TEST_OUTPUT_OPTS="-E$(TEST_STATUS_FILE)"
|
||||
endif
|
||||
|
||||
# optional include at top
|
||||
-include $(top_builddir)/icudefs.local
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
## Makefile.in for ICU tests
|
||||
## Copyright (c) 1999-2011, International Business Machines Corporation and
|
||||
## Copyright (c) 1999-2013, International Business Machines Corporation and
|
||||
## others. All Rights Reserved.
|
||||
|
||||
## Source directory information
|
||||
|
@ -15,6 +15,10 @@ subdir = test
|
|||
|
||||
@ICUIO_TRUE@IOTEST = iotest
|
||||
|
||||
# status dir
|
||||
STATUS_TMP = tmp
|
||||
STATUS_FULL = $(shell pwd)/$(STATUS_TMP)
|
||||
|
||||
## Files to remove for 'make clean'
|
||||
CLEANFILES = *~
|
||||
|
||||
|
@ -42,6 +46,7 @@ clean: clean-recursive clean-local
|
|||
distclean : distclean-recursive distclean-local
|
||||
$(RMV) hdrtst/Makefile
|
||||
$(RMV) perf/convperf/Makefile
|
||||
$(RMV) $(STATUS_TMP)
|
||||
|
||||
dist: dist-recursive dist-local
|
||||
check: everything check-recursive check-local
|
||||
|
@ -70,18 +75,30 @@ all-recursive install-recursive clean-recursive distclean-recursive dist-recursi
|
|||
fi
|
||||
|
||||
xcheck-recursive check-recursive check-exhaustive-recursive:
|
||||
@$(MKINSTALLDIRS) $(STATUS_TMP)
|
||||
@mystatus=$(STATUS_FULL)/status.$$$$.deleteme ; \
|
||||
$(RMV) "$$mystatus".* ; \
|
||||
@goods=; \
|
||||
bads=; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \
|
||||
local_target="$$target"; \
|
||||
if (cd $$subdir && $(MAKE) $$local_target); then \
|
||||
if (cd $$subdir && $(MAKE) $$local_target TEST_STATUS_FILE="$$mystatus.$$subdir" ); then \
|
||||
goods="$$goods $$subdir"; \
|
||||
else \
|
||||
bads="$$bads $$subdir"; \
|
||||
fi; \
|
||||
done; \
|
||||
for subdir in $$list; do \
|
||||
if [ -f "$$mystatus.$$subdir" ]; then \
|
||||
echo "-------------" ; \
|
||||
echo "| SUBTEST SUMMARY: $$subdir" ; \
|
||||
cat "$$mystatus.$$subdir" ; \
|
||||
echo "| END SUMMARY: $$subdir" ; \
|
||||
$(RMV) "$$mystatus.$$subdir" ; \
|
||||
fi; \
|
||||
done; \
|
||||
echo "---------------"; \
|
||||
echo "ALL TESTS SUMMARY:"; \
|
||||
if test ! "x$$bads" = "x"; then \
|
||||
|
|
|
@ -88,14 +88,14 @@ distclean-local: clean-local
|
|||
$(RMV) Makefile
|
||||
|
||||
check-local: all-local
|
||||
$(INVOKE) ./$(TARGET) $(CINTLTST_OPTS)
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) $(CINTLTST_OPTS)
|
||||
|
||||
check-exhaustive-local: all-local
|
||||
$(INVOKE) ./$(TARGET) -e
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) -e
|
||||
|
||||
TESTXML=$(top_builddir)/test-$(TARGET).xml
|
||||
xcheck-local: all-local
|
||||
$(INVOKE) ./$(TARGET) $(CINTLTST_OPTS) -x $(TESTXML)
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) $(CINTLTST_OPTS) -x $(TESTXML)
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
|
|
|
@ -93,14 +93,14 @@ distclean-local: clean-local
|
|||
$(RMV) Makefile
|
||||
|
||||
check-local: all-local
|
||||
$(INVOKE) ./$(TARGET) $(INTLTEST_OPTS)
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) $(INTLTEST_OPTS)
|
||||
|
||||
check-exhaustive-local: all-local
|
||||
$(INVOKE) ./$(TARGET) -e
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) -e
|
||||
|
||||
TESTXML=$(top_builddir)/test-$(TARGET).xml
|
||||
xcheck-local: all-local
|
||||
$(INVOKE) ./$(TARGET) $(INTLTEST_OPTS) -x $(TESTXML)
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) $(INTLTEST_OPTS) -x $(TESTXML)
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
|
|
|
@ -1118,6 +1118,7 @@ main(int argc, char* argv[])
|
|||
UBool name = FALSE;
|
||||
UBool leaks = FALSE;
|
||||
UBool utf8 = FALSE;
|
||||
const char *summary_file = NULL;
|
||||
UBool warnOnMissingData = FALSE;
|
||||
UBool defaultDataFound = FALSE;
|
||||
int32_t threadCount = 1;
|
||||
|
@ -1157,6 +1158,8 @@ main(int argc, char* argv[])
|
|||
else if (strcmp("notime", str) == 0 ||
|
||||
strcmp("T", str) == 0)
|
||||
no_time = TRUE;
|
||||
else if (strncmp("E", str, 1) == 0)
|
||||
summary_file = str+1;
|
||||
else if (strcmp("x", str)==0) {
|
||||
if(++i>=argc) {
|
||||
printf("* Error: '-x' option requires an argument. usage: '-x outfile.xml'.\n");
|
||||
|
@ -1433,6 +1436,16 @@ main(int argc, char* argv[])
|
|||
fprintf(stdout, "Errors in total: %ld.\n", (long)major.getErrors());
|
||||
major.printErrors();
|
||||
|
||||
if(summary_file != NULL) {
|
||||
FILE *summf = fopen(summary_file, "w");
|
||||
if( summf != NULL) {
|
||||
char buf[10000];
|
||||
int32_t length = errorList.extract(0, errorList.length(), buf, sizeof(buf));
|
||||
fwrite(buf, sizeof(*buf), length, (FILE*)summf);
|
||||
fclose(summf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (major.getDataErrors() != 0) {
|
||||
fprintf(stdout, "\t*Note* some errors are data-loading related. If the data used is not the \n"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#******************************************************************************
|
||||
#
|
||||
# Copyright (C) 1999-2011, International Business Machines
|
||||
# Copyright (C) 1999-2013, International Business Machines
|
||||
# Corporation and others. All Rights Reserved.
|
||||
#
|
||||
#******************************************************************************
|
||||
|
@ -74,14 +74,14 @@ distclean-local: clean-local
|
|||
$(RMV) Makefile
|
||||
|
||||
check-local: all-local
|
||||
$(INVOKE) ./$(TARGET) $(IOTEST_OPTS)
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) $(IOTEST_OPTS)
|
||||
|
||||
check-exhaustive-local: all-local
|
||||
$(INVOKE) ./$(TARGET) -e
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) -e
|
||||
|
||||
TESTXML=$(top_builddir)/test-$(TARGET).xml
|
||||
xcheck-local: all-local
|
||||
$(INVOKE) ./$(TARGET) $(IOTEST_OPTS) -x $(TESTXML)
|
||||
$(INVOKE) ./$(TARGET) $(TEST_OUTPUT_OPTS) $(IOTEST_OPTS) -x $(TESTXML)
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
|
|
|
@ -124,7 +124,7 @@ size_t MAXIMUM_MEMORY_SIZE_FAILURE = (size_t)-1; /* Maximum library memory alloc
|
|||
static const char *ARGV_0 = "[ALL]";
|
||||
static const char *XML_FILE_NAME=NULL;
|
||||
static char XML_PREFIX[256];
|
||||
|
||||
static const char *SUMMARY_FILE = NULL;
|
||||
FILE *XML_FILE = NULL;
|
||||
/*-------------------------------------------*/
|
||||
|
||||
|
@ -521,6 +521,14 @@ runTests ( const TestNode *root )
|
|||
fprintf(stdout, " Errors in\n");
|
||||
for (i=0;i < ERRONEOUS_FUNCTION_COUNT; i++)
|
||||
fprintf(stdout, "[%s]\n",ERROR_LOG[i]);
|
||||
if(SUMMARY_FILE != NULL) {
|
||||
FILE *summf = fopen(SUMMARY_FILE, "w");
|
||||
if(summf!=NULL) {
|
||||
for (i=0;i < ERRONEOUS_FUNCTION_COUNT; i++)
|
||||
fprintf(summf, "%s\n",ERROR_LOG[i]);
|
||||
fclose(summf);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -927,6 +935,10 @@ initArgs( int argc, const char* const argv[], ArgHandlerPtr argHandler, void *co
|
|||
{
|
||||
QUICK = 0;
|
||||
}
|
||||
else if (strncmp( argv[i], "-E",2) ==0)
|
||||
{
|
||||
SUMMARY_FILE=argv[i]+2;
|
||||
}
|
||||
else if (strcmp( argv[i], "-w") ==0)
|
||||
{
|
||||
WARN_ON_MISSING_DATA = TRUE;
|
||||
|
|
Loading…
Add table
Reference in a new issue