]> granicus.if.org Git - icu/commitdiff
ICU-9583 show test summary at end of make. Apropos when the trunk is broken..
authorSteven R. Loomis <srl@icu-project.org>
Tue, 9 Jul 2013 01:16:33 +0000 (01:16 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Tue, 9 Jul 2013 01:16:33 +0000 (01:16 +0000)
X-SVN-Rev: 33895

.gitignore
icu4c/source/icudefs.mk.in
icu4c/source/test/Makefile.in
icu4c/source/test/cintltst/Makefile.in
icu4c/source/test/intltest/Makefile.in
icu4c/source/test/intltest/intltest.cpp
icu4c/source/test/iotest/Makefile.in
icu4c/source/tools/ctestfw/ctest.c

index 561ddbed07a736b8330dc8ba45dfb3d67412898b..61b98da4e31b7500fd052200e827c921a8e4ca89 100644 (file)
@@ -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
index 652870286fc89f86fa798bb3b0f1892914a01591..c0a1607bb3855832db6e1f98d35eca52e319fffd 100644 (file)
@@ -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
index c6e5a8c185582fbfff42943ce40b8522199a870c..018cf7d17ed3ece29651395afbaff33a0adfee2c 100644 (file)
@@ -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 \
index 804b74101046dd04384fadbbd2bc63b137604911..9c9283f45e49383abf6806e05491501f8573695f 100644 (file)
@@ -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) \
index b8667303b5d4383ad5d2ef654de4e7b3512d1ba2..0941011262c0318872944e4055c24cc506b9be2b 100644 (file)
@@ -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) \
index 667c2c8bfcb62cf0c5abb0d0cfd183ea8155ecd0..31f2a080b103190362f36a9d07754f9671723d03 100644 (file)
@@ -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"
index 39f70df2824c65200f78200a984d3eaf71dd633c..66393e7f8470851ecb5c97fa37739c708ecf4768 100644 (file)
@@ -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) \
index 0d40a133a9ee962bc76ac839b5900c3ffd42c530..59995ff7a3217a1847dbe00d430c52c33a01ecdd 100644 (file)
@@ -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;