Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf64d4e

Browse files
committed
Cleanup for unicode-update build target and test.
In preparation for adding more Unicode tables.Discussion:https://postgr.es/m/63cd8625-68fa-4760-844a-6b7f643336f2@ardentperf.comReviewed-by: Jeremy Schneider
1 parent29f114b commitcf64d4e

File tree

3 files changed

+37
-37
lines changed

3 files changed

+37
-37
lines changed

‎src/common/unicode/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ CPPFLAGS += $(ICU_CFLAGS)
2121
# By default, do nothing.
2222
all:
2323

24-
update-unicode: unicode_category_table.hunicode_norm_table.h unicode_nonspacing_table.hunicode_east_asian_fw_table.hunicode_normprops_table.hunicode_norm_hashfunc.h unicode_version.h
24+
update-unicode: unicode_category_table.hunicode_east_asian_fw_table.h unicode_nonspacing_table.hunicode_norm_hashfunc.hunicode_norm_table.hunicode_normprops_table.h unicode_version.h
2525
mv$^$(top_srcdir)/src/include/common/
2626
$(MAKE) category-check
2727
$(MAKE) normalization-check
2828

2929
# These files are part of the Unicode Character Database. Download
3030
# them on demand. The dependency on Makefile.global is for
3131
# UNICODE_VERSION.
32-
UnicodeData.txtEastAsianWidth.txtDerivedNormalizationProps.txtCompositionExclusions.txtNormalizationTest.txt:$(top_builddir)/src/Makefile.global
32+
CompositionExclusions.txtDerivedNormalizationProps.txtEastAsianWidth.txtNormalizationTest.txtUnicodeData.txt:$(top_builddir)/src/Makefile.global
3333
$(DOWNLOAD) https://www.unicode.org/Public/$(UNICODE_VERSION)/ucd/$(@F)
3434

3535
unicode_version.h: generate-unicode_version.pl
@@ -82,4 +82,4 @@ clean:
8282
rm -f$(OBJS) category_test category_test.o norm_test norm_test.o
8383

8484
distclean: clean
85-
rm -fUnicodeData.txtEastAsianWidth.txtCompositionExclusions.txt NormalizationTest.txt norm_test_table.h unicode_norm_table.h
85+
rm -fCompositionExclusions.txtDerivedNormalizationProps.txtEastAsianWidth.txt NormalizationTest.txtUnicodeData.txtnorm_test_table.h unicode_category_table.h unicode_norm_table.h

