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 def IsSuite(path): | 39 return [ f for f in os.listdir(test_root) if isdir(join(test_root, f)) ] |
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)) ] | |
42 | 40 |
43 | 41 |
44 # Reads a file into an array of strings | 42 # Reads a file into an array of strings |
45 def ReadLinesFrom(name): | 43 def ReadLinesFrom(name): |
46 lines = [] | 44 lines = [] |
47 with open(name) as f: | 45 with open(name) as f: |
48 for line in f: | 46 for line in f: |
49 if line.startswith('#'): continue | 47 if line.startswith('#'): continue |
50 if '#' in line: | 48 if '#' in line: |
51 line = line[:line.find('#')] | 49 line = line[:line.find('#')] |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 112 |
115 def IsWindows(): | 113 def IsWindows(): |
116 return GuessOS() == 'windows' | 114 return GuessOS() == 'windows' |
117 | 115 |
118 | 116 |
119 def URLRetrieve(source, destination): | 117 def URLRetrieve(source, destination): |
120 """urllib is broken for SSL connections via a proxy therefore we | 118 """urllib is broken for SSL connections via a proxy therefore we |
121 can't use urllib.urlretrieve().""" | 119 can't use urllib.urlretrieve().""" |
122 with open(destination, 'w') as f: | 120 with open(destination, 'w') as f: |
123 f.write(urllib2.urlopen(source).read()) | 121 f.write(urllib2.urlopen(source).read()) |
OLD | NEW |