[cfe-commits] r152333 - /cfe/trunk/utils/FuzzTest
Argyrios Kyrtzidis
akyrtzi at gmail.com
Thu Mar 8 12:29:39 PST 2012
Author: akirtzidis
Date: Thu Mar 8 14:29:39 2012
New Revision: 152333
URL: http://llvm.org/viewvc/llvm-project?rev=152333&view=rev
Log:
[utils/FuzzTest] Add '--stop-on-fail' to stop the script on the first failure
without reverting the changes.
Modified:
cfe/trunk/utils/FuzzTest
Modified: cfe/trunk/utils/FuzzTest
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/FuzzTest?rev=152333&r1=152332&r2=152333&view=diff
==============================================================================
--- cfe/trunk/utils/FuzzTest (original)
+++ cfe/trunk/utils/FuzzTest Thu Mar 8 14:29:39 2012
@@ -156,6 +156,7 @@
print 'FAIL: %d' % index
elif not opts.succinct:
print 'PASS: %d' % index
+ return test_result
def main():
global opts
@@ -194,6 +195,10 @@
By default, the script will run forever continually picking new tests to
run. You can limit the number of tests that are run with '--max-tests <number>',
and you can run a particular test with '--test <index>'.
+
+You can specify '--stop-on-fail' to stop the script on the first failure
+without reverting the changes.
+
""")
parser.add_option("-v", "--verbose", help="Show more output",
action='store_true', dest="verbose", default=False)
@@ -244,6 +249,8 @@
action='store_false', dest="enable_replace", default=True)
group.add_option("", "--no-revert", help="Don't revert changes",
action='store_false', dest="revert", default=True)
+ group.add_option("", "--stop-on-fail", help="Stop on first failure",
+ action='store_true', dest="stop_on_fail", default=False)
parser.add_option_group(group)
group = OptionGroup(parser, "Test Selection")
@@ -329,7 +336,10 @@
ta = TestApplication(tg, t)
try:
ta.apply()
- run_one_test(ta, test, input_files, args)
+ test_result = run_one_test(ta, test, input_files, args)
+ if not test_result and opts.stop_on_fail:
+ opts.revert = False
+ sys.exit(1)
finally:
if opts.revert:
ta.revert()
More information about the cfe-commits
mailing list