1--- 2title: Running Tests 3--- 4 5# Running Tests 6 7You will always need to run tests when you do a check\-in. 8 91. Preconditions 10 - If you change the DTD, be sure to read and follow [Updating DTDs](https://cldr.unicode.org/development/updating-dtds) first. 11 - If you added a new feature or fixed a significant bug, add a unit test for it. 12 - See unittest/NumberingSystemsTest as an example. 13 - Remember to add to unittest/TestAll 142. Run **TestAll \-e** 15 - These are the unit tests in exhaustive mode 16 - If you are doing something you know to be simple, you could do the shorter run of just **TestAll** 173. Run **ConsoleCheckCLDR \-e \-z final\_testing \-S common,seed** 18 - This runs the same set of test that the Survey Tool does. 19 - If you know what you are doing, you can run a set of filtered tests. 204. Other tests 21 1. The unit tests are not complete, so you get a better workout if you are doing anything fancy by running: 22 2. [**NewLdml2IcuConverter**](https://cldr.unicode.org/development/coding-cldr-tools/newldml2icuconverter) 23 3. [**Generating Charts**](https://cldr.unicode.org/development/cldr-big-red-switch/generating-charts) 24 1. If you have interesting new data, write a chart for it. See subclasses of Chart.java for examples. 25 26## Running tests on the command line 27 28```bash 29$ export CLDR_DIR=/path/to/svn/root/for/cldr 30 31$ cd $CLDR_DIR/tools/java && ant all 32 33$ cd $CLDR_DIR/tools/cldr-unittest && ant unittestExhaustive datacheck 34``` 35 36\[TODO: add more commands here; can't we automate all this into a single build rule for ant?] TODO: [TODOL ticket:8864](http://unicode.org/cldr/trac/ticket/8864) 37 38## Debugging 39 40\[TODO: add more tips here] 41 42### Regexes 43 44We use a lot of regexes! 45 461. There is org.unicode.cldr.util.RegexUtilities.showMismatch (and related methods) that are really useful in debugging cases where regexes fail. You hand it a pattern or matcher and a string, and it shows how far the regex got before it failed. 472. To debug RegexLookup, there is a special call you can make where you pass in a set. On return, that set is filled with a set of strings showing how far each of the regex patterns progressed. You can thus see why a string didn't match as expected. 48 49