tests/test-i18n.t
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 14 Jan 2016 13:44:01 -0800
changeset 27897 2fdbf22a1b63
parent 26252 a3edce86f430
child 30963 a0e4df5a4d5d
permissions -rw-r--r--
streamclone: use backgroundfilecloser (issue4889) Closing files that have been appended to is slow on Windows/NTFS. CloseHandle() calls on this platform often take 1-10ms - and that's on my i7-6700K Skylake processor with a modern and fast SSD. Contrast with other I/O operations, such as writing data, which take <100us. This means that creating/appending thousands of files can add significant overhead. For example, cloning mozilla-central creates ~232,000 revlog files. Assuming 1ms per CloseHandle(), that yields 232s (3:52) of wall time waiting for file closes! The impact of this overhead can be measured most directly when applying stream clone bundles. Applying these files is effectively uncompressing a tar archive (read: it's very fast). Using a RAM disk (read: no I/O wait), the difference in wall time for a `hg debugapplystreamclonebundle` for a ~1731 MB mozilla-central bundle between Windows and Linux from the same machine is drastic: Linux: ~12.8s (128MB/s) Windows: ~352.0s (4.7MB/s) Windows is ~27.5x slower. Yikes! After this patch: Linux: ~12.8s (128MB/s) Windows: ~102.1s (16.1MB/s) Windows is now ~3.4x faster. Unfortunately, it is still ~8x slower than Linux. Profiling reveals a few hot code paths that could likely be improved. But those are for other patches. This patch introduces test-clone-uncompressed.t because existing tests of `clone --uncompressed` are scattered about and adding a variation for background thread closing to e.g. test-http.t doesn't feel correct.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22046
7a9cbb315d84 tests: replace exit 80 with #require
Matt Mackall <mpm@selenic.com>
parents: 21024
diff changeset
     1
(Translations are optional)
13442
bb107a31820e test-i18n: make test conditional on msgfmt availability
Martin Geisler <mg@lazybytes.net>
parents: 13414
diff changeset
     2
26252
a3edce86f430 test-i18n: always run non gettext tests
timeless@mozdev.org
parents: 22046
diff changeset
     3
#if gettext no-outer-repo
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16981
diff changeset
     4
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     5
Test that translations are compiled and installed correctly.
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     6
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     7
Default encoding in tests is "ascii" and the translation is encoded
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     8
using the "replace" error handler:
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
     9
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    10
  $ LANGUAGE=pt_BR hg tip
14920
56848e2bb0c5 test-i18n, i18n-pt_BR: updated test message changed in 41c3a71c318d
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 14914
diff changeset
    11
  abortado: n?o foi encontrado um reposit?rio em '$TESTTMP' (.hg n?o encontrado)!
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    12
  [255]
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    13
21024
7731a2281cf0 spelling: fixes from spell checker
Mads Kiilerich <madski@unity3d.com>
parents: 20338
diff changeset
    14
Using a more accommodating encoding:
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    15
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    16
  $ HGENCODING=UTF-8 LANGUAGE=pt_BR hg tip
14920
56848e2bb0c5 test-i18n, i18n-pt_BR: updated test message changed in 41c3a71c318d
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 14914
diff changeset
    17
  abortado: n\xc3\xa3o foi encontrado um reposit\xc3\xb3rio em '$TESTTMP' (.hg n\xc3\xa3o encontrado)! (esc)
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    18
  [255]
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    19
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    20
Different encoding:
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    21
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    22
  $ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip
14920
56848e2bb0c5 test-i18n, i18n-pt_BR: updated test message changed in 41c3a71c318d
Wagner Bruna <wbruna@softwareexpress.com.br>
parents: 14914
diff changeset
    23
  abortado: n\xe3o foi encontrado um reposit\xf3rio em '$TESTTMP' (.hg n\xe3o encontrado)! (esc)
13414
a0e49e129151 test-i18n: test translations
Martin Geisler <mg@aragost.com>
parents:
diff changeset
    24
  [255]
16895
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    25
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16981
diff changeset
    26
#endif
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16981
diff changeset
    27
26252
a3edce86f430 test-i18n: always run non gettext tests
timeless@mozdev.org
parents: 22046
diff changeset
    28
#if gettext
a3edce86f430 test-i18n: always run non gettext tests
timeless@mozdev.org
parents: 22046
diff changeset
    29
16895
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    30
Test keyword search in translated help text:
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    31
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    32
  $ HGENCODING=UTF-8 LANGUAGE=de hg help -k blättern
20338
b9e7af5bd5e5 i18n-de: update many fuzzy entries and translate some simple ones
Simon Heimberg <simohe@besonet.ch>
parents: 20152
diff changeset
    33
  Themen:
16895
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    34
  
16981
2264e3e39cba tests: fix test-i18n.t after translation update
Mads Kiilerich <mads@kiilerich.com>
parents: 16895
diff changeset
    35
   extensions Benutzung erweiterter Funktionen
16895
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    36
  
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    37
  Erweiterungen:
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    38
  
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    39
   pager Verwendet einen externen Pager zum Bl\xc3\xa4ttern in der Ausgabe von Befehlen (esc)
430714e2a876 help: test keyword search in translated text.
Olav Reinert <seroton10@gmail.com>
parents: 14920
diff changeset
    40
26252
a3edce86f430 test-i18n: always run non gettext tests
timeless@mozdev.org
parents: 22046
diff changeset
    41
#endif
a3edce86f430 test-i18n: always run non gettext tests
timeless@mozdev.org
parents: 22046
diff changeset
    42
20152
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    43
Check Mercurial specific translation problems in each *.po files, and
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    44
tool itself by doctest
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    45
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    46
  $ cd "$TESTDIR"/../i18n
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    47
  $ python check-translation.py *.po
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    48
  $ python check-translation.py --doctest
84939b728749 i18n: add the tool to check Mercurial specific translation problems in *.po
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 17015
diff changeset
    49
  $ cd $TESTTMP