Remove deprecated test suite configurations.

R=jkummerow@chromium.org

Review URL: https://codereview.chromium.org/13878008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 76ed72bd
......@@ -29,7 +29,6 @@ shell_g
/obj
/out
/test/cctest/cctest.status2
/test/es5conform/data
/test/message/message.status2
/test/mjsunit/mjsunit.status2
/test/mozilla/CHECKED_OUT_VERSION
......@@ -37,7 +36,6 @@ shell_g
/test/mozilla/downloaded_*
/test/mozilla/mozilla.status2
/test/preparser/preparser.status2
/test/sputnik/sputniktests
/test/test262/data
/test/test262/test262-*
/test/test262/test262.status2
......
# Copyright 2011 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import test
import os
from os.path import join, split
def GetSuite(name, root):
# Not implemented.
return None
def IsNumber(string):
try:
float(string)
return True
except ValueError:
return False
class BenchmarkTestCase(test.TestCase):
def __init__(self, path, context, mode):
super(BenchmarkTestCase, self).__init__(context, split(path), mode)
self.root = path
def GetLabel(self):
return '%s benchmark %s' % (self.mode, self.GetName())
def IsFailureOutput(self, output):
if output.exit_code != 0:
return True
lines = output.stdout.splitlines()
for line in lines:
colon_index = line.find(':')
if colon_index >= 0:
if not IsNumber(line[colon_index+1:].strip()):
return True
return False
def GetCommand(self):
result = self.context.GetVmCommand(self, self.mode)
result.append(join(self.root, 'run.js'))
return result
def GetName(self):
return 'V8'
def BeforeRun(self):
os.chdir(self.root)
def AfterRun(self, result):
os.chdir(self.context.buildspace)
def GetSource(self):
return open(join(self.root, 'run.js')).read()
def GetCustomFlags(self, mode):
return []
class BenchmarkTestConfiguration(test.TestConfiguration):
def __init__(self, context, root):
super(BenchmarkTestConfiguration, self).__init__(context, root)
def ListTests(self, current_path, path, mode, variant_flags):
path = self.context.workspace
path = join(path, 'benchmarks')
test = BenchmarkTestCase(path, self.context, mode)
return [test]
def GetBuildRequirements(self):
return ['d8']
def GetTestStatus(self, sections, defs):
pass
def GetConfiguration(context, root):
return BenchmarkTestConfiguration(context, root)
This directory contains code for binding the es5conform test suite
into the v8 test harness. To use the tests check out the es5conform
tests from
https://es5conform.svn.codeplex.com/svn
in revision 71525 as 'data' in this directory. Using later version
may be possible but the tests are only known to pass (and indeed run)
with that revision.
If you do update to a newer revision you may have to change the test
harness adapter code since it uses internal functionality from the
harness that comes bundled with the tests. You will most likely also
have to update the test expectation file.
This diff is collapsed.
// Copyright 2009 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
var global = this;
function ES5Error(ut) {
this.ut = ut;
}
ES5Error.prototype.toString = function () {
return this.ut.res;
};
// The harness uses the IE specific .description property of exceptions but
// that's nothing we can't hack our way around.
Error.prototype.__defineGetter__('description', function () {
return this.message;
});
function TestHarness() {
sth.call(this, global);
this._testResults = []
}
// Borrow sth's registerTest method.
TestHarness.prototype.registerTest = sth.prototype.registerTest;
// Drop the before/after stuff, just run the test.
TestHarness.prototype.startTesting = function () {
sth.prototype.run.call(this);
this.report();
};
TestHarness.prototype.report = function () {
for (var i = 0; i < this._testResults.length; i++) {
var ut = this._testResults[i];
// We don't fail on preconditions. Yet.
if (ut.res == "Precondition failed")
continue;
if (ut.res != 'pass')
throw new ES5Error(ut);
}
};
TestHarness.prototype.startingTest = function (ut) {
this.currentTest = ut;
this._testResults.push(ut);
};
var ES5Harness = new TestHarness();
# Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import test
import os
from os.path import join, exists
def GetSuite(name, root):
# Not implemented.
return None
HARNESS_FILES = ['sth.js']
class ES5ConformTestCase(test.TestCase):
def __init__(self, filename, path, context, root, mode, framework):
super(ES5ConformTestCase, self).__init__(context, path, mode)
self.filename = filename
self.framework = framework
self.root = root
def IsNegative(self):
return self.filename.endswith('-n.js')
def GetLabel(self):
return "%s es5conform %s" % (self.mode, self.GetName())
def IsFailureOutput(self, output):
if output.exit_code != 0:
return True
return 'FAILED!' in output.stdout
def GetCommand(self):
result = self.context.GetVmCommand(self, self.mode)
result += ['-e', 'var window = this']
result += self.framework
result.append(self.filename)
result += ['-e', 'ES5Harness.startTesting()']
return result
def GetName(self):
return self.path[-1]
def GetSource(self):
return open(self.filename).read()
class ES5ConformTestConfiguration(test.TestConfiguration):
def __init__(self, context, root):
super(ES5ConformTestConfiguration, self).__init__(context, root)
def ListTests(self, current_path, path, mode, variant_flags):
tests = []
current_root = join(self.root, 'data', 'TestCases')
harness = []
harness += [join(self.root, 'data', 'SimpleTestHarness', f) for f in HARNESS_FILES]
harness += [join(self.root, 'harness-adapt.js')]
for root, dirs, files in os.walk(current_root):
for dotted in [x for x in dirs if x.startswith('.')]:
dirs.remove(dotted)
dirs.sort()
root_path = root[len(self.root):].split(os.path.sep)
root_path = current_path + [x for x in root_path if x]
files.sort()
for file in files:
if file.endswith('.js'):
full_path = root_path + [file[:-3]]
full_path = [x for x in full_path if not (x in ['data', 'TestCases'])]
if self.Contains(path, full_path):
test = ES5ConformTestCase(join(root, file), full_path, self.context,
self.root, mode, harness)
tests.append(test)
return tests
def GetBuildRequirements(self):
return ['d8']
def GetTestStatus(self, sections, defs):
status_file = join(self.root, 'es5conform.status')
if exists(status_file):
test.ReadConfigurationInto(status_file, sections, defs)
def GetConfiguration(context, root):
return ES5ConformTestConfiguration(context, root)
To run the sputniktests you must check out the test suite from
googlecode.com. The test expectations are currently relative to
version 97. To get the tests run the following command within
v8/test/sputnik/
svn co http://sputniktests.googlecode.com/svn/trunk/ -r97 sputniktests
# Copyright 2009 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
prefix sputnik
def FAIL_OK = FAIL, OKAY
############################### BUGS ###################################
# '__proto__' should be treated as a normal property in JSON.
S15.12.2_A1: FAIL
##################### DELIBERATE INCOMPATIBILITIES #####################
# This tests precision of trignometric functions. We're slightly off
# from the implementation in libc (~ 1e-17) but it's not clear if we
# or they are closer to the right answer, or if it even matters.
S15.8.2.16_A7: PASS || FAIL_OK
S15.8.2.18_A7: PASS || FAIL_OK
S15.8.2.13_A23: PASS || FAIL_OK
# Sputnik tests (r97) assume RegExp.prototype is an Object, not a RegExp.
S15.10.6_A2: FAIL_OK
# We are silent in some regexp cases where the spec wants us to give
# errors, for compatibility.
S15.10.2.11_A1_T2: FAIL
S15.10.2.11_A1_T3: FAIL
# We are more lenient in which string character escapes we allow than
# the spec (7.8.4 p. 19) wants us to be. This is for compatibility.
S7.8.4_A4.3_T1: FAIL_OK
S7.8.4_A4.3_T2: FAIL_OK
S7.8.4_A4.3_T3: FAIL_OK
S7.8.4_A4.3_T4: FAIL_OK
S7.8.4_A6.4_T1: FAIL_OK
S7.8.4_A6.4_T2: FAIL_OK
S7.8.4_A7.4_T1: FAIL_OK
S7.8.4_A7.4_T2: FAIL_OK
# Sputnik expects unicode escape sequences in RegExp flags to be interpreted.
# The specification requires them to be passed uninterpreted to the RegExp
# constructor. We now implement that.
S7.8.5_A3.1_T7: FAIL_OK
S7.8.5_A3.1_T8: FAIL_OK
S7.8.5_A3.1_T9: FAIL_OK
# We allow some keywords to be used as identifiers.
S7.5.3_A1.15: FAIL_OK
S7.5.3_A1.18: FAIL_OK
S7.5.3_A1.21: FAIL_OK
S7.5.3_A1.22: FAIL_OK
S7.5.3_A1.23: FAIL_OK
S7.5.3_A1.24: FAIL_OK
S7.5.3_A1.26: FAIL_OK
# This checks for non-262 behavior
S12.6.4_A14_T1: PASS || FAIL_OK
S12.6.4_R1: PASS || FAIL_OK
S12.6.4_R2: PASS || FAIL_OK
S8.4_D2.1: PASS || FAIL_OK
S8.4_D2.2: PASS || FAIL_OK
S8.4_D2.3: PASS || FAIL_OK
S8.4_D2.4: PASS || FAIL_OK
S8.4_D2.5: PASS || FAIL_OK
S8.4_D2.6: PASS || FAIL_OK
S8.4_D2.7: PASS || FAIL_OK
S8.4_D1.1: PASS || FAIL_OK
S13.2_D1.2: PASS || FAIL_OK
S11.4.3_D1.2: PASS || FAIL_OK
S7.6_D1: PASS || FAIL_OK
S7.6_D2: PASS || FAIL_OK
S15.1.2.2_D1.2: PASS || FAIL_OK
S13_D1_T1: PASS || FAIL_OK
S14_D4_T3: PASS || FAIL_OK
S14_D7: PASS || FAIL_OK
S15.5.4.11_D1.1_T2: PASS || FAIL_OK
S15.5.4.11_D1.1_T4: PASS || FAIL_OK
S15.5.2_D2: PASS || FAIL_OK
S15.5.4.11_D1.1_T1: PASS || FAIL_OK
S15.5.4.11_D1.1_T3: PASS || FAIL_OK
S12.6.4_D1: PASS || FAIL_OK
S15.5.4.14_A1_T6: FAIL_OK
S15.5.4.14_A1_T7: FAIL_OK
S15.5.4.14_A1_T8: FAIL_OK
S15.5.4.14_A1_T9: FAIL_OK
S15.5.4.14_A2_T7: FAIL_OK
S15.10.2.12_A1_T1: FAIL_OK
S15.10.2.12_A2_T1: FAIL_OK
# We allow function declarations within statements
S12.6.2_A13_T1: FAIL_OK
S12.6.2_A13_T2: FAIL_OK
S12.6.4_A13_T1: FAIL_OK
S12.6.4_A13_T2: FAIL_OK
#S12.6.4_A13_T3: FAIL_OK
S15.3.4.2_A1_T1: FAIL_OK
# Linux and Mac defaults to extended 80 bit floating point format in the FPU.
# We follow the other major JS engines by keeping this default.
S8.5_A2.2: PASS, FAIL if $system == linux, FAIL if $system == macos
S8.5_A2.1: PASS, FAIL if $system == linux, FAIL if $system == macos
# The source field of RegExp objects is properly escaped. We match JSC.
S15.10.4.1_A3_T1: FAIL_OK
S15.10.4.1_A3_T2: FAIL_OK
S15.10.4.1_A3_T3: FAIL_OK
S15.10.4.1_A3_T4: FAIL_OK
S15.10.4.1_A3_T5: FAIL_OK
S15.10.4.1_A4_T2: FAIL_OK
S15.10.4.1_A4_T3: FAIL_OK
S15.10.4.1_A4_T5: FAIL_OK
##################### ES3 TESTS #########################
# These tests check for ES3 semantics, and differ from ES5.
# When we follow ES5 semantics, it's ok to fail the test.
# Allow keywords as names of properties in object initialisers and
# in dot-notation property access.
S11.1.5_A4.1: FAIL_OK
S11.1.5_A4.2: FAIL_OK
# Don't throw type errors when iterating through the undefined object.
S9.9_A1: FAIL_OK
S9.9_A2: FAIL_OK
# The expected evaluation order of comparison operations changed.
S11.8.2_A2.3_T1: FAIL_OK
S11.8.3_A2.3_T1: FAIL_OK
# Calls builtins without an explicit receiver which means that
# undefined is passed to the builtin. The tests expect the global
# object to be passed which was true in ES3 but not in ES5.
S11.1.1_A2: FAIL_OK
S15.5.4.4_A1_T3: FAIL_OK
S15.5.4.5_A1_T3: FAIL_OK
S15.5.4.6_A1_T3: FAIL_OK
S15.5.4.7_A1_T3: FAIL_OK
S15.5.4.8_A1_T3: FAIL_OK
S15.5.4.9_A1_T3: FAIL_OK
S15.5.4.10_A1_T3: FAIL_OK
S15.5.4.11_A1_T3: FAIL_OK
S15.5.4.12_A1_T3: FAIL_OK
S15.5.4.13_A1_T3: FAIL_OK
S15.5.4.14_A1_T3: FAIL_OK
S15.5.4.15_A1_T3: FAIL_OK
# NaN, Infinity and undefined are read-only according to ES5.
S15.1.1.1_A2_T1: FAIL_OK # NaN
S15.1.1.1_A2_T2: FAIL_OK # NaN
S15.1.1.2_A2_T1: FAIL_OK # Infinity
# S15.1.1.2_A2_T2 would fail if it weren't bogus in r97. sputnik bug #45.
S15.1.1.3_A2_T1: FAIL_OK # undefined
S15.1.1.3_A2_T2: FAIL_OK # undefined
# Function.prototype.apply can handle arbitrary object as argument list.
S15.3.4.3_A6_T1: FAIL_OK
S15.3.4.3_A6_T4: FAIL_OK
# Array.prototype.to[Locale]String is generic in ES5.
S15.4.4.2_A2_T1: FAIL_OK
S15.4.4.3_A2_T1: FAIL_OK
##################### SKIPPED TESTS #####################
# These tests take a looong time to run in debug mode.
S15.1.3.2_A2.5_T1: PASS, SKIP if $mode == debug
S15.1.3.1_A2.5_T1: PASS, SKIP if $mode == debug
# V8 Bug: http://code.google.com/p/v8/issues/detail?id=1196
S8.7_A5_T2: FAIL
# Invalid test case (recent change adding var changes semantics)
S8.3_A1_T1: FAIL
# Test bug: http://code.google.com/p/sputniktests/issues/detail?id=35
S15.5.4.8_A1_T1: FAIL
# Invalid test case (recent change adding var changes semantics)
S15.3_A3_T1: FAIL
# Invalid test case (recent change adding var changes semantics)
S15.3_A3_T3: FAIL
[ $arch == arm ]
# BUG(3251225): Tests that timeout with --nocrankshaft.
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
S15.1.3.1_A2.4_T1: SKIP
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.4_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
S15.1.3.3_A2.3_T1: SKIP
S15.1.3.4_A2.3_T1: SKIP
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
[ $arch == mipsel ]
# BUG(3251225): Tests that timeout with --nocrankshaft.
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
S15.1.3.1_A2.4_T1: SKIP
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.4_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
S15.1.3.3_A2.3_T1: SKIP
S15.1.3.4_A2.3_T1: SKIP
S15.1.3.1_A2.5_T1: SKIP
S15.1.3.2_A2.5_T1: SKIP
# Copyright 2009 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
from os.path import join, exists
import sys
import test
import time
def GetSuite(name, root):
# Not implemented.
return None
class SputnikTestCase(test.TestCase):
def __init__(self, case, path, context, mode):
super(SputnikTestCase, self).__init__(context, path, mode)
self.case = case
self.tmpfile = None
self.source = None
def IsNegative(self):
return '@negative' in self.GetSource()
def IsFailureOutput(self, output):
if output.exit_code != 0:
return True
out = output.stdout
return "SputnikError" in out
def BeforeRun(self):
self.tmpfile = sputnik.TempFile(suffix='.js', prefix='sputnik-', text=True)
self.tmpfile.Write(self.GetSource())
self.tmpfile.Close()
def AfterRun(self, result):
# Dispose the temporary file if everything looks okay.
if result is None or not result.HasPreciousOutput(): self.tmpfile.Dispose()
self.tmpfile = None
def GetCommand(self):
result = self.context.GetVmCommand(self, self.mode)
result.append(self.tmpfile.name)
return result
def GetLabel(self):
return "%s sputnik %s" % (self.mode, self.GetName())
def GetName(self):
return self.path[-1]
def GetSource(self):
if not self.source:
self.source = self.case.GetSource()
return self.source
class SputnikTestConfiguration(test.TestConfiguration):
def __init__(self, context, root):
super(SputnikTestConfiguration, self).__init__(context, root)
def ListTests(self, current_path, path, mode, variant_flags):
# Import the sputnik test runner script as a module
testroot = join(self.root, 'sputniktests')
modroot = join(testroot, 'tools')
sys.path.append(modroot)
import sputnik
globals()['sputnik'] = sputnik
# Do not run strict mode tests yet. TODO(mmaly)
test_suite = sputnik.TestSuite(testroot, False)
test_suite.Validate()
tests = test_suite.EnumerateTests([])
result = []
for test in tests:
full_path = current_path + [test.GetPath()[-1]]
if self.Contains(path, full_path):
case = SputnikTestCase(test, full_path, self.context, mode)
result.append(case)
return result
def GetBuildRequirements(self):
return ['d8']
def GetTestStatus(self, sections, defs):
status_file = join(self.root, 'sputnik.status')
if exists(status_file):
test.ReadConfigurationInto(status_file, sections, defs)
def GetConfiguration(context, root):
return SputnikTestConfiguration(context, root)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment