Commit Graph

245 Commits

Author SHA1 Message Date
David Fugate 2b0122ef82 All tests are globally scoped tests - Part I. 2011-09-24 16:35:45 -07:00
David Fugate ab1142e498 Merge. 2011-09-24 11:48:21 -07:00
David Fugate 54b6ae5e9c Moved resources and images directories (from website) up a couple levels.
Added new 'packaging' directory to tooling.
2011-09-24 11:47:48 -07:00
Mark Miller 2e320eddb7 Renamed .comment property to .commentary 2011-09-24 11:11:55 -07:00
Mark Miller 292ee6e92c Partial conversion of an older version of convert.js to Python. 2011-09-24 11:11:24 -07:00
David Fugate ff32b5c3fc New HTML+console packager. 2011-09-24 10:35:50 -07:00
Mark Miller ea9a2f4c4c Adjusted converter 2011-09-23 17:41:23 -07:00
Mark Miller 122550c5dd Merged 2011-09-23 16:21:12 -07:00
Mark Miller aac6432ae1 Updated converter to process the new IETCGlobalScope.js file. 2011-09-14 12:43:53 -07:00
Mark Miller fc18852cda Merge 2011-09-13 23:34:34 -07:00
Mark Miller 9f7d9f6ab5 Fixed test262.py to handle strict options correctly.
Fixed convert.py to convert a "use strict" into an @strict_only
2011-09-13 22:06:04 -07:00
David Fugate 807a3ba1b7 Merge. 2011-09-12 11:25:23 -07:00
Mark Miller dec1be4414 minor oversight 2011-09-11 22:04:55 -07:00
Mark Miller a2ca5b512b Adapted the sputnik command line testRunner to a command line
testRunner, test262.py, that can run all the converted tests.
2011-09-11 21:12:01 -07:00
Mark Miller 274b5514fa As David Fugate requested, changed the conversion of ietestcenter
style to append runTestCase(funcName); rather than
assertTrue(funcName.call(this)), giving the testing framework more
control.
2011-09-09 14:48:37 -07:00
Mark Miller 5c054fa412 First checkin of browserPlatform.js, even though it's far from ready. 2011-09-07 23:41:10 -07:00
Mark Miller ca417c93dc Now generating the format David Fugate and I agreed on this
morning. The rewrite of "function testcase()..." now puts the
assertTrue at the bottom. Preconditions, names, and ids are
removed. And the path in the file is ignored, and is instead set
accurately according to where the file is found.
2011-09-07 21:42:49 -07:00
Mark Miller 2f25dc8f0c Added copyright. 2011-09-06 23:37:30 -07:00
Mark Miller 1558636929 Converts test cases to proposed new canonical form 2011-09-06 23:32:28 -07:00
David Fugate 2871886420 test\harness\*:
- a lot of JS harness code written in strings have been moved out to actual physical files
  such as ed.js (syntax error detection for globally scoped tests) and gs.js (global scope test
  case validator).  This change makes it far easier to maintain the test harness code
- reorganized helper.js providing a clear indication which methods are used by external objects,
  which are implementation details, and which are unequivocally test262-specific.  I've also added,
  openErrorWindow, which will be used to open a descriptive error message window for each test case
  failure reported on the 'Run' tab
- improved the error message for syntax errors occurring when a test case fails to load
- sta.js no longer tries to pickle all helper functions it contains!  Instead, we load the file
  directly from sth.js.  The performance of fnGlobalObject has been improved.  Finally, the ES5Harness
  object has been moved from sth.js (in a string) to here
- sth.js now has a browser implementer hook, controller.implementerHook, which allows browser implementers
  to handle test case failures in their own way (e.g., log to the filesystem).  The 'run' function was
  basically re-written

Added 37 new test cases from the "IE Test Center" Build release.  There were 14 modifications to
existing test cases as well.  Refactored SputnikGlobalScope.js such that test case paths are now used
as indices into the GlobalScopeTests array.

TestCasePackager.py had the concept of templated test harnesses introduced - see templates\runner.test262.html.
Also added support for one HTML test harness per ES5 chapter.  Last but not least, TestCasePackagerConfig.py
now has a 'source control' abstraction class which abstracts away source control adds|edits when dynamically
generating *.json and *.html test chapters.
2011-08-25 11:18:44 -07:00
David Fugate c0b6d37ba0 Added some missing copyright headers. 2011-06-30 14:33:50 -07:00
David Fugate 42b534663f Added a small script, InvalidTestDetector.py, to help detect test dependencies on DOM and
host objects (which make them invalid for test262).  Using this, I found one benign 'alert'
usage (it was never even called) and removed it.
2011-06-30 14:31:11 -07:00
David Fugate b78c959d2a New Sputnik 'negative' metadata that included exception type was causing problems for SputnikConverter.
Took the easy fix and split the metadata into two: 'negative' and 'errortype'.
2011-06-29 11:11:12 -07:00
David Fugate c04a994e00 Added missing license header to TestCasePackager.py. Also, split
this module in two such that the configuration of the test case
packaging tool is separate from the implementation.
2011-06-02 15:41:54 -07:00
David Fugate 994e6f3049 A previous check-in made today lost generation of 'N.0' test section directories for
tests covering a given chapter, N, without delving into subsections.  This in turn
broken the Results page which was by default displaying individual results for chapters
13(.0) and 14(.0).  Fixed.
2011-04-20 16:52:14 -07:00
David Fugate b055423983 Removed (SputnikConverter) requirement that globally scoped tests be generated to a
'GlobalScope' directory.
2011-04-20 12:01:06 -07:00
David Fugate 545f2c34a0 *NOTE: this is a work-in-progress. Need to remove our dependency on a separate 'GlobalScope'
directory next*

SputnikConverter:
- ES5TestCase.cs
	* Case of JSON-based property names was wrong.  Fixed
	* Use the tests' 'id' instead of 'path' as the GlobalScopeTests keys
	* Added 'id' and 'path' as Global Scope test metadata.  The correct/clean solution here is to simply use 'path'
	  as the key to GlobalScopeTests, but this refactoring needs to be undertaken later when we can convert the
	  'normal' test cases over to use 'path' as the key as well
	* Turns out we cannot depend on the message received by window.onerror to have some form of "syntax"
	  contained within it.  Instead, we'll just rely on the regular expression ".", matches any one character,
	  for the short term
- SputnikTestCase.cs
	* Same case issue as for ES5TestCases.cs
	* Don't trust the Sputnik metadata for the ES5 section name or even test case id to be correct. Instead,
	  generate this information from the file path of the test case


TestCasePackager.py:
- added a new global, GLOBAL_SCOPE_FILES, which is a list of JS files found directly under test\suite\*.js
  which include metadata for so-called globally scoped tests.  These files are imported directly by the HTML
  test harness

test\suite\*:
- regenerated Sputnik tests based on new converter

default.html:
- import SputnikGlobalScope.js.  Really TestCasePackager.py should generate the global scope imports to
  default.html automatically...


website\resources\scripts\testcases\*:
- test cases have shuffled from existing *.json files into globalscope.json
2011-04-20 11:17:38 -07:00
David Fugate 06e62f878b A number of small improvements to Sputnik Test Converter:
- restructured the generated GlobalScope.js file such that the HTML test harness
  can import multiple such files without worrying about one blowing aways another's
  metadata
- inline with the last change, GlobalScope.js has been renamed to SputnikGlobalScope.js
  and generated directly to test\suite\*
- the path and ID properties for most entries in GlobalScope.js were incorrect.  That is,
  they were based on the metadata contained in the original Sputnik tests and not the
  new test262 directories and filenames
- generate global scope tests to test\suite\GlobalScope\* instead of
  test\suite\sputnik_converted\GlobalScope\*.  Going forward we need to move towards
  integrating all test sources into test262 directories (e.g., "GlobalScope"===good;
  "Sputnik\GlobalScope"===not-so-good)
- a few hacks to the sources (e.g., private vars to public vars) I'll fix in a refactoring
  later.  Just trying to get everything working first
2011-04-19 10:15:02 -07:00
David Fugate 24b2fcf78d Vendor did a bit of work to preserve Sputnik's negative test cases in their existing format.
Still needs a bit of integration work into the test harness.

A number of Sputnik tests were written outside the context of a chapter's sections.  E.g.,
"Chapter 13" versus "Chapter 13, Section 1".  We now fake a section number ("13.0" for the
example above) for such cases when generating test case metadata.
2011-04-08 13:29:16 -07:00
David Fugate 08a7f7433a Few minor changes to sta.js and sth.js to support Strict Mode.
Renamed move_test.py to FixTestCasePlacement.py. Still a work in progress.
2011-04-07 10:12:45 -07:00
David Fugate 09186bafb4 84 IE Test Center test cases had corrupted 'path' properties in
their test case objects.  Created an automated tool, FixPathsAndIds.py,
to fix these.

TestCasePackager.py no longer throws when it encounters a non-*.js
file where it expects test cases.  Instead, it simply ignores it.
2011-03-30 09:48:29 -07:00
David Fugate 76ac2946d5 Removed TestCasePackager.ps1. It's been supplanted by TestCasePackager.py. 2011-03-23 13:46:59 -07:00
David Fugate ba59cf13be More cleanup on TestCasePackager.py. 2011-03-23 13:46:15 -07:00
David Fugate 31e2bcacf6 Partial cleanup of TestCasePackager.py. Major change is the 'json'
module is now utilized.
2011-03-23 12:48:09 -07:00
David Fugate 61343f1b93 TestCasePackager.py is a verbatim port of TestCasePackager.ps1. The
rationale behind the addition of this file is it's meant to replace
TestCasePackager.ps1 outright and will be runnable on all major
operating systems.  There's still a bit of cleanup work needed as
the Python port was hardly optimized for the language.

A few side effects of this change:
- it now takes under ten seconds to generate the test262 website (PS
  version was taking over a minute)
