]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/testdata/BUILDRULES.py
1 # Copyright (C) 2018 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html
4 from distutils
.sysconfig
import parse_makefile
6 from buildtool
import *
7 from buildtool
.request_types
import *
10 def generate(config
, glob
, common_vars
):
12 requests
+= generate_rb(config
, glob
, common_vars
)
13 requests
+= generate_sprep(config
, glob
, common_vars
)
14 requests
+= generate_conv(config
, glob
, common_vars
)
15 requests
+= generate_other(config
, glob
, common_vars
)
16 requests
+= generate_copy(config
, glob
, common_vars
)
20 name
= "testdata_list",
21 variable_name
= "testdata_all_output_files",
22 output_file
= TmpFile("testdata.lst"),
30 def generate_rb(config
, glob
, common_vars
):
31 mk_vars
= parse_makefile("{GLOB_DIR}/tstfiles.mk".format(**common_vars
))
32 basenames
= [v
[:-4] for v
in mk_vars
["TEST_RES_SOURCE"].split()]
54 # Inference rule for creating resource bundles
55 # Some test data resource bundles are known to have warnings and bad data.
56 # The -q option is there on purpose, so we don't see it normally.
57 # TODO: Use option -k?
58 RepeatedExecutionRequest(
61 input_files
= [InFile("%s.txt" % bn
) for bn
in basenames
],
62 output_files
= [OutFile("%s.res" % bn
) for bn
in basenames
],
63 tool
= IcuTool("genrb"),
64 args
= "-q -s {IN_DIR} -d {OUT_DIR} {INPUT_FILE}",
68 # Other standalone res files
69 SingleExecutionRequest(
72 input_files
= [InFile("encoded.utf16be")],
73 output_files
= [OutFile("encoded.res")],
74 tool
= IcuTool("genrb"),
75 args
= "-s {IN_DIR} -eUTF-16BE -d {OUT_DIR} {INPUT_FILES[0]}",
78 SingleExecutionRequest(
81 input_files
= [InFile("zoneinfo64.txt")],
82 output_files
= [TmpFile("zoneinfo64.res")],
83 tool
= IcuTool("genrb"),
84 args
= "-s {IN_DIR} -d {TMP_DIR} {INPUT_FILES[0]}",
87 SingleExecutionRequest(
90 input_files
= [InFile("filtertest.txt")],
91 output_files
= [OutFile("filtertest.res")],
92 tool
= IcuTool("genrb"),
93 args
= "-s {IN_DIR} -d {OUT_DIR} -i {OUT_DIR} "
94 "--filterDir {IN_DIR}/filters filtertest.txt",
100 def generate_sprep(config
, glob
, common_vars
):
102 SingleExecutionRequest(
105 input_files
= [InFile("nfs4_cs_prep_ci.txt")],
106 output_files
= [OutFile("nfscsi.spp")],
107 tool
= IcuTool("gensprep"),
108 args
= "-s {IN_DIR} -d {OUT_DIR} -b nfscsi -u 3.2.0 {INPUT_FILES[0]}",
111 SingleExecutionRequest(
114 input_files
= [InFile("nfs4_cs_prep_cs.txt")],
115 output_files
= [OutFile("nfscss.spp")],
116 tool
= IcuTool("gensprep"),
117 args
= "-s {IN_DIR} -d {OUT_DIR} -b nfscss -u 3.2.0 {INPUT_FILES[0]}",
120 SingleExecutionRequest(
123 input_files
= [InFile("nfs4_cis_prep.txt")],
124 output_files
= [OutFile("nfscis.spp")],
125 tool
= IcuTool("gensprep"),
126 args
= "-s {IN_DIR} -d {OUT_DIR} -b nfscis -u 3.2.0 -k -n {IN_DIR}/../../data/unidata {INPUT_FILES[0]}",
129 SingleExecutionRequest(
132 input_files
= [InFile("nfs4_mixed_prep_s.txt")],
133 output_files
= [OutFile("nfsmxs.spp")],
134 tool
= IcuTool("gensprep"),
135 args
= "-s {IN_DIR} -d {OUT_DIR} -b nfsmxs -u 3.2.0 -k -n {IN_DIR}/../../data/unidata {INPUT_FILES[0]}",
138 SingleExecutionRequest(
141 input_files
= [InFile("nfs4_mixed_prep_p.txt")],
142 output_files
= [OutFile("nfsmxp.spp")],
143 tool
= IcuTool("gensprep"),
144 args
= "-s {IN_DIR} -d {OUT_DIR} -b nfsmxp -u 3.2.0 -k -n {IN_DIR}/../../data/unidata {INPUT_FILES[0]}",
150 def generate_conv(config
, glob
, common_vars
):
162 RepeatedExecutionRequest(
165 input_files
= [InFile("%s.ucm" % bn
) for bn
in basenames
],
166 output_files
= [OutFile("%s.cnv" % bn
) for bn
in basenames
],
167 tool
= IcuTool("makeconv"),
168 args
= "--small -d {OUT_DIR} {IN_DIR}/{INPUT_FILE}",
175 def generate_copy(config
, glob
, common_vars
):
179 input_file
= OutFile("te.res"),
180 output_file
= TmpFile("nam.typ")
183 name
= "old_l_testtypes",
184 input_file
= InFile("old_l_testtypes.res"),
185 output_file
= OutFile("old_l_testtypes.res")
188 name
= "old_e_testtypes",
189 input_file
= InFile("old_e_testtypes.res"),
190 output_file
= OutFile("old_e_testtypes.res")
195 def generate_other(config
, glob
, common_vars
):
197 SingleExecutionRequest(
200 input_files
= [InFile("testnorm.txt")],
201 output_files
= [OutFile("testnorm.nrm")],
202 tool
= IcuTool("gennorm2"),
203 args
= "-s {IN_DIR} {INPUT_FILES[0]} -o {OUT_DIR}/{OUTPUT_FILES[0]}",
206 SingleExecutionRequest(
210 output_files
= [OutFile("test.icu")],
211 tool
= IcuTool("gentest"),
212 args
= "-d {OUT_DIR}",
215 SingleExecutionRequest(
216 name
= "testtable32_txt",
219 output_files
= [TmpFile("testtable32.txt")],
220 tool
= IcuTool("gentest"),
221 args
= "-r -d {TMP_DIR}",
224 SingleExecutionRequest(
225 name
= "testtable32_res",
227 input_files
= [TmpFile("testtable32.txt")],
228 output_files
= [OutFile("testtable32.res")],
229 tool
= IcuTool("genrb"),
230 args
= "-s {TMP_DIR} -d {OUT_DIR} {INPUT_FILES[0]}",