| Index: base/android/jni_generator/jni_generator_tests.py
|
| diff --git a/base/android/jni_generator/jni_generator_tests.py b/base/android/jni_generator/jni_generator_tests.py
|
| index e29bc0cc46d48b8dc82d16f17451514d52db2355..60148470b31f0ec28d7e7bf7368b9b8b7e79e9b2 100755
|
| --- a/base/android/jni_generator/jni_generator_tests.py
|
| +++ b/base/android/jni_generator/jni_generator_tests.py
|
| @@ -13,6 +13,7 @@ file.
|
|
|
| import difflib
|
| import inspect
|
| +import optparse
|
| import os
|
| import sys
|
| import unittest
|
| @@ -1148,5 +1149,27 @@ class Foo {
|
| self.assertGoldenTextEquals(jni_from_java.GetContent())
|
|
|
|
|
| +def TouchStamp(stamp_path):
|
| + dir_name = os.path.dirname(stamp_path)
|
| + if not os.path.isdir(dir_name):
|
| + os.makedirs()
|
| +
|
| + with open(stamp_path, 'a'):
|
| + os.utime(stamp_path, None)
|
| +
|
| +
|
| +def main(argv):
|
| + parser = optparse.OptionParser()
|
| + parser.add_option('--stamp', help='Path to touch on success.')
|
| + options, _ = parser.parse_args(argv[1:])
|
| +
|
| + test_result = unittest.main(argv=argv[0:1], exit=False)
|
| +
|
| + if test_result.result.wasSuccessful() and options.stamp:
|
| + TouchStamp(options.stamp)
|
| +
|
| + return not test_result.result.wasSuccessful()
|
| +
|
| +
|
| if __name__ == '__main__':
|
| - unittest.main()
|
| + sys.exit(main(sys.argv))
|
|
|