summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/grit/grit/format/rc_unittest.py8
-rw-r--r--tools/grit/grit/gather/policy_json_unittest.py9
-rw-r--r--tools/grit/grit/test_suite_all.py7
3 files changed, 10 insertions, 14 deletions
diff --git a/tools/grit/grit/format/rc_unittest.py b/tools/grit/grit/format/rc_unittest.py
index 0599baa..976b71c 100644
--- a/tools/grit/grit/format/rc_unittest.py
+++ b/tools/grit/grit/format/rc_unittest.py
@@ -1,5 +1,5 @@
-#!/usr/bin/python2.4
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+#!/usr/bin/env python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -185,7 +185,7 @@ END'''.strip()
def testRcIncludeFlattenedHtmlFile(self):
input_file = util.PathFromRoot('grit/test/data/include_test.html')
- output_file = '%s/include_test.html' % tempfile.gettempdir()
+ output_file = '%s/HTML_FILE1_include_test.html' % tempfile.gettempdir()
root = grd_reader.Parse(StringIO.StringIO('''
<includes>
<include name="HTML_FILE1" flattenhtml="true" file="%s" type="BINDATA" />
@@ -197,7 +197,7 @@ END'''.strip()
buf)
output = buf.getvalue()
- expected = u'HTML_FILE1 BINDATA "include_test.html"'
+ expected = u'HTML_FILE1 BINDATA "HTML_FILE1_include_test.html"'
# hackety hack to work on win32&lin
output = re.sub('"[c-zC-Z]:', '"', output)
self.failUnless(output.strip() == expected)
diff --git a/tools/grit/grit/gather/policy_json_unittest.py b/tools/grit/grit/gather/policy_json_unittest.py
index 9f141d6..9ebddb8 100644
--- a/tools/grit/grit/gather/policy_json_unittest.py
+++ b/tools/grit/grit/gather/policy_json_unittest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.4
+#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -25,7 +25,7 @@ class PolicyJsonUnittest(unittest.TestCase):
return expected
def testEmpty(self):
- original = "{'policy_definitions': [], 'placeholders': [], 'messages': {}}"
+ original = "{'policy_definitions': [], 'messages': {}}"
gatherer = policy_json.PolicyJson(original)
gatherer.Parse()
self.failUnless(len(gatherer.GetCliques()) == 0)
@@ -46,7 +46,6 @@ class PolicyJsonUnittest(unittest.TestCase):
" 'label': 'nothing special 3',"
" },"
" ],"
- " 'placeholders': [],"
" 'messages': {"
" 'msg_identifier': {"
" 'text': 'nothing special 3',"
@@ -74,7 +73,6 @@ class PolicyJsonUnittest(unittest.TestCase):
" ]"
" },"
" ],"
- " 'placeholders': [],"
" 'messages': {}"
"}")
gatherer = policy_json.PolicyJson(original)
@@ -96,7 +94,6 @@ class PolicyJsonUnittest(unittest.TestCase):
" ]"
" },"
" ],"
- " 'placeholders': [],"
" 'messages': {}"
"}")
gatherer = policy_json.PolicyJson(original)
@@ -108,7 +105,6 @@ class PolicyJsonUnittest(unittest.TestCase):
def testEscapingAndLineBreaks(self):
original = """{
'policy_definitions': [],
- 'placeholders': [],
'messages': {
'msg1': {
# The following line will contain two backslash characters when it
@@ -158,7 +154,6 @@ with a newline?''',
<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.''',
},
],
- 'placeholders': [],
'messages': {}
}"""
gatherer = policy_json.PolicyJson(original)
diff --git a/tools/grit/grit/test_suite_all.py b/tools/grit/grit/test_suite_all.py
index df11bf0..e0f9b77 100644
--- a/tools/grit/grit/test_suite_all.py
+++ b/tools/grit/grit/test_suite_all.py
@@ -1,5 +1,5 @@
-#!/usr/bin/python2.4
-# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+#!/usr/bin/env python
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -85,4 +85,5 @@ class TestSuiteAll(unittest.TestSuite):
if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(TestSuiteAll())
+ test_result = unittest.TextTestRunner(verbosity=2).run(TestSuiteAll())
+ sys.exit(len(test_result.errors) + len(test_result.failures))