‎src/common/unicode/category_test.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
staticint
2929
parse_unicode_version(constchar*version)
3030
{
31-
intn,
32-
major,
33-
minor;
31+
intnPG_USED_FOR_ASSERTS_ONLY;
32+
intmajor;
33+
intminor;
3434

3535
n=sscanf(version,"%d.%d",&major,&minor);
3636

@@ -54,8 +54,8 @@ main(int argc, char **argv)
5454
intpg_skipped_codepoints=0;
5555
inticu_skipped_codepoints=0;
5656

57-
printf("Postgres UnicodeVersion:\t%s\n",PG_UNICODE_VERSION);
58-
printf("ICU UnicodeVersion:\t\t%s\n",U_UNICODE_VERSION);
57+
printf("category_test:Postgres Unicodeversion:\t%s\n",PG_UNICODE_VERSION);
58+
printf("category_test:ICU Unicodeversion:\t\t%s\n",U_UNICODE_VERSION);
5959

6060
for (UChar32code=0;code <=0x10ffff;code++)
6161
{
@@ -79,11 +79,11 @@ main(int argc, char **argv)
7979
icu_skipped_codepoints++;
8080
else
8181
{
82-
printf("FAILURE for codepoint %06x\n",code);
83-
printf("Postgres category:%02d %s %s\n",pg_category,
82+
printf("category_test:FAILURE for codepoint0x%06x\n",code);
83+
printf("category_test:Postgres category:%02d %s %s\n",pg_category,
8484
unicode_category_abbrev(pg_category),
8585
unicode_category_string(pg_category));
86-
printf("ICU category:%02d %s %s\n",icu_category,
86+
printf("category_test:ICU category:%02d %s %s\n",icu_category,
8787
unicode_category_abbrev(icu_category),
8888
unicode_category_string(icu_category));
8989
printf("\n");
@@ -93,16 +93,16 @@ main(int argc, char **argv)
9393
}
9494

9595
if (pg_skipped_codepoints>0)
96-
printf("Skipped%d codepoints unassigned in Postgres due to Unicode version mismatch.\n",
96+
printf("category_test: skipped%d codepoints unassigned in Postgres due to Unicode version mismatch\n",
9797
pg_skipped_codepoints);
9898
if (icu_skipped_codepoints>0)
99-
printf("Skipped%d codepoints unassigned in ICU due to Unicode version mismatch.\n",
99+
printf("category_test: skipped%d codepoints unassigned in ICU due to Unicode version mismatch\n",
100100
icu_skipped_codepoints);
101101

102-
printf("category_test:All tests successful!\n");
102+
printf("category_test:success\n");
103103
exit(0);
104104
#else
105-
printf("ICU support required for test; skipping.\n");
105+
printf("category_test:ICU support required for test; skipping\n");
106106
exit(0);
107107
#endif
108108
}

‎src/common/unicode/meson.build

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif
1111

1212
# These files are part of the Unicode Character Database. Download them on
1313
# demand.
14-
foreachf: ['UnicodeData.txt','EastAsianWidth.txt','DerivedNormalizationProps.txt','CompositionExclusions.txt','NormalizationTest.txt']
14+
foreachf: ['CompositionExclusions.txt','DerivedNormalizationProps.txt','EastAsianWidth.txt','NormalizationTest.txt','UnicodeData.txt']
1515
url= unicode_baseurl.format(UNICODE_VERSION, f)
1616
target=custom_target(f,
1717
output: f,
@@ -24,15 +24,6 @@ endforeach
2424

2525
update_unicode_targets= []
2626

27-
update_unicode_targets+= \
28-
custom_target('unicode_version.h',
29-
output: ['unicode_version.h'],
30-
command: [
31-
perl,files('generate-unicode_version.pl'),
32-
'--outdir','@OUTDIR@','--version', UNICODE_VERSION],
33-
build_by_default:false,
34-
)
35-
3627
update_unicode_targets+= \
3728
custom_target('unicode_category_table.h',
3829
input: [unicode_data['UnicodeData.txt']],
@@ -44,14 +35,12 @@ update_unicode_targets += \
4435
)
4536

4637
update_unicode_targets+= \
47-
custom_target('unicode_norm_table.h',
48-
input: [unicode_data['UnicodeData.txt'], unicode_data['CompositionExclusions.txt']],
49-
output: ['unicode_norm_table.h','unicode_norm_hashfunc.h'],
50-
depend_files: perfect_hash_pm,
51-
command: [
52-
perl,files('generate-unicode_norm_table.pl'),
53-
'--outdir','@OUTDIR@','@INPUT@'],
38+
custom_target('unicode_east_asian_fw_table.h',
39+
input: [unicode_data['EastAsianWidth.txt']],
40+
output: ['unicode_east_asian_fw_table.h'],
41+
command: [perl,files('generate-unicode_east_asian_fw_table.pl'),'@INPUT@'],
5442
build_by_default:false,
43+
capture:true,
5544
)
5645

5746
update_unicode_targets+= \
@@ -65,12 +54,14 @@ update_unicode_targets += \
6554
)
6655

6756
update_unicode_targets+= \
68-
custom_target('unicode_east_asian_fw_table.h',
69-
input: [unicode_data['EastAsianWidth.txt']],
70-
output: ['unicode_east_asian_fw_table.h'],
71-
command: [perl,files('generate-unicode_east_asian_fw_table.pl'),'@INPUT@'],
57+
custom_target('unicode_norm_table.h',
58+
input: [unicode_data['UnicodeData.txt'], unicode_data['CompositionExclusions.txt']],
59+
output: ['unicode_norm_table.h','unicode_norm_hashfunc.h'],
60+
depend_files: perfect_hash_pm,
61+
command: [
62+
perl,files('generate-unicode_norm_table.pl'),
63+
'--outdir','@OUTDIR@','@INPUT@'],
7264
build_by_default:false,
73-
capture:true,
7465
)
7566

7667
update_unicode_targets+= \
@@ -83,6 +74,15 @@ update_unicode_targets += \
8374
capture:true,
8475
)
8576

77+
update_unicode_targets+= \
78+
custom_target('unicode_version.h',
79+
output: ['unicode_version.h'],
80+
command: [
81+
perl,files('generate-unicode_version.pl'),
82+
'--outdir','@OUTDIR@','--version', UNICODE_VERSION],
83+
build_by_default:false,
84+
)
85+
8686
norm_test_table=custom_target('norm_test_table.h',
8787
input: [unicode_data['NormalizationTest.txt']],
8888
output: ['norm_test_table.h'],

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp