Commit Graph

465 Commits

Author SHA1 Message Date
Brian Terlson 61113dbfb3 Merge pull request #36 from mmalecki/target-blank
Use `target='_blank'` to open links in new window
2014-10-24 15:30:01 -07:00
Brian Terlson 1f2812adeb Merge pull request #104 from smikes/monkeyYaml-loadfix
load monkeyYaml without assuming it is on path
2014-10-24 14:41:40 -07:00
Sam Mikes 9dc29da897 load monkeyYaml without assuming it is on path
use imp to import monkeyYaml locally
make monkeyYaml the backup again
2014-10-24 22:36:03 +01:00
Brian Terlson eb08d871c5 Merge pull request #69 from smikes/ES5-Array-concat-ownProperty
ES5.S15: new tests to clarify Array.prototype.concat
2014-10-24 10:48:00 -07:00
Brian Terlson 0c0d1d3d46 Merge pull request #101 from smikes/addl-console-negative-fixes
additional fixes suggested by @anba
2014-10-24 10:31:39 -07:00
Brian Terlson a754f2c4ea Merge pull request #102 from smikes/issue-75-spurious-path-in-flags
remove spurious flags: [path]
2014-10-24 10:30:48 -07:00
Sam Mikes 5fbb0a3902 remove spurious flags: [path] 2014-10-24 15:24:57 +01:00
Sam Mikes 89d71f56b2 additional fixes suggested by @anba 2014-10-24 15:18:37 +01:00
Brian Terlson e2b675f443 Merge pull request #90 from smikes/monkeyYaml
provide fallback parser if YAML not installed
2014-10-14 19:05:26 -07:00
Sam Mikes 4f9cec2fa8 provide fallback parser if YAML not installed
parseTestRecord.py:
- recover from ImportError when YAML not defined
- use monkeyYaml as backup

monkeyYaml.py:
- parser for subset of YAML used in test262 frontmatter

test_monkeyYaml.py:
- unit tests
2014-08-28 12:47:58 +01:00
Brian Terlson 9bd668692e Merge pull request #89 from smikes/CONTRIBUTING-document-timeout
document `timeout` and clean up
2014-08-25 09:16:00 -07:00
Sam Mikes 5b8879b951 document `timeout` and clean up
CONTRIBUTING.md
- document `timeout` tag
- reorder tags in frontmatter doc
- minor cleanups
- minor fixes
- add style note
- reformat flags
- remove discussion of obsolete $INCLUDE
- incorporate line notes from @domenic
- integrate additional comments
- add links back, move arg notes down
- Raise outline level by one

README.md
- link to CONTRIBUTING
2014-08-25 17:00:15 +01:00
Sam Mikes c650b1a9b0 ES5.S15: new tests to clarify Array.concat
Test of spec language from 15.4.4.4,
5.b.iii.3.b states 'Call the [[DefineOwnProeprty]] internal method of A'
which means that the result of Array.prototype.concat
should return `true` from `hasOwnProperty` for every property
created by `concat`, up to `length`

Set length to 3.
a[0] is set to 0 on a
a[1] is unset
a[2] is set to 2 via a prototype of a

add assertions for values of b[0], b[1], b[2]
add assertions for b.hasOwnProperty('2')

Check with Array.prototype and Object.prototype, separate tests

fix typo in assertion message

test was correct, but assertion message was incorrect
2014-08-19 22:01:46 +01:00
Brian Terlson 595a36b252 Merge pull request #67 from smikes/negative-addErrorName-bestPractice
Remove negative flag from test bed. Replace with specific errors. Other misc. fixes.
2014-08-12 16:39:14 -07:00
Sam Mikes 6b7e5d7747 bestPractice: supply error names to negative
pilot directory for replacing flags: [negative] with
negative: errorname

ch07-7.2,7.3: add error names
ch07-rest: insert error names rest of ch07
ch08: add expected error name
ch11: add error name to negative
ch12: put error name in negative