- generated *.json files are ~5% smaller in size (PS was forcing
  '\r\n' and the Python version preserves the tests' newlines whether
  they're '\r\n' or '\n')
2011-03-23 10:37:21 -07:00
David Fugate 2a7b5435d7 Switched from using XML for encoded test cases to JSON. 2011-03-11 10:59:52 -08:00
David Fugate 0bcccaca10 Refactored TestCasePackager.ps1 such that it now produces test case XMLs according
to the following criteria:
1.  If a test case directory directly contains *.js files at the root level, package
    the entire directory as an XML regardless of how many *.js files are in
    subdirectories
2.  If the directory and subdirectories contain less than 1,000 test cases, package
    the entire directory as an XML.  Otherwise...
3.  Perform steps 1 and 2 on each subdirectory of the directory

The net effect of this change is that no test case XMLs are larger than 1.5 megs any longer,
although the total number of test XMLs has jumped from about a dozen to ~75.  This should
make running the test harness seem a little smoother across all browsers since we won't be
blocked downloading 4 meg files for several seconds any longer.
2011-03-02 10:24:58 -08:00
David Fugate d3d9d28c18 Sputnik tests were previously modified to ensure global objects with common names (e.g., 'obj')
were actually unique across the test cases.  This *was* needed prior to November as we weren't
running each test case in it's own private global environment.  The situation now is that
we're running each test within it's own iframe => the modifications are no longer needed.

Few small improvements to SputnikConverter:
- App.config file locations have been fixed
- template files get pushed alongside generated tool binaries
- the root path for Sputnik conformance files is "Conformance", not "tests"
- allow the main exe to throw exceptions so they can be properly debugged with VS
2011-02-10 17:58:47 -08:00
David Fugate 0252ed17af Added a tool to help analyze our coverage of ES5. 2011-01-14 15:07:29 -08:00
David Fugate 42b884b7ba TestCasePackager.ps1 had problems dealing with test case files that had valid test code
prior to the usage of "ES5Harness".  Specifically in cases like:
  var abc = ...;
  ES5Harness.registerTest( {
  //...abc gets used here

the declaration of "abc" would've been ripped out thereby corrupting the test.

This change fixes the issue for all existing IE Test Center and Sputnik test cases. Note
however that it could potentially fail for lines like this: "/*abc*/ /*".  If we ever add
cases including comments like this, the implementation of isTestStarted will need to be
revisited.

There were five such test cases that were being affected by this issue in IE Test
Center's chapter 10 and 15 tests.  These have all been fixed via the updated script.
2010-11-16 15:43:29 -08:00
David Fugate 2f34b4e050 TestCasePacker.ps1:
- The only parameter required for this script is now the test suite version.  All other
  parameters are generated relative to the location of this script
- This script now generates the XML'ized test cases directly to website\resources\scripts\testcases\.
  Likewise, it copies the test harness taken from test\harness\* to website\resources\scripts\global\
- Added tons of error checking and we now emit the current generation status to stdout
- Made the script more generic in the sense that it can take arbitrary directories under test\suite\*
  containing ES5 test chapters.  Previous behavior was it was looking for test chapters directly under website\
2010-11-16 07:46:42 -08:00
David Fugate 35450e9e80 Did a bit of refactoring on the test262 directory structure and propagated changes from
website\* out to test\*:
- Removed test\harness\ECMA-262-TOC.xml.  The casing on this file was incorrect, but
  more importantly it's a static file not generated by the harness
- Populated test\harness with the contents of website\resources\scripts\global\.  In
  the future, we need to update test\harness\* and propagate these changes out to
  website\*
- Test\suite\ietestcenter is now a verbatim copy of the IE Test Center tests that
  WERE under website\resources\scripts\testcases\*
- Moved all Sputnik tests from website\resources\scripts\testcases\* out to
  test\suite\sputnik_converted
- Moved website\resources\scripts\testcases\excludelist.xml out to test\config\*.  This
  particular file was only used for the test conversion process to XML, and is not actually
  needed by the website as best as I can tell
- Website\resources\scripts\testcases now only contains the XMLized test cases.  This is
  the right thing to do as the *.js files here weren't actually being used by the website
  and the general public can now peruse the test cases directly via Mercurial
2010-11-15 21:23:35 -08:00
David Fugate fbb888778d Quite a few modifications have been made to the test harness (website/resources/scripts/global/*)
which have resulted in it being able to run negative test cases which corrupt the global JavaScript
environment.  This lets us enable fifty plus more Sputnik test cases.  Another positive result from
this test harness refactoring is that Opera no longer hangs when running the tests.
2010-11-12 09:27:59 -08:00
David Fugate c26f761a9f tools\TestCaseHTMLPackager\TestCasePacker.ps1: there were some improvements made to this script WRT to the
processing of unicode-related test cases.

tools\TestCaseHTMLPackager\TestUpdater.ps1:  new script which preprocesses test cases (rips out comments,
etc.)

external\contributions\Microsoft\ietestcenter_ppb5\chapter11\11.4\11.4.1\11.4.1-4.a-10.js and
website\resources\scripts\testcases\chapter11\11.4\11.4.1\11.4.1-4.a-10.js:  cleaned up a code comment

website\enginereports\sample.xml: removed

website\resources\scripts\global\jquery-1.4.2.js:  removed

website\resources\scripts\*.ps1:  moved into the tools\ directory

website\Web.config:  removed.  This is only relevant for Windows-based hosting of test262

website\browserreport.html:  removed
2010-11-03 10:10:47 -07:00
David Fugate 7396642963 This commit includes Microsoft's initial contributions to Test262:
- external\contributions\: test contributions to Test262 from external entities such as Microsoft and Google.
                           This directory consists of the external tests without any modifications
- test\harness\:  test harness used to run Test262 tests.  Presently web-based
- test\suite\:    suite of vendor-neutral ECMAScript test cases conforming to the ES5 spec
- tools\:         among other things this includes a set of tools used to convert various external test
                  contributions to a format the Test262 test harness can consume
- website\:       an archived copy of the http://test262.ecmascript.org website
2010-10-18 20:50:07 -07:00