OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 18 matching lines...) Expand all Loading... |
29 import os | 29 import os |
30 from os.path import exists | 30 from os.path import exists |
31 from os.path import isdir | 31 from os.path import isdir |
32 from os.path import join | 32 from os.path import join |
33 import platform | 33 import platform |
34 import re | 34 import re |
35 import urllib2 | 35 import urllib2 |
36 | 36 |
37 | 37 |
38 def GetSuitePaths(test_root): | 38 def GetSuitePaths(test_root): |
39 return [ f for f in os.listdir(test_root) if isdir(join(test_root, f)) ] | 39 def IsSuite(path): |
| 40 return isdir(path) and exists(join(path, 'testcfg.py')) |
| 41 return [ f for f in os.listdir(test_root) if IsSuite(join(test_root, f)) ] |
40 | 42 |
41 | 43 |
42 # Reads a file into an array of strings | 44 # Reads a file into an array of strings |
43 def ReadLinesFrom(name): | 45 def ReadLinesFrom(name): |
44 lines = [] | 46 lines = [] |
45 with open(name) as f: | 47 with open(name) as f: |
46 for line in f: | 48 for line in f: |
47 if line.startswith('#'): continue | 49 if line.startswith('#'): continue |
48 if '#' in line: | 50 if '#' in line: |
49 line = line[:line.find('#')] | 51 line = line[:line.find('#')] |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 def IsWindows(): | 115 def IsWindows(): |
114 return GuessOS() == 'windows' | 116 return GuessOS() == 'windows' |
115 | 117 |
116 | 118 |
117 def URLRetrieve(source, destination): | 119 def URLRetrieve(source, destination): |
118 """urllib is broken for SSL connections via a proxy therefore we | 120 """urllib is broken for SSL connections via a proxy therefore we |
119 can't use urllib.urlretrieve().""" | 121 can't use urllib.urlretrieve().""" |
120 with open(destination, 'w') as f: | 122 with open(destination, 'w') as f: |
121 f.write(urllib2.urlopen(source).read()) | 123 f.write(urllib2.urlopen(source).read()) |
OLD | NEW |