| OLD | NEW |
| (Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 '''Unit tests for the 'grit build' tool. |
| 7 ''' |
| 8 |
| 9 import os |
| 10 import re |
| 11 import sys |
| 12 import tempfile |
| 13 if __name__ == '__main__': |
| 14 sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '../..')) |
| 15 |
| 16 import unittest |
| 17 |
| 18 from grit import util |
| 19 from grit.tool import build |
| 20 |
| 21 |
| 22 class BuildUnittest(unittest.TestCase): |
| 23 |
| 24 def testFindTranslationsWithSubstitutions(self): |
| 25 # This is a regression test; we had a bug where GRIT would fail to find |
| 26 # messages with substitutions e.g. "Hello [IDS_USER]" where IDS_USER is |
| 27 # another <message>. |
| 28 output_dir = tempfile.mkdtemp() |
| 29 builder = build.RcBuilder() |
| 30 class DummyOpts(object): |
| 31 def __init__(self): |
| 32 self.input = util.PathFromRoot('grit/testdata/substitute.grd') |
| 33 self.verbose = False |
| 34 self.extra_verbose = False |
| 35 builder.Run(DummyOpts(), ['-o', output_dir]) |
| 36 |
| 37 |
| 38 if __name__ == '__main__': |
| 39 unittest.main() |
| OLD | NEW |