OLD | NEW |
| (Empty) |
1 # Copyright 2014 the V8 project authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 | |
6 import os | |
7 import sys | |
8 | |
9 from testrunner.local import testsuite | |
10 from testrunner.objects import testcase | |
11 | |
12 SIMDJS_SUITE_PATH = ["data", "src"] | |
13 | |
14 | |
15 class SimdJsTestSuite(testsuite.TestSuite): | |
16 | |
17 def __init__(self, name, root): | |
18 super(SimdJsTestSuite, self).__init__(name, root) | |
19 self.testroot = os.path.join(self.root, *SIMDJS_SUITE_PATH) | |
20 self.ParseTestRecord = None | |
21 | |
22 def ListTests(self, context): | |
23 tests = [ | |
24 testcase.TestCase(self, 'shell_test_runner'), | |
25 ] | |
26 for filename in os.listdir(os.path.join(self.testroot, 'benchmarks')): | |
27 if (not filename.endswith('.js') or | |
28 filename in ['run.js', 'run_browser.js', 'base.js']): | |
29 continue | |
30 name = filename.rsplit('.')[0] | |
31 tests.append( | |
32 testcase.TestCase(self, 'benchmarks/' + name)) | |
33 return tests | |
34 | |
35 def GetFlagsForTestCase(self, testcase, context): | |
36 return (testcase.flags + context.mode_flags + | |
37 [os.path.join(self.root, "harness-adapt.js"), | |
38 "--harmony", "--harmony-simd", | |
39 os.path.join(self.testroot, testcase.path + ".js"), | |
40 os.path.join(self.root, "harness-finish.js")]) | |
41 | |
42 def GetSourceForTest(self, testcase): | |
43 filename = os.path.join(self.testroot, testcase.path + ".js") | |
44 with open(filename) as f: | |
45 return f.read() | |
46 | |
47 def IsNegativeTest(self, testcase): | |
48 return False | |
49 | |
50 def IsFailureOutput(self, testcase): | |
51 if testcase.output.exit_code != 0: | |
52 return True | |
53 return "FAILED!" in testcase.output.stdout | |
54 | |
55 | |
56 def GetSuite(name, root): | |
57 return SimdJsTestSuite(name, root) | |
OLD | NEW |