ch13: add error name to negative
only one test, did it manually

ch15: add error name to negative:

ch07: add error name to negative

these tests used flags: \n - negative and so
were not caught by the earlier naive grep for flags: [negative]

--- changes suggested by @anba

bestPractice - remove added NotEarlyError
ch07,ch11 - expect ReferenceError (req'd by ES6)
correct test descriptions to expect ReferenceError only
enforce parsing as block statement by adding `;`
remove needless include of $FAIL.js

effectively, a rebase of all changes onto master

    Merge branch 'negative-addErrorName-work' into negative-addErrorName-bestPractice

    Merge branch 'saved-bestPractice-negative' into negative-addErrorName-work

    Conflicts:
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T2.js
    	test/suite/ch12/12.1/S12.1_A4_T1.js
    	test/suite/ch12/12.5/S12.5_A2.js

    incorporate changes made on PR branch

    re-remove added NotEarlyError

    Merge branch 'negative-addErrorName-work' into negative-addErrorName-bestPractice

    Conflicts:
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T2.js
    	test/suite/ch12/12.1/S12.1_A4_T1.js
    	test/suite/ch12/12.5/S12.5_A2.js

    ch15: correct negative regexes

    ch10: avoid use of not-NotEarlyError regex

    ch14 error regexps

    ch13 error regexps

    ch12: negative error matching

    Merge branch 'console-runner-checkError' into negative-addErrorName-work

    test262.py: check negative tests with regex

    implement checking of negative tests =>

    negative: SyntaxError

    means that /SyntaxError/ must match stderr
    or test is reported as failure

    Fixes #78

    expect real errors

    bestPractice: supply error names to negative

    pilot directory for replacing flags: [negative] with
    negative: errorname

    ch07-7.2,7.3: add error names
    ch07-rest: insert error names rest of ch07
    ch08: add expected error name
    ch11: add error name to negative
    ch12: put error name in negative

    ch13: add error name to negative
    only one test, did it manually

    ch15: add error name to negative:

    ch07: add error name to negative

    these tests used flags: \n - negative and so
    were not caught by the earlier naive grep for flags: [negative]

    --- changes suggested by @anba

    bestPractice - remove added NotEarlyError
    ch07,ch11 - expect ReferenceError (req'd by ES6)
    correct test descriptions to expect ReferenceError only
    enforce parsing as block statement by adding `;`
    remove needless include of $FAIL.js

    Merge branch 'negative-addErrorName-work' into negative-addErrorName-bestPractice

    resolved Conflicts:
    	test/suite/ch07/7.9/S7.9_A5.7_T1.js
    	test/suite/ch11/11.13/11.13.1/S11.13.1_A2.1_T3.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T1.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T10.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T11.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T2.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T3.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T4.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T5.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T6.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T7.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T8.js
    	test/suite/ch11/11.13/11.13.2/S11.13.2_A2.2_T9.js
    	test/suite/ch11/11.3/11.3.1/S11.3.1_A2.1_T3.js
    	test/suite/ch11/11.3/11.3.2/S11.3.2_A2.1_T3.js
    	test/suite/ch11/11.4/11.4.4/S11.4.4_A2.1_T3.js
    	test/suite/ch11/11.4/11.4.5/S11.4.5_A2.1_T3.js
    	test/suite/ch12/12.5/S12.5_A2.js
    	test/suite/ch12/12.6/12.6.3/S12.6.3_A4_T2.js

    negative: second half of @anba notes

    correct test descriptions to expect ReferenceError only
    enforce parse as block statement by adding `;`
    remove needless include of $FAIL.js

    ch12: specify type

    negative: @anba fixes

    bestPractice - remove added NotEarlyError
    ch07,ch11 - expect ReferenceError (req'd by ES6)

    bestPractice: supply error names to negative

    pilot directory for replacing flags: [negative] with
    negative: errorname

    ch07-7.2,7.3: add error names
    ch07-rest: insert error names rest of ch07
    ch08: add expected error name
    ch11: add error name to negative
    ch12: put error name in negative

    ch13: add error name to negative
    only one test, did it manually

    ch15: add error name to negative:

    ch07: add error name to negative

    these tests used flags: \n - negative and so
    were not caught by the earlier naive grep for flags: [negative]

    expect a SyntaxError

    ch07: add error name to negative

    these tests used flags: \n - negative and so
    were not caught by the earlier naive grep for flags: [negative]

    ch15: add error name to negative:

    ch13: add error name to negative

    only one test, did it manually

    ch12: put error name in negative

    ch11: add error name to negative

    ch08: add expected error name
    ch07-rest: insert error names rest of ch07

    ch07-7.2,7.3: add error names

    negative-errorname: pilot

    pilot directory for replacing flags: [negative] with
    negative: errorname

    bestPractice: supply error names to negative

bestPractice: supply error names to negative

pilot directory for replacing flags: [negative] with
negative: errorname

ch07-7.2,7.3: add error names
ch07-rest: insert error names rest of ch07
ch08: add expected error name
ch11: add error name to negative
ch12: put error name in negative

ch13: add error name to negative
only one test, did it manually

ch15: add error name to negative:

ch07: add error name to negative

these tests used flags: \n - negative and so
were not caught by the earlier naive grep for flags: [negative]

bestPractice: supply error names to negative

negative-errorname: pilot

pilot directory for replacing flags: [negative] with
negative: errorname

ch07-7.2,7.3: add error names

ch07-rest: insert error names rest of ch07

ch08: add expected error name

ch11: add error name to negative

ch12: put error name in negative

ch13: add error name to negative

only one test, did it manually

ch15: add error name to negative:

ch07: add error name to negative

these tests used flags: \n - negative and so
were not caught by the earlier naive grep for flags: [negative]

expect a SyntaxError

negative: @anba fixes

bestPractice - remove added NotEarlyError
ch07,ch11 - expect ReferenceError (req'd by ES6)

ch12: specify type

negative: second half of @anba notes

correct test descriptions to expect ReferenceError only
enforce parse as block statement by adding `;`
remove needless include of $FAIL.js

expect real errors

ch12: negative error matching

ch13 error regexps

ch14 error regexps

add "description" header back

remove now-unused includes

remove needless include
2014-08-13 00:19:11 +01:00
Brian Terlson a794e0eb54 Merge pull request #76 from anba/issue-61/wrong-test-assertions
Correct test assertion (Fixes issue#61)
2014-08-05 23:52:06 -07:00
Brian Terlson 7f5310b4d5 Merge pull request #77 from anba/issue-63/correct-array-fill-test
Correct Array.prototype.fill tests (Fixes #63)
2014-08-05 23:51:28 -07:00
Brian Terlson f04573e583 Merge pull request #79 from anba/issue-41/move-clz-to-math
Move tests to Math.clz32 (Fixes #41)
2014-08-05 23:50:05 -07:00
André Bargull f0ac90a5fd Move tests to Math.clz32 (Fixes #41)
Number.prototype.clz() was renamed to Math.clz32(). Also removed superfluous 'spec' entry in test descriptor.
2014-08-04 20:57:02 +02:00
André Bargull e256a76e9d Correct Array.prototype.fill tests (Fixes #63)
The expected results weren't correct.
2014-08-04 19:44:22 +02:00
André Bargull 28649e8772 Correct test assertion (Fixes issue#61)
Changed Number.isNaN_Boolean.js, String.prototype.endsWith_Fail.js and String.prototype.endsWith_Fail_2.js to test for the correct result. Also removed implicit coercion in a couple of other test files.
2014-08-04 19:10:41 +02:00
Brian Terlson 64756c252e Merge pull request #68 from smikes/remove-unused-harness
harness: remove unused code
2014-08-02 20:40:40 -07:00
Sam Mikes 4205a1da64 harness: remove unused code
sta.js:
slight change to Test262Error() semantics; message property now always set (default "")
make $ERROR a var
set $ERROR to function $ERROR so it can be overridden if needed
remove 2009 copyright in favor of 2012 copyright
REVERTED: remove never-used fn testFailed
testFailed actually used by $FAIL
remove obsolete fn $INCLUDE

ed.js:
remove commented-out obsolete code

test262.py:
remove always-included harness file that provides no functions used by any extant test
add comment line to nonstrict

cth.js: define `print` for node, cscript

use cth (console test harness) to define functions
for console runner.  V8, Spidermonkey (js) and JavaScriptCore (jsc)
provide a function `print`.  Provide a default `print` for node
and cscript

set print_handle to 'print' by default (can still override)
for cscript: wrap tests in try/catch so we get syntax errors
2014-08-03 00:33:08 +01:00
Brian Terlson 479a6dd442 Merge pull request #66 from smikes/Math-isNaN
es6/Math: use Number.isNaN
2014-07-31 15:31:42 -07:00
Brian Terlson 2230f90e06 Merge pull request #59 from smikes/CONTRIBUTING-clarify
CONTRIBUTING: more notes on test writing
2014-07-31 15:30:16 -07:00
smikes 240635c99a CONTRIBUTING.md: minor fixes
Minor fixes: typos, formatting, verb tense&agreement
Add example of short-list `includes: []` and long-list `includes: \n - \n -`
2014-07-31 14:41:08 -06:00
Sam Mikes bd80bf7dfc es6/Math: use Number.isNaN
use number.isNaN to test for NaN
pointed out by @anba in #60
2014-07-31 13:53:12 -06:00
Sam Mikes 23ef85c9a7 CONTRIBUTING: more notes on test writing
Add section on test environment
Add section on custom helpers
describe YAML frontmatter
Fix minor formatting errors
document $INCLUDE as obsolete
Change documentation of negative error
Move test environment and custom helpers down
indent copyright and frontmatter sections
better description of the async calls between a promise
and the functions in its `.then`
Correct Early Error example: don't throw a string

CONSOLE-RUNNER: split runner doc into new file
add troubleshooting section
2014-07-31 20:17:15 +01:00
Brian Terlson 413e16e355 Merge pull request #51 from bterlson/normalize-format
Normalize testcase format
2014-07-30 15:50:14 -07:00
Sam Mikes c33bf0e043 tools, harness: support new YAML frontmatter
parseTestRecord: add support for YAML frontmatter
parseTestRecord: initial unit test for test record parser
parseTestRecord: refactor for testing

factor old parsing; add YAML parsing

runner: support "includes" from YAML frontmatter

support frontmatter "includes" in python runner
use test.includes if present instead of scanning test code with regex

harness: factor individual functions out into files

tools: handle YAML errors

tolerate missing keys in dictionary (flags, includes)
report filename when empty frontmatter block
new option --list-includes to test262.py

harness: factor helper functions into separate files

sth: remove extra close-paren (syntax error)

test_common: TDD; failing parse of YAML

common: use parseTestRecord (YAML-aware)
2014-07-30 15:39:04 -07:00
Brian Terlson 0defa37385 Add path attribute. 2014-07-30 15:39:01 -07:00
Brian Terlson d4354d14d5 Normalize testcase format
This commit normalizes the test case format used across test262. It applies the following transformations:

* Convert to YAML for frontmatter
* Remove of trailing whitespace
* Replace /r/n with /n except in chapters 6 and 7.
* Copyright header always uses // comments
* new includes attribute replaces $INCLUDE
* No implicit assumptions about test environment other than $ERROR. Everything else appears in the include array. This includes "runTestCase" which is now included in a substantial number of tests.
2014-07-30 15:38:26 -07:00
Brian Terlson 07ccd199d9 Merge pull request #65 from mathiasbynens/patch-1
Delete `Number.toInteger` test
2014-07-30 14:24:35 -07:00
Mathias Bynens a824f44727 Delete `Number.toInteger` test
`Number.toInteger` was removed from the ES6 draft. Fixes #62.
2014-07-30 23:17:00 +02:00
Brian Terlson 509472bb74 Fix suspect formatting in S15.2.3.1_A3 2014-07-24 15:29:21 -07:00
Brian Terlson fcba15ff11 Merge pull request #53 from smikes/CONTRIBUTING-async-printhandles
CONTRIBUTING: add notes on async
2014-07-23 17:21:07 -07:00
smikes 99706a2786 CONTRIBUTING: add notes on async
add a table showing which print handle to use when
running async tests through test262.py runner

@anba contributed information about async tests in
SpiderMonkey and JavaScriptCore
2014-07-23 21:55:16 +01:00
Brian Terlson dd821f2700 Merge pull request #52 from smikes/syntax-error-isAsyncTest-sth
sth: correct syntax error in new fn isAsyncTest
2014-07-22 17:33:02 -07:00
smikes a8c49d8b47 sth: correct syntax error in new fn isAsyncTest 2014-07-22 10:41:32 -06:00
Brian Terlson 66aab6025d Fix comment formatting for S22.1.2.3_T1.js 2014-07-21 15:47:50 -07:00
Brian Terlson 66366d6961 Merge pull request #49 from smikes/faster-python-runner
test262.py: only include helper scripts when needed
2014-07-21 14:32:03 -07:00
Brian Terlson 1cbf603a2d Merge pull request #50 from smikes/additional-CONTRIBUTING-notes
CONTRIBUTING: document test262.py, async tests
2014-07-21 13:16:29 -07:00
Sam Mikes d180b84e01 CONTRIBUTING: document test262.py, async tests
add a section on requirements for using console test runner test262.py

add a section on asynchronous tests

add subsection to authoring guidelines with suggestion for test names
2014-07-21 10:19:06 -06:00
Sam Mikes d4a3479a1e test262.py: only include helper scripts when needed
test262.py: only supply async helper scripts when test is async
sth.js: factor out function isAsyncTest()
timer.js: improve workaround for async tests when Promise is defined but setTimeout is noot

timer.js emulates setTimeout using Promise by doing a busy loop that checks
if `timeout` milliseconds have elapsed.  Modified check to (timeLeft > 0) instead
of (!timeLeft) to prevent infinite loop when check does not happen to run
at precise millisecond timeout expires.

Because test262.py did not support the $INCLUDE directive, some helper
scripts were added to every test -- notably testIntl, timer, and donePrintHandle
Now that $INCLUDE is supported, these can be dropped, speeding overall test run time
2014-07-21 15:15:04 +01:00
Brian Terlson e09d62bba3 Merge pull request #17 from hankyates/array-fill-tests
* hankyates/array-fill-tests:
  Adding Array.prototype#fill tests
2014-07-18 15:20:03 -07:00
Hank Yates cae283b563 Adding Array.prototype#fill tests 2014-07-18 15:17:33 -07:00
Brian Terlson 33c8399de8 Merge pull request #31 from Constellation/fix-error-code
Propagate error code when test cases are failed
2014-07-18 11:38:31 -07:00
Brian Terlson 96c6efe0ef Merge pull request #43 from smikes/initial-Promise-tests
Initial promise tests
2014-07-18 11:22:48 -07:00
Brian Terlson 821e06e3f1 Merge pull request #44 from smikes/fix-packager
packager: make packager runnable
2014-07-18 11:21:52 -07:00
smikes 7032af4db8 packager: make packager runnable
packager.py cannot run due to syntax errors in a few script files

packagerConfig: use git instead of hg
test262: use pop instead of delete to avoid throw if property missing
S22.1.2.1_T*: fix docString header comment: s/b /**
S22.1.2.1_T3: fix docString header comment: s/b /**, fix end of docstring * / => */
2014-07-18 08:53:29 +01:00