Revision f230a1cf deps/v8/tools/testrunner/local/statusfile.py

View differences:

deps/v8/tools/testrunner/local/statusfile.py
26 26
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27

  
28 28

  
29
# These imports are required for the on-demand conversion from
30
# old to new status file format.
31
from os.path import exists
32
from os.path import getmtime
33

  
34
from . import old_statusfile
35

  
36

  
37 29
# These outcomes can occur in a TestCase's outcomes list:
38 30
SKIP = "SKIP"
39 31
FAIL = "FAIL"
......
43 35
CRASH = "CRASH"
44 36
SLOW = "SLOW"
45 37
FLAKY = "FLAKY"
38
NO_VARIANTS = "NO_VARIANTS"
46 39
# These are just for the status files and are mapped below in DEFS:
47 40
FAIL_OK = "FAIL_OK"
48 41
PASS_OR_FAIL = "PASS_OR_FAIL"
......
51 44

  
52 45
KEYWORDS = {}
53 46
for key in [SKIP, FAIL, PASS, OKAY, TIMEOUT, CRASH, SLOW, FLAKY, FAIL_OK,
54
            PASS_OR_FAIL, ALWAYS]:
47
            NO_VARIANTS, PASS_OR_FAIL, ALWAYS]:
55 48
  KEYWORDS[key] = key
56 49

  
57 50
DEFS = {FAIL_OK: [FAIL, OKAY],
......
60 53
# Support arches, modes to be written as keywords instead of strings.
61 54
VARIABLES = {ALWAYS: True}
62 55
for var in ["debug", "release", "android_arm", "android_ia32", "arm", "ia32",
63
            "mipsel", "x64", "nacl_ia32", "nacl_x64"]:
56
            "mipsel", "x64", "nacl_ia32", "nacl_x64", "macos", "windows",
57
            "linux"]:
64 58
  VARIABLES[var] = var
65 59

  
66 60

  
......
68 62
  return SKIP in outcomes or SLOW in outcomes
69 63

  
70 64

  
65
def OnlyStandardVariant(outcomes):
66
  return NO_VARIANTS in outcomes
67

  
68

  
71 69
def IsFlaky(outcomes):
72 70
  return FLAKY in outcomes
73 71

  
......
116 114

  
117 115

  
118 116
def ReadStatusFile(path, variables):
119
  # As long as the old-format .status files are authoritative, just
120
  # create the converted version on demand and cache it to speed up
121
  # subsequent runs.
122
  if path.endswith(".status"):
123
    newpath = path + "2"
124
    if not exists(newpath) or getmtime(newpath) < getmtime(path):
125
      print "Converting status file."
126
      converted = old_statusfile.ConvertNotation(path).GetOutput()
127
      with open(newpath, 'w') as f:
128
        f.write(converted)
129
    path = newpath
130

  
131 117
  with open(path) as f:
132 118
    global KEYWORDS
133 119
    contents = eval(f.read(), KEYWORDS)

Also available in: Unified diff