Commit Graph

1296 Commits

Author SHA1 Message Date
Gorkem Yakin 147ff7f741 Merge pull request #499 from bocoup/reorg-annex-b
Reorganize tests for Annex B extensions
2016-02-12 16:49:06 -08:00
Gorkem Yakin 428418d5c7 Replace remaining es7id tags with id 2016-02-12 16:27:10 -08:00
Leonardo Balter ebda746e6a Replace es7id tags with id 2016-02-12 16:22:56 -08:00
Leonardo Balter 76080eac08 Reuse %TypedArray%.from and .of tests on each TypedArray constructor 2016-02-12 16:02:36 -08:00
Leonardo Balter 048073a29a Add tests for _TypedArray_.from and of 2016-02-12 16:02:36 -08:00
Leonardo Balter 4388f2869c Allow call testWithTypedArrayConstructors with a constructors subset 2016-02-12 16:02:36 -08:00
Leonardo Balter 35dce20ec4 Update tests for %TypedArray%.from and of 2016-02-12 16:02:36 -08:00
Gorkem Yakin 02cbd01bfb Merge pull request #486 from bocoup/object-setprototypeof
Add tests for [[SetPrototypeOf]] on immutable prototype exotic objects
2016-02-12 14:59:25 -08:00
Gorkem Yakin ac7711e95f Merge pull request #485 from bocoup/typedarray-constructor
Add tests for _TypedArray_ constructors
2016-02-12 14:47:48 -08:00
Mike Pennisi 071b5f03c6 Remove unused harness file
The harness file `Test262Error.js` has not contained executable code since it
was introduced in this project [1]. The definition of the `Test262Error`
function has consistently been located in the `sta.js` harness file which test
runners are expected to inject into the test environment.

Remove the file and all references to it.

[1] See commit c33bf0e043
2016-02-12 13:44:18 -05:00
André Bargull 31a9036e9b Add coverage for 'name' property of Intl built-in functions 2016-02-12 18:58:57 +01:00
Leonardo Balter df2d760d60 Add tests for Object.prototype extensibility and its immutable prototype
Object.prototype is extensible and an immutable prototype exotic object,
it's [[Prototype]] value is null

Ref tc39/ecma262#308
2016-02-12 13:10:46 -02:00
Mike Pennisi b791cc4fbe Runner: Re-use lock to share access to stdout
When executing multiple tests in parallel, each "child" thread would
write to the process's standard output buffer immediately upon test
completion. Because thread execution order and instruction interleaving
is non-deterministic, this made it possible for characters to be emitted
out-of-order.

When extended to support multiple concurrent threads, the runner was
outfitted with a "log lock" dedicated to sharing access to the output
file (when applicable). Re-use this lock when writing to standard out,
ensuring proper ordering of test result messages.
2016-02-10 17:15:49 -05:00
Mike Pennisi 217812891c Test runner: Avoid race condition
A recent extension to the test runner introduced support for running
tests in parallel using multi-threading. Following this, the runner
would incorrectly emit the "final report" before all individual test
results.

In order to emit the "final report" at the end of the output stream, the
parent thread would initialize all children and wait for availability of
a "log lock" shared by all children.

According to the documentation on the "threading" module's Lock object
[1]:

> When more than one thread is blocked in acquire() waiting for the state
> to turn to unlocked, only one thread proceeds when a release() call
> resets the state to unlocked; which one of the waiting threads proceeds
> is not defined, and may vary across implementations.

This means the primitive cannot be used by the parent thread to reliably
detect completion of all child threads.

Update the parent to maintain a reference for each child thread, and to
explicitly wait for every child thread to complete before emitting the
final result.

[1] https://docs.python.org/2/library/threading.html#lock-objects
2016-02-10 16:47:01 -05:00
Mike Pennisi e3fae6eeb4 Promise: Add test for constructor access count
Assert that the `constructor` property of the "this" value of
`Promise.prototype.then` is accessed exactly once. This guards against
implementations where repeated access is used instead of reference
passing (possibly motivated by convenience).

