tests/hghave
changeset 8059 41a2c5cbcb6a
parent 7823 11efa41037e2
child 8060 84d0fe34427b
--- 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