OLD | NEW |
1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
2 | 2 |
3 import argparse | 3 import argparse |
4 import ConfigParser | 4 import ConfigParser |
5 import os | 5 import os |
6 import shutil | 6 import shutil |
7 import sys | 7 import sys |
8 | 8 |
9 from utils import shellcmd | 9 from utils import shellcmd |
10 from utils import FindBaseNaCl | 10 from utils import FindBaseNaCl |
11 | 11 |
12 def Match(desc, includes, excludes, default_match): | 12 def Match(desc, includes, excludes, default_match): |
13 """Determines whether desc is a match against includes and excludes. | 13 """Determines whether desc is a match against includes and excludes. |
14 | 14 |
15 'desc' is a set of attributes, and 'includes' and 'excludes' are lists of sets | 15 'desc' is a set of attributes, and 'includes' and 'excludes' are lists of sets |
16 of attributes. | 16 of attributes. |
17 | 17 |
18 If 'desc' matches any element from 'excludes', the result is False. | 18 If 'desc' matches any element from 'excludes', the result is False. |
19 Otherwise, if 'desc' matches any element from 'includes', the result is True. | 19 Otherwise, if 'desc' matches any element from 'includes', the result is True. |
20 Otherwise, the 'default_match' value is returned. | 20 Otherwise, the 'default_match' value is returned. |
21 """ | 21 """ |
22 for exclude in excludes: | 22 for exclude in excludes: |
23 if exclude < desc: | 23 if exclude <= desc: |
24 return False | 24 return False |
25 for include in includes: | 25 for include in includes: |
26 if include < desc: | 26 if include <= desc: |
27 return True | 27 return True |
28 return default_match | 28 return default_match |
29 | 29 |
30 def main(): | 30 def main(): |
31 """Framework for cross test generation and execution. | 31 """Framework for cross test generation and execution. |
32 | 32 |
33 Builds and executes cross tests from the space of all possible attribute | 33 Builds and executes cross tests from the space of all possible attribute |
34 combinations. The space can be restricted by providing subsets of attributes | 34 combinations. The space can be restricted by providing subsets of attributes |
35 to specifically include or exclude. | 35 to specifically include or exclude. |
36 """ | 36 """ |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 echo=args.verbose) | 156 echo=args.verbose) |
157 if (args.defer): | 157 if (args.defer): |
158 deferred_cmds.append(run_cmd) | 158 deferred_cmds.append(run_cmd) |
159 else: | 159 else: |
160 shellcmd(run_cmd, echo=True) | 160 shellcmd(run_cmd, echo=True) |
161 for run_cmd in deferred_cmds: | 161 for run_cmd in deferred_cmds: |
162 shellcmd(run_cmd, echo=True) | 162 shellcmd(run_cmd, echo=True) |
163 | 163 |
164 if __name__ == '__main__': | 164 if __name__ == '__main__': |
165 main() | 165 main() |
OLD | NEW |