Repeated access of this kind was demonstrated by V8's implementation of
the specification:

https://bugs.chromium.org/p/v8/issues/detail?id=4539
2016-02-10 13:56:55 -05:00
Mike Pennisi 219bdc6f73 Promise: Add tests to disallow faulty optimization
Add tests that assert behavior when a Promise is resolved with another
Promise whose `then` method has been overridden. Because all objects
with a `then` method are treated equivalently, the presence of a
[[PromiseState]] internal slot should have no effect on program
behavior.

These tests guard against a faulty optimization originally implemented
in V8:

https://bugs.chromium.org/p/v8/issues/detail?id=3641
2016-02-10 13:38:03 -05:00
Mike Pennisi fbce4ea11c Reorganize tests for Annex B extensions
The "mainline" tests in Test262 are converging on a more formal
structure. Files are organized as tests for either either "language"
(e.g. syntax-driven) or "built-in" (e.g. API-driven). "Language" test
locations are themselves structured according to whether the syntactic
form under test is an Expression or a Statement.

To limit ambiguity when locating/adding tests, re-organize the tests for
Annex B extensions to match this structure.
2016-02-10 10:15:35 -05:00
Rick Waldron 5cb97c293b Merge pull request #497 from tschneidereit/master
Enable parallel test execution in console runner
2016-02-08 16:57:47 -05:00
Till Schneidereit 7ae29d49ae Enable parallel test execution in console runner
Adds a `-j`/`--workers-count` parameter to `tools/packaging/test262.py`, defaulting to `[number of cores] - 1`.

