Show More
@@ -0,0 +1,4 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | # Testing that hghave does not crash when checking features | |||
|
3 | ||||
|
4 | "$TESTDIR/hghave" --test-features 2>/dev/null |
1 | NO CONTENT: new file 100644 |
|
NO CONTENT: new file 100644 |
@@ -190,7 +190,20 b' def list_features():' | |||||
190 | desc = feature[1] |
|
190 | desc = feature[1] | |
191 | print name + ':', desc |
|
191 | print name + ':', desc | |
192 |
|
192 | |||
|
193 | def test_features(): | |||
|
194 | failed = 0 | |||
|
195 | for name, feature in checks.iteritems(): | |||
|
196 | check, _ = feature | |||
|
197 | try: | |||
|
198 | check() | |||
|
199 | except Exception, e: | |||
|
200 | print "feature %s failed: %s" % (name, e) | |||
|
201 | failed += 1 | |||
|
202 | return failed | |||
|
203 | ||||
193 | parser = optparse.OptionParser("%prog [options] [features]") |
|
204 | parser = optparse.OptionParser("%prog [options] [features]") | |
|
205 | parser.add_option("--test-features", action="store_true", | |||
|
206 | help="test available features") | |||
194 | parser.add_option("--list-features", action="store_true", |
|
207 | parser.add_option("--list-features", action="store_true", | |
195 | help="list available features") |
|
208 | help="list available features") | |
196 | parser.add_option("-q", "--quiet", action="store_true", |
|
209 | parser.add_option("-q", "--quiet", action="store_true", | |
@@ -202,6 +215,9 b" if __name__ == '__main__':" | |||||
202 | list_features() |
|
215 | list_features() | |
203 | sys.exit(0) |
|
216 | sys.exit(0) | |
204 |
|
217 | |||
|
218 | if options.test_features: | |||
|
219 | sys.exit(test_features()) | |||
|
220 | ||||
205 | quiet = options.quiet |
|
221 | quiet = options.quiet | |
206 |
|
222 | |||
207 | failures = 0 |
|
223 | failures = 0 |
General Comments 0
You need to be logged in to leave comments.
Login now