Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(724)

Unified Diff: base/android/jni_generator/jni_generator_tests.py

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/jni_generator/jni_generator.gyp ('k') | base/android/jni_generator/sample_for_tests.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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))
« no previous file with comments | « base/android/jni_generator/jni_generator.gyp ('k') | base/android/jni_generator/sample_for_tests.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698