Skip to content

Commit

Permalink
Add icu76 for C++. Includes new data files. (#325)
Browse files Browse the repository at this point in the history
* NodeJS with collator - moving rules items to unsupported

* Node Collation: tests with rules or non-standard compare --> 'unsupported'

* Remove run_config.json from this PR

* First attempt and ICU76 with CPP

* Updating to use release ICU76 + messaage_fmt2

* icu4c 76 - test locale display names
  • Loading branch information
sven-oly authored Nov 4, 2024
1 parent 86774f2 commit 18653e9
Show file tree
Hide file tree
Showing 30 changed files with 453,270 additions and 6 deletions.
24 changes: 20 additions & 4 deletions executors/node/collator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ module.exports = {
rules = json['rules'];
}

let compare_type = undefined;
if ('compare_type' in json) {
compare_type = json['compare_type'];
}

// Set up collator object with optional locale and testOptions.
let coll;
try {
Expand All @@ -39,13 +44,24 @@ module.exports = {
result_bool = false;
}
outputLine = {'label':json['label'],
'result': result_bool,
'compare_result': compared,
}

if (result != true) {
if (result == true) {
// Only output result field if result is true.
outputLine['result'] = result_bool;
outputLine['compare_result'] = compared;
} else {
// Additional info for the comparison
outputLine['compare'] = compared;
if (rules) {
outputLine['unsupported'] = 'Collator rules not available';
outputLine['error_detail'] = 'No rules';
outputLine['error'] = 'rules';
}
else if (compare_type) {
outputLine['unsupported'] = 'Compare type not supported';
outputLine['error_detail'] = 'No comparison';
outputLine['error'] = 'compare_type';
}
}

} catch (error) {
Expand Down
20 changes: 20 additions & 0 deletions run_config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
[
{
"prereq": {
"name": "Get ICU4C 76",
"version": "76.1",
"command": "bash ../executors/cpp/set_icu4c_binary.sh ../gh-cache/icu4c-76_1-Ubuntu22.04-x64.tgz"
},
"run": {
"icu_version": "icu76",
"exec": "cpp",
"test_type": [
"collation_short",
"lang_names",
"likely_subtags",
"message_fmt2",
"number_fmt",
"plural_rules"
],
"per_execution": 10000
}
},
{
"prereq": {
"name": "Get ICU4C 71",
Expand Down
4 changes: 4 additions & 0 deletions schema/message_fmt2/test_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
"type": "string",
"description": "Identifier for the test."
},
"description": {
"type": "string",
"description": "what this is all about"
},
"hexhash": {
"description": "A hexadecimal hash code for the test without the label",
"type": "string"
Expand Down
3 changes: 2 additions & 1 deletion schema/schema_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,8 @@ def main(args):
schema_validator.schema_base = '.'
schema_validator.test_data_base = os.path.split(base_folders[0])[0]
schema_validator.test_output_base = os.path.split(os.path.split(result_folders[0])[0])[0]
schema_validator.icu_versions = ['icu71', 'icu72', 'icu73', 'icu74', 'icu75']
schema_validator.icu_versions = ['icu71', 'icu72', 'icu73', 'icu74', 'icu75',
'icu76']
schema_validator.executors = ['node', 'rust', 'dart_web', 'dart_native', 'icu4j']

logging.info('Checking test outputs')
Expand Down
9 changes: 9 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ function download_75_1() {
}


function download_76_1() {
if [[ ! -f icu4c-76_1-Ubuntu22.04-x64.tgz ]]
then
wget https://github.com/unicode-org/icu/releases/download/release-76-1/icu4c-76_1-Ubuntu22.04-x64.tgz
fi
}


pushd gh-cache

download_71_1
Expand All @@ -88,5 +96,6 @@ function download_75_1() {
download_74_1
download_74_2
download_75_1
download_76_1

popd
15 changes: 14 additions & 1 deletion testdriver/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ICUVersion(Enum):
ICU73 = "73"
ICU74 = "74"
ICU75 = "75"
ICU76 = "76"

# TODO: Consider adding a trunk version for testing ICU / CLDR before
# a complete release.
Expand All @@ -74,6 +75,7 @@ class CLDRVersion(Enum):
CLDR43 = "43"
CLDR44 = "44"
CLDR45 = "45"
CLDR46 = "46"

def latestCldrVersion():
return CLDRVersion.CLDR43 # TODO: Fix this
Expand All @@ -93,6 +95,7 @@ def resolveCldr(text):
CLDRVersion.CLDR43: [ICUVersion.ICU73],
CLDRVersion.CLDR44: [ICUVersion.ICU74],
CLDRVersion.CLDR45: [ICUVersion.ICU75],
CLDRVersion.CLDR46: [ICUVersion.ICU76],
}

# TODO: Can this be added to a configuration file?
Expand Down Expand Up @@ -402,6 +405,12 @@ def has(self, exec):
CLDRVersion.CLDR45, versionICU=ICUVersion.ICU75,
env={'LD_LIBRARY_PATH': '/tmp/icu/icu/usr/local/lib', 'PATH': '/tmp/icu75/bin'})

allExecutors.addSystem(
system, CppVersion.Cpp,
'../executors/cpp/executor',
CLDRVersion.CLDR46, versionICU=ICUVersion.ICU76,
env={'LD_LIBRARY_PATH': '/tmp/icu/icu/usr/local/lib', 'PATH': '/tmp/icu76/bin'})

system = 'newLanguage'
allExecutors.addSystem(system, '0.1.0',
'/bin/newExecutor',
Expand All @@ -418,6 +427,10 @@ def has(self, exec):
'java -jar ../executors/icu4j/74/executor-icu4j/target/executor-icu4j-1.0-SNAPSHOT-shaded.jar',
CLDRVersion.CLDR45, versionICU=ICUVersion.ICU75)

allExecutors.addSystem(system, '76',
'java -jar ../executors/icu4j/74/executor-icu4j/target/executor-icu4j-1.0-SNAPSHOT-shaded.jar',
CLDRVersion.CLDR46, versionICU=ICUVersion.ICU76)

system = ExecutorLang.DARTWEB.value
allExecutors.addSystem(system, NodeVersion.Node19,
'node ../executors/dart_web/out/executor.js',
Expand All @@ -426,7 +439,7 @@ def has(self, exec):
allExecutors.addSystem(system, NodeVersion.Node18_7,
'node ../executors/dart_web/out/executor.js',
CLDRVersion.CLDR41, versionICU=ICUVersion.ICU71)

system = ExecutorLang.DARTNATIVE.value
allExecutors.addSystem(system, DartVersion.Dart3,
'../executors/dart_native/bin/executor/executor.exe',
Expand Down
Loading

0 comments on commit 18653e9

Please sign in to comment.