Skip to content

Commit

Permalink
Add generated CLDR test data for locale display names for ICU v73-75 (#…
Browse files Browse the repository at this point in the history
…286)

* Add generated CLDR test data for locale display names for ICU v73-75

* Improve docs about test generation, esp for locale display names
  • Loading branch information
echeran authored Aug 20, 2024
1 parent 806f49e commit e35ad94
Show file tree
Hide file tree
Showing 4 changed files with 9,207 additions and 1 deletion.
45 changes: 44 additions & 1 deletion testgen/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# testgen
# testgen - Test Data Generators

Test data generation is about converting test data from its original form into JSON conforming to a schema that we design for that functionality component.

The process of test data generation (for a particular component of functionality) entails:

1. Finding the original source test data
2. Creating a JSON schema that is appropriate for the particular functionality component
3. Creating code to convert the original format to the new JSON format to be used by DDT

## Usage

Generate all test data:
```sh
Expand All @@ -14,3 +24,36 @@ Show all options:
```sh
python testdata_gen.py --help
```

## Prerequisites

For some components, obtaining the original source test data requires manual work.
The following document some of those manual steps required:

### Locale Display Names (aka lang_names)

The code to generate locale display names test data was
[merged into CLDR after CLDR v45](https://github.com/unicode-org/cldr/pull/3728).

In order to retroactively apply the test generator code to older versions of CLDR,
the following steps can be employed for a specific version of CLDR:

1. checkout snapshot of old CLDR version
```
git co release-43 -b release-43-ddt-datagen
```
2. pull backwards the current desired version of the test data generator
```
git checkout main -- tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateLocaleIDTestData.java
```
3. compile and run the generator from the right spot
```
pushd tools/cldr-code
mvn compile exec:java -DCLDR_DIR=/usr/local/google/home/elango/oss/cldr/mine/src -Dexec.mainClass=org.unicode.cldr.tool.GenerateLocaleIDTestData
popd
```
4. copy the generated test data file to the Conformance repo
```
cp ./common/testData/localeIdentifiers/localeDisplayName.txt ~/oss/conformance/testgen/icu73
```

Loading

0 comments on commit e35ad94

Please sign in to comment.