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

Side by Side Diff: test/mjsunit/testcfg.py

Issue 1332463002: Follow symlinks in test/mjsunit to allow linked test directories. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 # Copyright 2008 the V8 project authors. All rights reserved. 1 # Copyright 2008 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 27 matching lines...) Expand all
38 NO_HARNESS_PATTERN = re.compile(r"^// NO HARNESS$", flags=re.MULTILINE) 38 NO_HARNESS_PATTERN = re.compile(r"^// NO HARNESS$", flags=re.MULTILINE)
39 39
40 40
41 class MjsunitTestSuite(testsuite.TestSuite): 41 class MjsunitTestSuite(testsuite.TestSuite):
42 42
43 def __init__(self, name, root): 43 def __init__(self, name, root):
44 super(MjsunitTestSuite, self).__init__(name, root) 44 super(MjsunitTestSuite, self).__init__(name, root)
45 45
46 def ListTests(self, context): 46 def ListTests(self, context):
47 tests = [] 47 tests = []
48 for dirname, dirs, files in os.walk(self.root): 48 for dirname, dirs, files in os.walk(self.root, followlinks=True):
49 for dotted in [x for x in dirs if x.startswith('.')]: 49 for dotted in [x for x in dirs if x.startswith('.')]:
50 dirs.remove(dotted) 50 dirs.remove(dotted)
51 dirs.sort() 51 dirs.sort()
52 files.sort() 52 files.sort()
53 for filename in files: 53 for filename in files:
54 if filename.endswith(".js") and filename != "mjsunit.js": 54 if filename.endswith(".js") and filename != "mjsunit.js":
55 testname = os.path.join(dirname[len(self.root) + 1:], filename[:-3]) 55 testname = os.path.join(dirname[len(self.root) + 1:], filename[:-3])
56 test = testcase.TestCase(self, testname) 56 test = testcase.TestCase(self, testname)
57 tests.append(test) 57 tests.append(test)
58 return tests 58 return tests
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return testcase.flags + flags 95 return testcase.flags + flags
96 96
97 def GetSourceForTest(self, testcase): 97 def GetSourceForTest(self, testcase):
98 filename = os.path.join(self.root, testcase.path + self.suffix()) 98 filename = os.path.join(self.root, testcase.path + self.suffix())
99 with open(filename) as f: 99 with open(filename) as f:
100 return f.read() 100 return f.read()
101 101
102 102
103 def GetSuite(name, root): 103 def GetSuite(name, root):
104 return MjsunitTestSuite(name, root) 104 return MjsunitTestSuite(name, root)
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