--- a/tests/hghave Wed Aug 08 22:47:30 2007 +0200
+++ b/tests/hghave Wed Aug 08 23:07:39 2007 +0200
@@ -1,6 +1,7 @@
#!/usr/bin/env python
"""Test the running system for features availability. Exit with zero
-if all features are there, non-zero otherwise.
+if all features are there, non-zero otherwise. If a feature name is
+prefixed with "no-", the absence of feature is tested.
"""
import optparse
import os
@@ -67,13 +68,19 @@
failures += 1
for feature in args:
+ negate = feature.startswith('no-')
+ if negate:
+ feature = feature[3:]
+
if feature not in checks:
error('hghave: unknown feature: ' + feature)
continue
check, desc = checks[feature]
- if not check():
+ if not negate and not check():
error('hghave: missing feature: ' + desc)
+ elif negate and check():
+ error('hghave: unexpected feature: ' + desc)
if failures != 0:
sys.exit(1)