From 29827fde524a42fe343b32ea3c2f543e9ed3ee55 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 15 Feb 2020 03:27:02 +0300 Subject: Release version 65.1.0+1 Drop copyright notice from source code Convert libicuuc test from C to C++ so it can link library statically Drop linking -lpthread and -lm for MinGW GCC --- libicui18n/build/bootstrap.build | 1 - libicui18n/build/export.build | 1 - libicui18n/build/root.build | 1 - libicui18n/buildfile | 1 - libicui18n/libicui18n/buildfile | 8 ++-- libicui18n/manifest | 2 +- libicui18n/tests/basic/buildfile | 1 - libicui18n/tests/basic/driver.cpp | 1 - libicui18n/tests/basic/testscript | 1 - libicui18n/tests/build/bootstrap.build | 1 - libicui18n/tests/build/root.build | 3 +- libicui18n/tests/buildfile | 1 - libicuio/build/bootstrap.build | 1 - libicuio/build/export.build | 1 - libicuio/build/root.build | 1 - libicuio/buildfile | 1 - libicuio/libicuio/buildfile | 8 ++-- libicuio/manifest | 2 +- libicuio/tests/basic/buildfile | 1 - libicuio/tests/basic/driver.cpp | 1 - libicuio/tests/basic/testscript | 1 - libicuio/tests/build/bootstrap.build | 1 - libicuio/tests/build/root.build | 3 +- libicuio/tests/buildfile | 1 - libicuuc/build/bootstrap.build | 1 - libicuuc/build/export.build | 1 - libicuuc/build/root.build | 1 - libicuuc/buildfile | 1 - libicuuc/libicu/buildfile | 13 +++-- libicuuc/libicu/data/brkitr.c | 1 - libicuuc/libicu/data/coll.c | 1 - libicuuc/libicu/data/config.h | 1 - libicuuc/libicu/data/curr.c | 1 - libicuuc/libicu/data/icudt_dat.c | 1 - libicuuc/libicu/data/lang.c | 1 - libicuuc/libicu/data/other.c | 1 - libicuuc/libicu/data/rbnf.c | 1 - libicuuc/libicu/data/region.c | 1 - libicuuc/libicu/data/unit.c | 1 - libicuuc/libicu/data/zone.c | 1 - libicuuc/manifest | 2 +- libicuuc/tests/basic/buildfile | 3 +- libicuuc/tests/basic/driver.c | 86 ---------------------------------- libicuuc/tests/basic/driver.cpp | 85 +++++++++++++++++++++++++++++++++ libicuuc/tests/basic/testscript | 1 - libicuuc/tests/build/bootstrap.build | 1 - libicuuc/tests/build/root.build | 19 ++++---- libicuuc/tests/buildfile | 1 - 48 files changed, 119 insertions(+), 151 deletions(-) delete mode 100644 libicuuc/tests/basic/driver.c create mode 100644 libicuuc/tests/basic/driver.cpp diff --git a/libicui18n/build/bootstrap.build b/libicui18n/build/bootstrap.build index e8cef12..3a426ec 100644 --- a/libicui18n/build/bootstrap.build +++ b/libicui18n/build/bootstrap.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file project = libicui18n diff --git a/libicui18n/build/export.build b/libicui18n/build/export.build index b3f4e81..0455eea 100644 --- a/libicui18n/build/export.build +++ b/libicui18n/build/export.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file $out_root/ diff --git a/libicui18n/build/root.build b/libicui18n/build/root.build index aba4fb6..be5eaaf 100644 --- a/libicui18n/build/root.build +++ b/libicui18n/build/root.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file # Note that upstream compiles with -std=c++11 but this ends up with the 'auto diff --git a/libicui18n/buildfile b/libicui18n/buildfile index d929850..7aa0fe6 100644 --- a/libicui18n/buildfile +++ b/libicui18n/buildfile @@ -1,5 +1,4 @@ # file : buildfile -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: {*/ -build/} doc{LICENSE INSTALL README} manifest diff --git a/libicui18n/libicui18n/buildfile b/libicui18n/libicui18n/buildfile index 1c0690c..988f400 100644 --- a/libicui18n/libicui18n/buildfile +++ b/libicui18n/libicui18n/buildfile @@ -1,5 +1,4 @@ # file : libicui18n/buildfile -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file import int_libs = libicuuc%lib{icuuc} @@ -93,8 +92,11 @@ switch $tclass, $tsys } case 'windows', 'mingw32' { - cxx.loptions += -Wl,-Bsymbolic -Wl,--enable-auto-import - cxx.libs += -lpthread -lm + # Note that we ommit -mthreads, -lpthread, and -lm that the upstream + # package also passes (see libicuuc/libicu/buildfile for details). + # + cxx.loptions += -Wl,-Bsymbolic -Wl,--enable-auto-import \ + -Wl,--no-undefined # Make sure all symbols are resolvable. } case 'windows' { diff --git a/libicui18n/manifest b/libicui18n/manifest index 3f7d67a..6df34dd 100644 --- a/libicui18n/manifest +++ b/libicui18n/manifest @@ -1,6 +1,6 @@ : 1 name: libicui18n -version: 65.1.0 +version: 65.1.0+1 upstream-version: 65.1 project: icu summary: ICU high-level internationalization C/C++ library diff --git a/libicui18n/tests/basic/buildfile b/libicui18n/tests/basic/buildfile index d4e9ead..9d16bf7 100644 --- a/libicui18n/tests/basic/buildfile +++ b/libicui18n/tests/basic/buildfile @@ -1,5 +1,4 @@ # file : tests/basic/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : Unicode License; see accompanying LICENSE file import libs = libicui18n%lib{icui18n} diff --git a/libicui18n/tests/basic/driver.cpp b/libicui18n/tests/basic/driver.cpp index f9bf704..40f36ad 100644 --- a/libicui18n/tests/basic/driver.cpp +++ b/libicui18n/tests/basic/driver.cpp @@ -1,5 +1,4 @@ // file : tests/basic/driver.cpp -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : Unicode License; see accompanying LICENSE file #include diff --git a/libicui18n/tests/basic/testscript b/libicui18n/tests/basic/testscript index dc6fad8..2938723 100644 --- a/libicui18n/tests/basic/testscript +++ b/libicui18n/tests/basic/testscript @@ -1,5 +1,4 @@ # file : tests/basic/testscript -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file $* "de" >>EOO diff --git a/libicui18n/tests/build/bootstrap.build b/libicui18n/tests/build/bootstrap.build index 17797c1..b689bd5 100644 --- a/libicui18n/tests/build/bootstrap.build +++ b/libicui18n/tests/build/bootstrap.build @@ -1,5 +1,4 @@ # file : tests/build/bootstrap.build -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file project = # Unnamed subproject. diff --git a/libicui18n/tests/build/root.build b/libicui18n/tests/build/root.build index e8283ae..76b5bd7 100644 --- a/libicui18n/tests/build/root.build +++ b/libicui18n/tests/build/root.build @@ -1,8 +1,7 @@ # file : tests/build/root.build -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file -cxx.std = 14 +cxx.std = latest using cxx diff --git a/libicui18n/tests/buildfile b/libicui18n/tests/buildfile index d976635..78b2b2a 100644 --- a/libicui18n/tests/buildfile +++ b/libicui18n/tests/buildfile @@ -1,5 +1,4 @@ # file : tests/buildfile -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: {*/ -build/} diff --git a/libicuio/build/bootstrap.build b/libicuio/build/bootstrap.build index fd58532..ef574c9 100644 --- a/libicuio/build/bootstrap.build +++ b/libicuio/build/bootstrap.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file project = libicuio diff --git a/libicuio/build/export.build b/libicuio/build/export.build index 2559f4e..d40d387 100644 --- a/libicuio/build/export.build +++ b/libicuio/build/export.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file $out_root/ diff --git a/libicuio/build/root.build b/libicuio/build/root.build index aba4fb6..be5eaaf 100644 --- a/libicuio/build/root.build +++ b/libicuio/build/root.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file # Note that upstream compiles with -std=c++11 but this ends up with the 'auto diff --git a/libicuio/buildfile b/libicuio/buildfile index d929850..7aa0fe6 100644 --- a/libicuio/buildfile +++ b/libicuio/buildfile @@ -1,5 +1,4 @@ # file : buildfile -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: {*/ -build/} doc{LICENSE INSTALL README} manifest diff --git a/libicuio/libicuio/buildfile b/libicuio/libicuio/buildfile index 90630f4..2fc6f89 100644 --- a/libicuio/libicuio/buildfile +++ b/libicuio/libicuio/buildfile @@ -1,5 +1,4 @@ # file : libicuio/buildfile -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file import int_libs = libicui18n%lib{icui18n} @@ -76,8 +75,11 @@ switch $tclass, $tsys } case 'windows', 'mingw32' { - cxx.loptions += -Wl,-Bsymbolic -Wl,--enable-auto-import - cxx.libs += -lpthread -lm + # Note that we ommit -mthreads, -lpthread, and -lm that the upstream + # package also passes (see libicuuc/libicu/buildfile for details). + # + cxx.loptions += -Wl,-Bsymbolic -Wl,--enable-auto-import \ + -Wl,--no-undefined # Make sure all symbols are resolvable. } case 'windows' { diff --git a/libicuio/manifest b/libicuio/manifest index d424487..ac83b46 100644 --- a/libicuio/manifest +++ b/libicuio/manifest @@ -1,6 +1,6 @@ : 1 name: libicuio -version: 65.1.0 +version: 65.1.0+1 upstream-version: 65.1 project: icu summary: ICU input/output C/C++ library diff --git a/libicuio/tests/basic/buildfile b/libicuio/tests/basic/buildfile index df0f552..7104878 100644 --- a/libicuio/tests/basic/buildfile +++ b/libicuio/tests/basic/buildfile @@ -1,5 +1,4 @@ # file : tests/basic/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : Unicode License; see accompanying LICENSE file import libs = libicuio%lib{icuio} diff --git a/libicuio/tests/basic/driver.cpp b/libicuio/tests/basic/driver.cpp index 8c87b4b..ecb4887 100644 --- a/libicuio/tests/basic/driver.cpp +++ b/libicuio/tests/basic/driver.cpp @@ -1,5 +1,4 @@ // file : tests/basic/driver.cpp -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : Unicode License; see accompanying LICENSE file #include diff --git a/libicuio/tests/basic/testscript b/libicuio/tests/basic/testscript index 1d9ea51..8cf9a91 100644 --- a/libicuio/tests/basic/testscript +++ b/libicuio/tests/basic/testscript @@ -1,5 +1,4 @@ # file : tests/basic/testscript -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file $* <"Mitteleuropäische Sommerzeit" >>EOO diff --git a/libicuio/tests/build/bootstrap.build b/libicuio/tests/build/bootstrap.build index 17797c1..b689bd5 100644 --- a/libicuio/tests/build/bootstrap.build +++ b/libicuio/tests/build/bootstrap.build @@ -1,5 +1,4 @@ # file : tests/build/bootstrap.build -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file project = # Unnamed subproject. diff --git a/libicuio/tests/build/root.build b/libicuio/tests/build/root.build index e8283ae..76b5bd7 100644 --- a/libicuio/tests/build/root.build +++ b/libicuio/tests/build/root.build @@ -1,8 +1,7 @@ # file : tests/build/root.build -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file -cxx.std = 14 +cxx.std = latest using cxx diff --git a/libicuio/tests/buildfile b/libicuio/tests/buildfile index d976635..78b2b2a 100644 --- a/libicuio/tests/buildfile +++ b/libicuio/tests/buildfile @@ -1,5 +1,4 @@ # file : tests/buildfile -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: {*/ -build/} diff --git a/libicuuc/build/bootstrap.build b/libicuuc/build/bootstrap.build index e029299..8ffc1af 100644 --- a/libicuuc/build/bootstrap.build +++ b/libicuuc/build/bootstrap.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file project = libicuuc diff --git a/libicuuc/build/export.build b/libicuuc/build/export.build index e704c7a..ff8ec28 100644 --- a/libicuuc/build/export.build +++ b/libicuuc/build/export.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file $out_root/ diff --git a/libicuuc/build/root.build b/libicuuc/build/root.build index a5e2f90..dff67b6 100644 --- a/libicuuc/build/root.build +++ b/libicuuc/build/root.build @@ -1,5 +1,4 @@ # file : build/root.build -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file c.std = 11 diff --git a/libicuuc/buildfile b/libicuuc/buildfile index d929850..7aa0fe6 100644 --- a/libicuuc/buildfile +++ b/libicuuc/buildfile @@ -1,5 +1,4 @@ # file : buildfile -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: {*/ -build/} doc{LICENSE INSTALL README} manifest diff --git a/libicuuc/libicu/buildfile b/libicuuc/libicu/buildfile index 6131811..b54b35b 100644 --- a/libicuuc/libicu/buildfile +++ b/libicuuc/libicu/buildfile @@ -1,5 +1,4 @@ # file : libicu/buildfile -# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: lib{icuuc} lib{icudata} @@ -45,8 +44,8 @@ switch $tclass, $tsys # uc/uposixdefs.h for details). This results with compilation errors for # some source files when build on MacOS with gcc (as of 9.2; GCC issues # 93151 and 93469 are reported). We workaround the issue disabling this - # POSIX compliance request for the faulty source files (luckily they don't - # require such a compliance). + # POSIX compliance request for the faulty source files (luckily the + # request is redundant for them). # if ($cxx.id == 'gcc') uc/obj{putil umapfile}: cxx.poptions += -D_XOPEN_SOURCE=400 @@ -130,8 +129,12 @@ switch $tclass, $tsys } case 'windows', 'mingw32' { - cc.loptions += -Wl,-Bsymbolic -Wl,--enable-auto-import - cxx.libs += -lpthread -lm + # Note that upstream also passes -mthreads (thread-safe exception + # handling) that we omit as ICU never throws exceptions (see ICU FAQs for + # details). We also omit -lpthread -lm that seems to be redundant. + # + cc.loptions += -Wl,-Bsymbolic -Wl,--enable-auto-import \ + -Wl,--no-undefined # Make sure all symbols are resolvable. } case 'windows' { diff --git a/libicuuc/libicu/data/brkitr.c b/libicuuc/libicu/data/brkitr.c index 684de02..5d1267d 100644 --- a/libicuuc/libicu/data/brkitr.c +++ b/libicuuc/libicu/data/brkitr.c @@ -1,5 +1,4 @@ /* file : libicu/data/brkitr.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/coll.c b/libicuuc/libicu/data/coll.c index 79bfe3b..c220030 100644 --- a/libicuuc/libicu/data/coll.c +++ b/libicuuc/libicu/data/coll.c @@ -1,5 +1,4 @@ /* file : libicu/data/coll.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/config.h b/libicuuc/libicu/data/config.h index 67589f4..657b2cf 100644 --- a/libicuuc/libicu/data/config.h +++ b/libicuuc/libicu/data/config.h @@ -1,5 +1,4 @@ /* file : libicu/data/config.h -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/curr.c b/libicuuc/libicu/data/curr.c index 57401fc..b849c34 100644 --- a/libicuuc/libicu/data/curr.c +++ b/libicuuc/libicu/data/curr.c @@ -1,5 +1,4 @@ /* file : libicu/data/curr.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/icudt_dat.c b/libicuuc/libicu/data/icudt_dat.c index 3e5fd7c..90416e2 100644 --- a/libicuuc/libicu/data/icudt_dat.c +++ b/libicuuc/libicu/data/icudt_dat.c @@ -1,5 +1,4 @@ /* file : libicu/data/icudt_dat.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/lang.c b/libicuuc/libicu/data/lang.c index 57d24c3..9b6f8f6 100644 --- a/libicuuc/libicu/data/lang.c +++ b/libicuuc/libicu/data/lang.c @@ -1,5 +1,4 @@ /* file : libicu/data/lang.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/other.c b/libicuuc/libicu/data/other.c index ef20453..bedd6c6 100644 --- a/libicuuc/libicu/data/other.c +++ b/libicuuc/libicu/data/other.c @@ -1,5 +1,4 @@ /* file : libicu/data/other.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/rbnf.c b/libicuuc/libicu/data/rbnf.c index d99f21d..955e7bc 100644 --- a/libicuuc/libicu/data/rbnf.c +++ b/libicuuc/libicu/data/rbnf.c @@ -1,5 +1,4 @@ /* file : libicu/data/rbnf.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/region.c b/libicuuc/libicu/data/region.c index 373106b..25ea235 100644 --- a/libicuuc/libicu/data/region.c +++ b/libicuuc/libicu/data/region.c @@ -1,5 +1,4 @@ /* file : libicu/data/region.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/unit.c b/libicuuc/libicu/data/unit.c index e520707..9302285 100644 --- a/libicuuc/libicu/data/unit.c +++ b/libicuuc/libicu/data/unit.c @@ -1,5 +1,4 @@ /* file : libicu/data/unit.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/libicu/data/zone.c b/libicuuc/libicu/data/zone.c index b669cd2..7116b7d 100644 --- a/libicuuc/libicu/data/zone.c +++ b/libicuuc/libicu/data/zone.c @@ -1,5 +1,4 @@ /* file : libicu/data/zone.c -*- C -*- - * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd * license : Unicode License; see accompanying LICENSE file */ diff --git a/libicuuc/manifest b/libicuuc/manifest index 09c12cd..a4fa09a 100644 --- a/libicuuc/manifest +++ b/libicuuc/manifest @@ -1,6 +1,6 @@ : 1 name: libicuuc -version: 65.1.0 +version: 65.1.0+1 upstream-version: 65.1 project: icu summary: ICU basic internationalization C/C++ library diff --git a/libicuuc/tests/basic/buildfile b/libicuuc/tests/basic/buildfile index 6934b21..2189aa6 100644 --- a/libicuuc/tests/basic/buildfile +++ b/libicuuc/tests/basic/buildfile @@ -1,7 +1,6 @@ # file : tests/basic/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : Unicode License; see accompanying LICENSE file import libs = libicuuc%lib{icuuc} -exe{driver}: {h c}{*} $libs testscript +exe{driver}: {hxx cxx}{*} $libs testscript diff --git a/libicuuc/tests/basic/driver.c b/libicuuc/tests/basic/driver.c deleted file mode 100644 index 92c2b7c..0000000 --- a/libicuuc/tests/basic/driver.c +++ /dev/null @@ -1,86 +0,0 @@ -/* file : tests/basic/driver.c - * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC - * license : Unicode License; see accompanying LICENSE file - */ -#include -#include - -#include -#include -#include -#include -#include - -/* Usage: argv[0] - * - * Test some basic libicuuc functionality: - * - * - query and print the library version - * - set, query and print the default locale - * - load a portion of the bundled data and print its format id/version - */ -int -main () -{ - /* Print version. - */ - UVersionInfo v; - u_getVersion (v); - - char s[U_MAX_VERSION_STRING_LENGTH]; - u_versionToString (v, s); - - printf ("version: %s\n", s); - - /* Change and print the current locale. - */ - UErrorCode e = U_ZERO_ERROR; - - uloc_setDefault ("en_GB", &e); - - if (U_FAILURE (e)) - { - fprintf (stderr, "uloc_setDefault failed: %s\n", u_errorName (e)); - u_cleanup (); - return 1; - } - - printf ("locale: %s\n", uloc_getDefault ()); - - /* Check that data is properly loaded from the libicudata's data bundle and - * print its format id/version. - */ - UDataMemory* d = udata_open (NULL, "res", "en_US", &e); - - if (U_FAILURE (e)) - { - fprintf (stderr, "udata_open failed: %s\n", u_errorName (e)); - u_cleanup (); - return 1; - } - - UDataInfo i; - i.size = sizeof (UDataInfo); - - udata_getInfo (d, &i); - - assert (i.isBigEndian == U_IS_BIG_ENDIAN); - assert (i.charsetFamily == U_CHARSET_FAMILY); - - printf ("data: %.4s/%u.%u.%u.%u %u.%u.%u.%u\n", - i.dataFormat, - i.formatVersion[0], - i.formatVersion[1], - i.formatVersion[2], - i.formatVersion[3], - i.dataVersion[0], - i.dataVersion[1], - i.dataVersion[2], - i.dataVersion[3]); - - udata_close (d); - - u_cleanup (); - - return 0; -} diff --git a/libicuuc/tests/basic/driver.cpp b/libicuuc/tests/basic/driver.cpp new file mode 100644 index 0000000..a273133 --- /dev/null +++ b/libicuuc/tests/basic/driver.cpp @@ -0,0 +1,85 @@ +// file : tests/basic/driver.cpp +// license : Unicode License; see accompanying LICENSE file + +#include +#include + +#include +#include +#include +#include +#include + +// Usage: argv[0] +// +// Test some basic libicuuc functionality: +// +// - query and print the library version +// - set, query and print the default locale +// - load a portion of the bundled data and print its format id/version + +int +main () +{ + // Print version. + // + UVersionInfo v; + u_getVersion (v); + + char s[U_MAX_VERSION_STRING_LENGTH]; + u_versionToString (v, s); + + printf ("version: %s\n", s); + + // Change and print the current locale. + // + UErrorCode e = U_ZERO_ERROR; + + uloc_setDefault ("en_GB", &e); + + if (U_FAILURE (e)) + { + fprintf (stderr, "uloc_setDefault failed: %s\n", u_errorName (e)); + u_cleanup (); + return 1; + } + + printf ("locale: %s\n", uloc_getDefault ()); + + // Check that data is properly loaded from the libicudata's data bundle and + // print its format id/version. + // + UDataMemory* d = udata_open (NULL, "res", "en_US", &e); + + if (U_FAILURE (e)) + { + fprintf (stderr, "udata_open failed: %s\n", u_errorName (e)); + u_cleanup (); + return 1; + } + + UDataInfo i; + i.size = sizeof (UDataInfo); + + udata_getInfo (d, &i); + + assert (i.isBigEndian == U_IS_BIG_ENDIAN); + assert (i.charsetFamily == U_CHARSET_FAMILY); + + printf ("data: %.4s/%u.%u.%u.%u %u.%u.%u.%u\n", + i.dataFormat, + i.formatVersion[0], + i.formatVersion[1], + i.formatVersion[2], + i.formatVersion[3], + i.dataVersion[0], + i.dataVersion[1], + i.dataVersion[2], + i.dataVersion[3]); + + udata_close (d); + + u_cleanup (); + + return 0; +} diff --git a/libicuuc/tests/basic/testscript b/libicuuc/tests/basic/testscript index 72fbe00..2578551 100644 --- a/libicuuc/tests/basic/testscript +++ b/libicuuc/tests/basic/testscript @@ -1,5 +1,4 @@ # file : tests/basic/testscript -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file $* >>~%EOO% diff --git a/libicuuc/tests/build/bootstrap.build b/libicuuc/tests/build/bootstrap.build index 17797c1..b689bd5 100644 --- a/libicuuc/tests/build/bootstrap.build +++ b/libicuuc/tests/build/bootstrap.build @@ -1,5 +1,4 @@ # file : tests/build/bootstrap.build -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file project = # Unnamed subproject. diff --git a/libicuuc/tests/build/root.build b/libicuuc/tests/build/root.build index be01522..76b5bd7 100644 --- a/libicuuc/tests/build/root.build +++ b/libicuuc/tests/build/root.build @@ -1,17 +1,18 @@ # file : tests/build/root.build -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file -using c +cxx.std = latest -h{*}: extension = h -c{*}: extension = c +using cxx -if ($c.target.system == 'win32-msvc') - c.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS +hxx{*}: extension = h +cxx{*}: extension = cpp -if ($c.class == 'msvc') - c.coptions += /wd4251 /wd4275 /wd4800 +if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + +if ($cxx.class == 'msvc') + cxx.coptions += /wd4251 /wd4275 /wd4800 # Every exe{} in this subproject is by default a test. # @@ -19,4 +20,4 @@ exe{*}: test = true # Specify the test target for cross-testing. # -test.target = $c.target +test.target = $cxx.target diff --git a/libicuuc/tests/buildfile b/libicuuc/tests/buildfile index d976635..78b2b2a 100644 --- a/libicuuc/tests/buildfile +++ b/libicuuc/tests/buildfile @@ -1,5 +1,4 @@ # file : tests/buildfile -# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd # license : Unicode License; see accompanying LICENSE file ./: {*/ -build/} -- cgit v1.1