Show More
@@ -1,6 +1,7 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """Test the running system for features availability. Exit with zero |
|
3 | if all features are there, non-zero otherwise. | |
|
3 | if all features are there, non-zero otherwise. If a feature name is | |
|
4 | prefixed with "no-", the absence of feature is tested. | |
|
4 | 5 | """ |
|
5 | 6 | import optparse |
|
6 | 7 | import os |
@@ -67,13 +68,19 b" if __name__ == '__main__':" | |||
|
67 | 68 | failures += 1 |
|
68 | 69 | |
|
69 | 70 | for feature in args: |
|
71 | negate = feature.startswith('no-') | |
|
72 | if negate: | |
|
73 | feature = feature[3:] | |
|
74 | ||
|
70 | 75 | if feature not in checks: |
|
71 | 76 | error('hghave: unknown feature: ' + feature) |
|
72 | 77 | continue |
|
73 | 78 | |
|
74 | 79 | check, desc = checks[feature] |
|
75 | if not check(): | |
|
80 | if not negate and not check(): | |
|
76 | 81 | error('hghave: missing feature: ' + desc) |
|
82 | elif negate and check(): | |
|
83 | error('hghave: unexpected feature: ' + desc) | |
|
77 | 84 | |
|
78 | 85 | if failures != 0: |
|
79 | 86 | sys.exit(1) |
General Comments 0
You need to be logged in to leave comments.
Login now