WebKit Bugzilla
Attachment 342543 Details for
Bug 185783
: test262/Runner.pm: add unit tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185783-20180612120335.patch (text/plain), 26.72 KB, created by
valerie
on 2018-06-12 09:03:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
valerie
Created:
2018-06-12 09:03:37 PDT
Size:
26.72 KB
patch
obsolete
>Subversion Revision: 232752 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index fcb676ba14799927a2c2c033ead6f5bc9766c5a6..e6fcada03bfcd2871dad992248bdefeda7de8b69 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,26 @@ >+2018-06-12 Valerie R Young <valerie@bocoup.com> >+ >+ test262/Runner.pm: add unit tests >+ https://bugs.webkit.org/show_bug.cgi?id=185783 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Scripts/webkitperl/test262_unittest/README: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/expectations-compare.yaml: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/expectations.yaml: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail-new-error.pl: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail.pl: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-pass.pl: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing-with-new-error.js: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing.js: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-passing.js: Added. >+ (f): >+ * Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-pass-now-failing.js: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/test/fail.js: Added. >+ * Scripts/webkitperl/test262_unittest/fixtures/test/pass.js: Added. >+ (f): >+ * Scripts/webkitperl/test262_unittest/test262-runner-tests.pl: Added. >+ > 2018-06-11 Carlos Alberto Lopez Perez <clopez@igalia.com> > > [JSCOnly] Add a MIPS32el JSCOnly EWS >diff --git a/Tools/Scripts/webkitperl/test262_unittest/README b/Tools/Scripts/webkitperl/test262_unittest/README >new file mode 100644 >index 0000000000000000000000000000000000000000..f5c6ed4b6ebcf0aa4a34130d94d35d15d43ca9ed >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/README >@@ -0,0 +1,6 @@ >+These unit tests test: >+ webkit/Tools/Scripts/test262-runner >+ webkit/Tools/Scripts/test262-import >+ >+Helper perl modules for these scripts are located in: >+ webkit/Tools/Scripts/test262/ >\ No newline at end of file >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/expectations-compare.yaml b/Tools/Scripts/webkitperl/test262_unittest/fixtures/expectations-compare.yaml >new file mode 100644 >index 0000000000000000000000000000000000000000..e1b85d49b19fdd52642a3d33888de179bcaf626f >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/expectations-compare.yaml >@@ -0,0 +1,4 @@ >+--- >+test/fail.js: >+ default: 'Test262: This test fails.' >+ strict mode: 'Test262: This test fails.' >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/expectations.yaml b/Tools/Scripts/webkitperl/test262_unittest/fixtures/expectations.yaml >new file mode 100644 >index 0000000000000000000000000000000000000000..b662d4e32b255cbc1d976d86e22131447462053c >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/expectations.yaml >@@ -0,0 +1,10 @@ >+--- >+test/expected-to-fail-now-passing.js: >+ default: 'Test262: This test fails.' >+ strict mode: 'Test262: This test fails.' >+test/expected-to-fail-now-failing.js: >+ default: 'Test262: This test fails.' >+ strict mode: 'Test262: This test fails.' >+test/expected-to-fail-now-failing-with-new-error.js: >+ default: 'Test262: This test fails.' >+ strict mode: 'Test262: This test fails.' >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail-new-error.pl b/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail-new-error.pl >new file mode 100755 >index 0000000000000000000000000000000000000000..7d1aba3f18e7341b321dd71579a590be628adf80 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail-new-error.pl >@@ -0,0 +1,32 @@ >+#!/usr/bin/env perl >+ >+# Copyright (C) 2018 Bocoup LLC. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# >+# 1. Redistributions of source code must retain the above >+# copyright notice, this list of conditions and the following >+# disclaimer. >+# 2. 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. >+# >+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+print("Exception: Test262Unexpected: This test fails WITH AN UNEXPECTED ERROR."); >+ >+exit(1); >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail.pl b/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail.pl >new file mode 100755 >index 0000000000000000000000000000000000000000..f24b251bdb39b8974ae63dfc6585516836d1ae37 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-fail.pl >@@ -0,0 +1,32 @@ >+#!/usr/bin/env perl >+ >+# Copyright (C) 2018 Bocoup LLC. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# >+# 1. Redistributions of source code must retain the above >+# copyright notice, this list of conditions and the following >+# disclaimer. >+# 2. 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. >+# >+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+print("Exception: Test262: This test fails."); >+ >+exit(1); >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-pass.pl b/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-pass.pl >new file mode 100755 >index 0000000000000000000000000000000000000000..fe68e8cd50c0d05c56b7c6de6f1d66848b9f58ac >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/mock-jsc-pass.pl >@@ -0,0 +1,30 @@ >+#!/usr/bin/env perl >+ >+# Copyright (C) 2018 Bocoup LLC. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# >+# 1. Redistributions of source code must retain the above >+# copyright notice, this list of conditions and the following >+# disclaimer. >+# 2. 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. >+# >+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+exit(0); >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing-with-new-error.js b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing-with-new-error.js >new file mode 100644 >index 0000000000000000000000000000000000000000..350518183be78f708fb2ba0ec2bb21a5ab118e28 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing-with-new-error.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Bocoup LLC. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// >+// 1. Redistributions of source code must retain the above >+// copyright notice, this list of conditions and the following >+// disclaimer. >+// 2. 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. >+// >+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+/*--- >+esid: sec-function-definitions >+description: Minimal test >+---*/ >+ >+throw "Test262Unexpected: This test fails WITH AN UNEXPECTED ERROR."; >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing.js b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d83616d1e608c463384c120d7aee93dced4bb014 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-failing.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Bocoup LLC. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// >+// 1. Redistributions of source code must retain the above >+// copyright notice, this list of conditions and the following >+// disclaimer. >+// 2. 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. >+// >+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+/*--- >+esid: sec-function-definitions >+description: Minimal test >+---*/ >+ >+throw "Test262: This test fails."; >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-passing.js b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-passing.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e781e4355975308034b9d0250cdb4a55eb462581 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-fail-now-passing.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Bocoup LLC. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// >+// 1. Redistributions of source code must retain the above >+// copyright notice, this list of conditions and the following >+// disclaimer. >+// 2. 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. >+// >+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+/*--- >+esid: sec-function-definitions >+description: Minimal test >+---*/ >+ >+function f() {}; >+ >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-pass-now-failing.js b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-pass-now-failing.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d83616d1e608c463384c120d7aee93dced4bb014 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/expected-to-pass-now-failing.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Bocoup LLC. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// >+// 1. Redistributions of source code must retain the above >+// copyright notice, this list of conditions and the following >+// disclaimer. >+// 2. 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. >+// >+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+/*--- >+esid: sec-function-definitions >+description: Minimal test >+---*/ >+ >+throw "Test262: This test fails."; >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/fail.js b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/fail.js >new file mode 100644 >index 0000000000000000000000000000000000000000..d83616d1e608c463384c120d7aee93dced4bb014 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/fail.js >@@ -0,0 +1,33 @@ >+// Copyright (C) 2018 Bocoup LLC. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// >+// 1. Redistributions of source code must retain the above >+// copyright notice, this list of conditions and the following >+// disclaimer. >+// 2. 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. >+// >+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+/*--- >+esid: sec-function-definitions >+description: Minimal test >+---*/ >+ >+throw "Test262: This test fails."; >diff --git a/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/pass.js b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/pass.js >new file mode 100644 >index 0000000000000000000000000000000000000000..e781e4355975308034b9d0250cdb4a55eb462581 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/fixtures/test/pass.js >@@ -0,0 +1,34 @@ >+// Copyright (C) 2018 Bocoup LLC. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// >+// 1. Redistributions of source code must retain the above >+// copyright notice, this list of conditions and the following >+// disclaimer. >+// 2. 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. >+// >+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+/*--- >+esid: sec-function-definitions >+description: Minimal test >+---*/ >+ >+function f() {}; >+ >diff --git a/Tools/Scripts/webkitperl/test262_unittest/test262-runner-tests.pl b/Tools/Scripts/webkitperl/test262_unittest/test262-runner-tests.pl >new file mode 100755 >index 0000000000000000000000000000000000000000..c1c2eb14b952c971f6a4e641e0d1cefd8ed371d6 >--- /dev/null >+++ b/Tools/Scripts/webkitperl/test262_unittest/test262-runner-tests.pl >@@ -0,0 +1,166 @@ >+#!/usr/bin/env perl >+ >+# Copyright (C) 2018 Bocoup LLC. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# >+# 1. Redistributions of source code must retain the above >+# copyright notice, this list of conditions and the following >+# disclaimer. >+# 2. 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. >+# >+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "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 HOLDER 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. >+ >+use strict; >+use warnings; >+ >+use Test::More; >+use File::Spec; >+use FindBin; >+use Cwd qw(abs_path); >+use File::Path qw(rmtree); >+use File::Temp qw(tempfile); >+use File::Compare qw(compare); >+use webkitdirs qw(isWindows isCygwin isWinCairo); >+ >+# The test262-harness script is not written for compatiblity with Windows >+if (isWindows() || isCygwin() || isWinCairo()) { >+ plan(tests => 1); >+ is(1, 1, 'do nothing for Windows builds.'); >+ exit 0; >+} >+ >+my $Bin = $FindBin::Bin; >+my $runner = abs_path("$Bin/../../test262-runner"); >+my $mockTest262 = abs_path("$Bin/fixtures"); >+ >+ >+# testCase format >+# TESTNAME - Description of test case >+# TEST262TESTS_ARG - test262-runner CLI argument to specify mock >+# test262 test file located in ./fixtures/test/.. >+# EXPECTATION_ARG - test262-runner CLI argument to specify mock >+# expectations.yaml file in ./fixtures/ >+# MOCK_JSC_ARG - test262-runner CLI argument to specify mock jsc, >+# located in ./fixtures/.., which mimics jsc output >+# EXITSTATUS - Expected resulting exit code of test262-runner >+# EXPECTED_NEW_FAIL_COUNT - Expected resulting fail count of test262-runner >+# counts are occurances of "! NEW FAIL" >+ >+my @testCases = ( >+ { >+ "TESTNAME" => "test262 test failed, ignore expectations", >+ "TEST262TESTS_ARG" => "--test-only test/fail.js", >+ "EXPECTATION_ARG" => "--ignore-expectations", >+ "MOCK_JSC_ARG" => "--jsc $mockTest262/mock-jsc-fail.pl", >+ "EXITSTATUS" => 1, >+ "EXPECTED_NEW_FAIL_COUNT" => 2, >+ }, >+ { >+ "TESTNAME" => "test262 test passed, ignore expectations", >+ "TEST262TESTS_ARG" => "--test-only test/pass.js", >+ "EXPECTATION_ARG" => "--ignore-expectations", >+ "MOCK_JSC_ARG" => "--jsc $mockTest262/mock-jsc-pass.pl", >+ "EXITSTATUS" => 0, >+ "EXPECTED_NEW_FAIL_COUNT" => 0, >+ }, >+ { >+ "TESTNAME" => "test262 tests newly failed", >+ "TEST262TESTS_ARG" => "--test-only test/expected-to-pass-now-failing.js", >+ "EXPECTATION_ARG" => "--expectations $Bin/fixtures/expectations.yaml", >+ "MOCK_JSC_ARG" => "--jsc $mockTest262/mock-jsc-fail.pl", >+ "EXITSTATUS" => 1, >+ "EXPECTED_NEW_FAIL_COUNT" => 2, >+ }, >+ { >+ "TESTNAME" => "test262 tests newly passed", >+ "TEST262TESTS_ARG" => "--test-only test/expected-to-fail-now-passing.js", >+ "EXPECTATION_ARG" => "--expectations $Bin/fixtures/expectations.yaml", >+ "MOCK_JSC_ARG" => "--jsc $mockTest262/mock-jsc-pass.pl", >+ "EXITSTATUS" => 0, >+ "EXPECTED_NEW_FAIL_COUNT" => 0, >+ }, >+ { >+ "TESTNAME" => "test262 tests fails, expected failure", >+ "TEST262TESTS_ARG" => "--test-only test/expected-to-fail-now-failing.js", >+ "EXPECTATION_ARG" => "--expectations $Bin/fixtures/expectations.yaml", >+ "MOCK_JSC_ARG" => "--jsc $mockTest262/mock-jsc-fail.pl", >+ "EXITSTATUS" => 0, >+ "EXPECTED_NEW_FAIL_COUNT" => 0, >+ }, >+ { >+ "TESTNAME" => "test262 tests fails, with unexpected error string", >+ "TEST262TESTS_ARG" => "--test-only test/expected-to-fail-now-failing-with-new-error.js", >+ "EXPECTATION_ARG" => "--expectations $Bin/fixtures/expectations.yaml", >+ "MOCK_JSC_ARG" => "--jsc $mockTest262/mock-jsc-fail-new-error.pl", >+ "EXITSTATUS" => 1, >+ "EXPECTED_NEW_FAIL_COUNT" => 2, >+ }, >+); >+ >+my $testCasesCount = (scalar(@testCases) * 2) + 1; >+plan(tests => $testCasesCount); >+ >+## Test error codes and expected output messages of tests ## >+ >+foreach my $testCase (@testCases) { >+ >+ my $test = $testCase->{TEST262TESTS_ARG}; >+ my $expectation = $testCase->{EXPECTATION_ARG}; >+ my $jsc = $testCase->{MOCK_JSC_ARG}; >+ my $test262loc = "--t262 $mockTest262"; >+ >+ my $cmd = qq($runner --release $jsc $test262loc $test $expectation); >+ my $output = qx($cmd); >+ >+ # Test the resulting exit code >+ my $exitCode = $? >> 8; >+ my $expectedExitCode = $testCase->{EXITSTATUS}; >+ my $testName = $testCase->{TESTNAME} . " (exit code: $expectedExitCode)"; >+ is($exitCode, $testCase->{EXITSTATUS}, $testName); >+ >+ # Test the number of occurences of string "! NEW FAIL" >+ my @newFailCount = $output =~ /! NEW FAIL/g; >+ my $expectedNewFailures = $testCase->{EXPECTED_NEW_FAIL_COUNT}; >+ $testName = $testCase->{TESTNAME} . " (new failures: $expectedNewFailures)"; >+ is(scalar(@newFailCount), $expectedNewFailures, $testName); >+} >+ >+## Test format of saved expectations file ## >+ >+my $test262loc = "--t262 $mockTest262"; >+my ($expectationsFH, $expectationsFile) = tempfile(); >+my $expect = "--expectations $expectationsFile"; >+my $test = "--test-only test/fail.js"; >+my $cmd = qq($runner --save --ignore-expectations $test262loc $test $expect); >+qx($cmd); >+ >+my $expectedExpectationsFile = "$Bin/fixtures/expectations-compare.yaml"; >+my $filesmatch = compare($expectationsFile, $expectedExpectationsFile); >+ok($filesmatch == 0, "expectations yaml file format"); >+ >+close $expectationsFH; >+ >+END { >+ # Clean up test262 results directory after running tests >+ my $resultsDir = $ENV{PWD} . "/test262-results"; >+ if (-e $resultsDir) { >+ rmtree($resultsDir); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185783
:
340736
|
340867
|
340957
|
341002
|
341027
|
341028
|
341105
|
342196
|
342205
|
342543
|
342544