Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: pydir/crosstest_generator.py

Issue 1020473002: Subzero: Fix a bug in cross test generation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698