diff --git a/.gitignore b/.gitignore index 3f84acbd78b..f19f4c22773 100644 --- a/.gitignore +++ b/.gitignore @@ -215,6 +215,7 @@ icu4c/source/test/letest/Release icu4c/source/test/letest/tmp icu4c/source/test/testdata/Makefile icu4c/source/test/testdata/out +icu4c/source/test/testdata/pkgdata.inc icu4c/source/test/testmap/*.d icu4c/source/test/testmap/Debug icu4c/source/test/testmap/Makefile diff --git a/icu4c/source/configure b/icu4c/source/configure index ee5c058ef39..9bcce7f91da 100755 --- a/icu4c/source/configure +++ b/icu4c/source/configure @@ -4202,15 +4202,19 @@ ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "icudefs.mk \ Makefile \ - data/Makefile data/icupkg.inc \ - common/Makefile config/Makefile.inc i18n/Makefile \ + data/icupkg.inc test/testdata/icupkg.inc \ + config/Makefile.inc \ + data/Makefile \ + stubdata/Makefile \ + common/Makefile \ + i18n/Makefile \ layout/Makefile \ layoutex/Makefile \ io/Makefile \ extra/Makefile \ - extra/uconv/Makefile extra/scrptrun/Makefile - stubdata/Makefile \ - tools/Makefile tools/ctestfw/Makefile tools/makeconv/Makefile \ + extra/uconv/Makefile extra/scrptrun/Makefile \ + tools/Makefile tools/ctestfw/Makefile \ + tools/makeconv/Makefile \ tools/genrb/Makefile \ tools/genuca/Makefile \ tools/genccode/Makefile \ @@ -4227,7 +4231,8 @@ trap 'rm -fr `echo "icudefs.mk \ tools/pkgdata/Makefile \ tools/toolutil/Makefile \ tools/dumpce/Makefile \ - test/Makefile test/testdata/Makefile \ + test/Makefile \ + test/testdata/Makefile \ test/hdrtst/Makefile \ test/intltest/Makefile \ test/cintltst/Makefile \ @@ -4399,15 +4404,19 @@ cat >> $CONFIG_STATUS <> $@; \ done; -build-local: build-dir $(SO_VERSION_DATA) build-data build-testdata +build-local: build-dir $(SO_VERSION_DATA) build-data build-data: build-dir $(ALL_FILES) $(OUTTMPDIR)/icudata.lst $(OS390LIST) @@ -398,105 +397,6 @@ $(OUTTMPDIR)/icudata390.lst: $(SRCLISTDEPS) echo $$file >> $@; \ done; -######################################################################### -############################## Test ## stuff ############################ - -TESTSRCDATADIR=$(top_srcdir)/test/testdata -TESTOUTDIR=$(top_builddir)/test/testdata/out - -# Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below -TESTBUILDDIR=$(TESTOUTDIR)/build - -# unpackaged files - live in 'out' so that the path can find them as part of the pkg -UNPACKAGEDTESTDATA=$(TESTOUTDIR)/$(TESTDT)nam.typ - -# pkg name for testdata -TESTDATA=testdata -# prefix for files that are testdata -TESTDT=$(TESTDATA)_ - -# File definitions -TEST_DAT_FILES=$(TESTBUILDDIR)/$(TESTDT)test.icu $(TESTBUILDDIR)/$(TESTDT)nfscsi.spp $(TESTBUILDDIR)/$(TESTDT)nfscss.spp $(TESTBUILDDIR)/$(TESTDT)nfscis.spp $(TESTBUILDDIR)/$(TESTDT)nfsmxs.spp $(TESTBUILDDIR)/$(TESTDT)nfsmxp.spp - -TEST_UCM_SOURCE= test1.ucm test3.ucm test4.ucm test4x.ucm ibm9027.ucm -TEST_UCM_FILES=$(TEST_UCM_SOURCE:%=$(TESTSRCDATADIR)/data/%) -TEST_CNV_FILES=$(TEST_UCM_SOURCE:%.ucm=$(TESTBUILDDIR)/$(TESTDT)%.cnv) - -TEST_RES = casing.txt mc.txt root.txt te.txt te_IN.txt testtypes.txt testaliases.txt testempty.txt DataDrivenCollationTest.txt idna_rules.txt conversion.txt icuio.txt testtable32.txt -TEST_RES_FILES=$(TEST_RES:%.txt=$(TESTBUILDDIR)/$(TESTDT)%.res) $(TESTBUILDDIR)/$(TESTDT)iscii.res $(TESTSRCDATADIR)/$(TESTDT)icu26_testtypes.res $(TESTSRCDATADIR)/$(TESTDT)icu26e_testtypes.res - -ALL_TEST_FILES = $(TEST_DAT_FILES) $(TEST_BRK_FILES) $(TEST_CNV_FILES) $(TEST_RES_FILES) $(TESTOUTDIR)/$(TESTDT)nam.typ - -# list - -$(TESTBUILDDIR)/testdata.lst: $(SRCLISTDEPS) - @echo "generating $@ (list of data files)" - @-$(RMV) $@ - @for file in $(TEST_RES_FILES) $(TEST_DAT_FILES) $(TEST_CNV_FILES); do \ - echo $$file >> $@; \ - done; - - -build-testdata: $(ALL_TEST_FILES) $(TESTBUILDDIR)/testdata.lst $(TESTBUILDDIR)/$(TESTDT)iscii.res - -# test.icu -$(TESTBUILDDIR)/$(TESTDT)test.icu: $(TOOLDIR)/gentest/gentest$(EXEEXT) - $(INVOKE) $(TOOLDIR)/gentest/gentest -d $(TESTBUILDDIR) - -$(TESTBUILDDIR)/testtable32.txt: $(TOOLDIR)/gentest/gentest$(EXEEXT) - $(INVOKE) $(TOOLDIR)/gentest/gentest -r -d $(TESTBUILDDIR) - -$(TESTBUILDDIR)/$(TESTDT)testtable32.res: $(TESTBUILDDIR)/testtable32.txt $(BINDIR)/genrb$(EXEEXT) - $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -p $(TESTDATA) -q -s $(TESTBUILDDIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) $(/dev/null || ( echo "WARNING: could not open ISCII - it may have been disabled." | tee $@ ) - @echo Finished testing genrb -e option - -################################################################### TYP -# TYP FILES - -$(TESTOUTDIR)/$(TESTDT)nam.typ: $(TESTBUILDDIR)/$(TESTDT)te_IN.res - cp $< $@ - - -testdata: packagedata $(ALL_TEST_FILES) $(UNPACKAGEDTESTDATA) - -packagetest: testdata icupkg.inc $(TESTBUILDDIR)/testdata.lst - $(PKGDATA_INVOKE) $(PKGDATA) -T $(TESTBUILDDIR) -d $(TESTOUTDIR) -s $(TESTBUILDDIR) -p $(TESTDATA) -m common $(TESTBUILDDIR)/testdata.lst - ifeq ($(POST_DATA_BUILD), os400-data-rebind) os400-data-rebind: $(LIBICUUC) diff --git a/icu4c/source/test/testdata/.cvsignore b/icu4c/source/test/testdata/.cvsignore index 94511f46761..14b670bf2db 100644 --- a/icu4c/source/test/testdata/.cvsignore +++ b/icu4c/source/test/testdata/.cvsignore @@ -1,2 +1,3 @@ Makefile +pkgdata.inc out \ No newline at end of file diff --git a/icu4c/source/test/testdata/Makefile.in b/icu4c/source/test/testdata/Makefile.in index d24ce951cad..7ff55bb8030 100644 --- a/icu4c/source/test/testdata/Makefile.in +++ b/icu4c/source/test/testdata/Makefile.in @@ -27,7 +27,7 @@ SUBDIRS = .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls \ install-recursive clean clean-local clean-recursive distclean \ distclean-local distclean-recursive doc dist dist-local dist-recursive \ -check check-local check-recursive builddata +check check-local check-recursive copydata build-dir ## Clear suffix list .SUFFIXES : @@ -40,25 +40,7 @@ distclean : distclean-recursive distclean-local dist: dist-recursive dist-local check: all check-recursive check-local -## Recursive targets -all-recursive install-recursive clean-recursive distclean-recursive dist-recursive check-recursive: - @dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "$(MAKE)[$(MAKELEVEL)]: Making \`$$target' in \`$$subdir'"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-local"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $$local_target) || exit; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) "$$target-local" || exit; \ - fi - -all-local: builddata +all-local: build-dir copydata build-testdata testdata packagetest install-local: @@ -66,20 +48,25 @@ dist-local: clean-local: test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) + $(RMV) $(TESTOUTDIR) ifneq ($(wildcard .links),) $(RMV) *.goo *.txt *.bin .links endif distclean-local: clean-local - $(RMV) Makefile + $(RMV) Makefile icupkg.inc check-local: -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -builddata: default.goo +icupkg.inc: $(srcdir)/icupkg.inc.in Makefile $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +copydata: default.goo ifneq ($(srcdir),.) @@ -90,3 +77,123 @@ default.goo: $(srcdir)/default.goo endif +######################################################################### +############################## Test ## stuff ############################ + +ifeq ($(PKGDATA_OPTS),) +PKGDATA_OPTS = -O $(top_builddir)/test/testdata/icupkg.inc +endif + +# relative lib links from pkgdata are the same as for tmp +GENRBOPTS=-k +TOOLDIR=$(top_builddir)/tools +SRCDATADIR=$(top_srcdir)/data +UNICODEDATADIR=$(SRCDATADIR)/unidata +OUTDIR=$(top_builddir)/data/out +OUTTMPDIR=$(top_builddir)/data/out/tmp +BUILDDIR=$(OUTDIR)/build/$(ICUDATA_PLATFORM_NAME) +TESTSRCDATADIR=$(top_srcdir)/test/testdata +TESTOUTDIR=$(top_builddir)/test/testdata/out + +PKGDATA = $(BINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) +PKGDATA_INVOKE:=$(INVOKE) $(PKGDATA_INVOKE_OPTS) + +# Contains all 'intermediate' files (and temp files) except for 'unpackaged data' below +TESTBUILDDIR=$(TESTOUTDIR)/build + +# unpackaged files - live in 'out' so that the path can find them as part of the pkg +UNPACKAGEDTESTDATA=$(TESTOUTDIR)/$(TESTDT)nam.typ + +# pkg name for testdata +TESTDATA=testdata +# prefix for files that are testdata +TESTDT=$(TESTDATA)_ + +# File definitions +TEST_DAT_FILES=$(TESTBUILDDIR)/$(TESTDT)test.icu $(TESTBUILDDIR)/$(TESTDT)nfscsi.spp $(TESTBUILDDIR)/$(TESTDT)nfscss.spp $(TESTBUILDDIR)/$(TESTDT)nfscis.spp $(TESTBUILDDIR)/$(TESTDT)nfsmxs.spp $(TESTBUILDDIR)/$(TESTDT)nfsmxp.spp + +TEST_UCM_SOURCE= test1.ucm test3.ucm test4.ucm test4x.ucm ibm9027.ucm +TEST_UCM_FILES=$(TEST_UCM_SOURCE:%=$(TESTSRCDATADIR)/data/%) +TEST_CNV_FILES=$(TEST_UCM_SOURCE:%.ucm=$(TESTBUILDDIR)/$(TESTDT)%.cnv) + +TEST_RES = casing.txt mc.txt root.txt te.txt te_IN.txt testtypes.txt testaliases.txt testempty.txt DataDrivenCollationTest.txt idna_rules.txt conversion.txt icuio.txt testtable32.txt +TEST_RES_FILES=$(TEST_RES:%.txt=$(TESTBUILDDIR)/$(TESTDT)%.res) $(TESTBUILDDIR)/$(TESTDT)iscii.res $(TESTSRCDATADIR)/$(TESTDT)icu26_testtypes.res $(TESTSRCDATADIR)/$(TESTDT)icu26e_testtypes.res + +ALL_TEST_FILES = $(TEST_DAT_FILES) $(TEST_BRK_FILES) $(TEST_CNV_FILES) $(TEST_RES_FILES) $(TESTOUTDIR)/$(TESTDT)nam.typ + +# list + +$(TESTBUILDDIR)/testdata.lst: $(SRCLISTDEPS) + @echo "generating $@ (list of data files)" + @-$(RMV) $@ + @for file in $(TEST_RES_FILES) $(TEST_DAT_FILES) $(TEST_CNV_FILES); do \ + echo $$file >> $@; \ + done; + + +build-testdata: $(ALL_TEST_FILES) $(TESTBUILDDIR)/testdata.lst $(TESTBUILDDIR)/$(TESTDT)iscii.res + +# test.icu +$(TESTBUILDDIR)/$(TESTDT)test.icu: $(TOOLDIR)/gentest/gentest$(EXEEXT) + $(INVOKE) $(TOOLDIR)/gentest/gentest -d $(TESTBUILDDIR) + +$(TESTBUILDDIR)/testtable32.txt: $(TOOLDIR)/gentest/gentest$(EXEEXT) + $(INVOKE) $(TOOLDIR)/gentest/gentest -r -d $(TESTBUILDDIR) + +$(TESTBUILDDIR)/$(TESTDT)testtable32.res: $(TESTBUILDDIR)/testtable32.txt $(BINDIR)/genrb$(EXEEXT) + $(INVOKE) $(BINDIR)/genrb $(GENRBOPTS) -p $(TESTDATA) -q -s $(TESTBUILDDIR) -i $(BUILDDIR) -d $(TESTBUILDDIR) $(/dev/null || ( echo "WARNING: could not open ISCII - it may have been disabled." | tee $@ ) + @echo Finished testing genrb -e option + +################################################################### TYP +# TYP FILES + +$(TESTOUTDIR)/$(TESTDT)nam.typ: $(TESTBUILDDIR)/$(TESTDT)te_IN.res + cp $< $@ + + +testdata: build-dir $(ALL_TEST_FILES) $(UNPACKAGEDTESTDATA) + +$(ALL_TEST_FILES): build-dir + +packagetest: testdata icupkg.inc $(TESTBUILDDIR)/testdata.lst + $(PKGDATA_INVOKE) $(PKGDATA) -T $(TESTBUILDDIR) -d $(TESTOUTDIR) -s $(TESTBUILDDIR) -p $(TESTDATA) -m common $(TESTBUILDDIR)/testdata.lst + +build-dir: + -$(MKINSTALLDIRS) $(TESTOUTDIR) $(TESTBUILDDIR) + + diff --git a/icu4c/source/test/testdata/pkgdata.inc.in b/icu4c/source/test/testdata/pkgdata.inc.in new file mode 100644 index 00000000000..2a9838b5c39 --- /dev/null +++ b/icu4c/source/test/testdata/pkgdata.inc.in @@ -0,0 +1,20 @@ +#****************************************************************************** +# +# Copyright (C) 2000-2004, International Business Machines +# Corporation and others. All Rights Reserved. +# +#****************************************************************************** +# This Makefile is used to build the ICU's data. +# It is included with the -O option to pkgdata. + +top_srcdir=@top_srcdir@ +srcdir=@srcdir@ +top_builddir=../.. + +include $(top_builddir)/icudefs.mk + +##### Add the following to source/config/Makefile.in + +GENCCODE=$(BINDIR)/genccode +GENCMN=$(BINDIR)/gencmn +