Speeds up running the test suite by about ~3x on my 4-core machine, with the SpiderMonkey shell. This could certainly be optimized more by just appending test results to per-thread lists and merging them at the end, but it's better than nothing.
2016-02-08 17:40:16 +01:00
Gorkem Yakin 26aeed1428 Merge pull request #494 from bocoup/indexof-zero
Add tests for zero conversion on Array#indexOf and Array#lastIndexOf
2016-02-05 15:38:45 -08:00
Leonardo Balter 26785d40ca Add tests for zero conversion on Array#indexOf and Array#lastIndexOf
Fixes #435
2016-02-05 19:17:26 -02:00
Gorkem Yakin 7cd2112bf1 Merge pull request #490 from bocoup/reorg-obj
Move tests for object literals
2016-02-05 09:04:40 -08:00
Gorkem Yakin ea89b2ea18 Merge pull request #487 from jugglinmike/tco
Add tests for tail-call optimization
2016-02-05 09:00:27 -08:00
Leonardo Balter 75952beee2 Move test file from TypedArray to TypedArrays folder 2016-02-05 11:58:55 -02:00
Leonardo Balter 0a30413b49 fixup! rename test files + review fixes 2016-02-05 11:53:33 -02:00
Leonardo Balter d033b160cb fixup! Add tests for TypedArrays constructors 2016-02-05 11:53:32 -02:00
Leonardo Balter 7a8120fb63 fixup! Add tests for TypedArrays constructors 2016-02-05 11:53:32 -02:00
Leonardo Balter f8a4229bfd Add tests for TypedArrays constructors 2016-02-05 11:53:32 -02:00
Leonardo Balter 4bdd808d04 Update %TypedArray% function length 2016-02-05 11:53:32 -02:00
Leonardo Balter 7d715a4ef1 Revalidate basic call tests for ES2016 %TypedArray% constructor 2016-02-05 11:53:31 -02:00
Leo Balter d549225f91 Merge pull request #492 from bocoup/id-tag-docs
Update contribution guidelines
2016-02-04 19:33:10 -02:00
Mike Pennisi 60afce3636 Update contribution guidelines
It was recently decided to prefer the new `id` tag over the existing
`es5id` and `es6id` tag when authoring tests. Update the contribution
guidelines to reference the new tag.
2016-02-04 15:37:02 -05:00
Mike Pennisi 700f1469e1 Move tests for object literals
Test262 defines tests for expression-producing syntactic forms within
the `language/expressions/` directory. Most tests for object literals
conform to this structure, but 12 such tests were added to the
`language/object-literal/` directory. Move these tests to the canonical
location for object literals.
2016-02-04 09:58:31 -05:00
Jordan Harband cf83ad5e73 s/esid/id/g 2016-02-01 23:44:48 -08:00
Jordan Harband 940d8698d1 Add test with duplicate keys.
Per https://github.com/tc39/test262/pull/484#issuecomment-178145781
2016-02-01 16:57:31 -08:00
Jordan Harband 0a5e8372aa Review feedback. 2016-02-01 10:44:25 -08:00
Mike Pennisi 4dc81d3788 Add tests for tail-call optimization
ECMAScript 2015 introduced tail call optimization for function calls
occuring in a number of positions in the grammar. Assert expected
behavior by triggering a large (but configurable) number of recursive
function calls in these positions. Compliant runtimes will execute such
programs without error; non-compliant runtimes are expected to fail
these tests by throwing an error or crashing when system resources are
exhausted.
2016-02-01 13:20:17 -05:00
Jordan Harband cf578d5190 Add Object.getOwnPropertyDescriptors tests. 2016-02-01 01:45:23 -08:00
Gorkem Yakin fbad34959f Replace "id" with "ID" 2016-01-29 09:29:09 -08:00
Leonardo Balter cb754d2450 Document frontmatter's id tag
Fixes #477
2016-01-29 09:24:03 -08:00
Gorkem Yakin 39facabd9b Merge pull request #483 from bocoup/fix-object-case
Fix case sentitive error on test/built-ins/Object folder
2016-01-29 09:13:59 -08:00
Leonardo Balter e3c5f66a40 Fix case sentitive error on test/built-ins/Object folder
Fixes gh-482
2016-01-29 10:02:25 -05:00
Gorkem Yakin 052bf2379b Merge pull request #475 from bocoup/completion-reform
Tests for ES2015/2016 Completion Reform
2016-01-26 12:38:27 -08:00
Leo Balter 23d0f459a8 Merge pull request #476 from evilpie/error-message-hang
Stop test262 from hanging Spidermonkey with an unimportant error message
2016-01-23 23:34:45 -05:00
Tom Schuster 97c61513d8 Stop test262 from hanging Spidermonkey with an unimportant error message 2016-01-23 17:41:59 +01:00
Mike Pennisi e62d43c815 Update tests according to ES2016 draft semantics
The ES2016 draft further refines the completion values for `if` and
`with` statements. Two tests must be removed outright because the
completion value in those cases is no longer accessible from the
runtime.
2016-01-22 15:00:54 -05:00
Mike Pennisi 407b8964ce Add tests for ES2015 completion reform
In order to facilitate proper tail calls, ES2015 modified the completion
value of a number of statements.

These tests use `eval` to verify the new values.
2016-01-22 15:00:03 -05:00
Gorkem Yakin afd3c5783e Merge pull request #469 from bocoup/improve-typed-arrays-coverage
Basic coverage for the %TypedArray% object
2016-01-21 09:36:51 -08:00
Leonardo Balter 1a64295a0b Replace TypedArray constructor invalid length test for ES2016 specs
Replace a ES2015 test where calling the TypedArray constructor with
a floating number triggered a RangeError. Within the ES2016 specs,
the same call will trigger a TypeError, as the result for
`SameValue(NewTarget, here)` will be checked before.
2016-01-21 10:41:16 -05:00
Mike Pennisi 8f8b663ce7 Add tests for TypedArray intrinsic 2016-01-21 10:41:16 -05:00