# HG changeset patch # User Nicolas Dumazet # Date 1239125640 -32400 # Node ID 41a2c5cbcb6a9afc95ec045026b9cdda34088b89 # Parent a0555ae394b3b3d955b10f056fc9a4b03b7c882b hghave: checking that all targets are Exception-free diff -r a0555ae394b3 -r 41a2c5cbcb6a tests/hghave --- a/tests/hghave Sat Apr 11 21:58:28 2009 +0200 +++ b/tests/hghave Wed Apr 08 02:34:00 2009 +0900 @@ -190,7 +190,20 @@ desc = feature[1] print name + ':', desc +def test_features(): + failed = 0 + for name, feature in checks.iteritems(): + check, _ = feature + try: + check() + except Exception, e: + print "feature %s failed: %s" % (name, e) + failed += 1 + return failed + parser = optparse.OptionParser("%prog [options] [features]") +parser.add_option("--test-features", action="store_true", + help="test available features") parser.add_option("--list-features", action="store_true", help="list available features") parser.add_option("-q", "--quiet", action="store_true", @@ -202,6 +215,9 @@ list_features() sys.exit(0) + if options.test_features: + sys.exit(test_features()) + quiet = options.quiet failures = 0 diff -r a0555ae394b3 -r 41a2c5cbcb6a tests/test-hghave --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hghave Wed Apr 08 02:34:00 2009 +0900 @@ -0,0 +1,4 @@ +#!/bin/sh +# Testing that hghave does not crash when checking features + +"$TESTDIR/hghave" --test-features 2>/dev/null diff -r a0555ae394b3 -r 41a2c5cbcb6a tests/test-hghave.out