From 56ca8add7dbc1efe49e5456689ddeb57ef4e296a Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Fri, 28 May 2021 18:53:04 -0400 Subject: [PATCH] Update project structure to support non-JS files This change is in service of forthcoming tests for the "JSON modules" language proposal [1]. Verifying the semantics of that proposal requires modules whose source text is not valid ECMAScript; this change updates the guidelines for contributing and interpreting tests so that such test material can be handled consistently. Differentiating JSON files with a distinct file name suffice will assist consumers which require special handling of such files (e.g. web browsers). Change the pattern used to designate "fixture" files so that it may be applied to files used for JSON modules. Increment the project version number to alert consumers of this change in interpreting instructions. [1] https://github.com/tc39/proposal-json-modules --- CONTRIBUTING.md | 4 ++-- INTERPRETING.md | 4 +++- features.txt | 4 ++++ package.json | 2 +- tools/lint/lib/checks/frontmatter.py | 2 +- tools/lint/lib/checks/license.py | 3 +++ tools/lint/test/fixtures/{ => test}/esid_invalid.js | 0 tools/lint/test/fixtures/{ => test}/features_empty.js | 0 tools/lint/test/fixtures/{ => test}/features_unrecognized.js | 0 tools/lint/test/fixtures/{ => test}/features_valid.js | 0 .../test/fixtures/{ => test}/filename_forbidden_char_$.js | 0 .../fixtures/{ => test}/flags_canblock_true_and_false.js | 0 .../test/fixtures/{ => test}/flags_module_and_noStrict.js | 0 .../test/fixtures/{ => test}/flags_module_and_onlyStrict.js | 0 .../fixtures/{ => test}/flags_onlyStrict_and_noStrict.js | 0 .../lint/test/fixtures/{ => test}/flags_raw_and_noStrict.js | 0 .../test/fixtures/{ => test}/flags_raw_and_onlyStrict.js | 0 .../test/fixtures/test/frontmatter_copyright_FIXTURE.json | 2 ++ .../test/fixtures/{ => test}/frontmatter_invalid_yaml.js | 0 .../test/fixtures/{ => test}/frontmatter_missing_desc.js | 0 .../test/fixtures/{ => test}/frontmatter_module_FIXTURE.js | 0 .../{ => test}/frontmatter_module_with_meta_FIXTURE.js | 0 tools/lint/test/fixtures/{ => test}/frontmatter_omitted.js | 0 .../test/fixtures/{ => test}/frontmatter_unrecognized.js | 0 .../test/fixtures/{ => test}/harness_features_missing.js | 0 .../{ => test}/harness_features_multiple_includes.js | 0 .../test/fixtures/{ => test}/harness_features_partial.js | 0 .../lint/test/fixtures/{ => test}/harness_features_valid.js | 0 .../{ => test}/harness_verifyconfigurableproperty_invalid.js | 0 .../{ => test}/harness_verifyconfigurableproperty_valid.js | 0 .../lint/test/fixtures/{ => test}/includes_invalid_empty.js | 0 .../lint/test/fixtures/{ => test}/includes_invalid_noref.js | 0 tools/lint/test/fixtures/{ => test}/includes_valid_direct.js | 0 .../lint/test/fixtures/{ => test}/includes_valid_indirect.js | 0 tools/lint/test/fixtures/{ => test}/license_alternate_1.js | 0 tools/lint/test/fixtures/{ => test}/license_alternate_2.js | 0 tools/lint/test/fixtures/{ => test}/license_alternate_3.js | 0 tools/lint/test/fixtures/{ => test}/license_alternate_4.js | 0 tools/lint/test/fixtures/{ => test}/license_alternate_5.js | 0 tools/lint/test/fixtures/{ => test}/license_generated.js | 0 tools/lint/test/fixtures/{ => test}/license_invalid_year.js | 0 .../test/fixtures/{ => test}/license_invalid_year_range.js | 0 tools/lint/test/fixtures/{ => test}/license_missing.js | 0 .../lint/test/fixtures/{ => test}/negative_invalid_phase.js | 0 .../lint/test/fixtures/{ => test}/negative_missing_phase.js | 0 tools/lint/test/fixtures/{ => test}/negative_missing_type.js | 0 tools/lint/test/fixtures/{ => test}/negative_no_raw_stmt.js | 0 .../test/fixtures/{ => test}/negative_no_raw_wrong_stmt.js | 0 .../fixtures/{ => test}/negative_parse_throw_bad_value.js | 0 .../test/fixtures/{ => test}/negative_parse_throw_missing.js | 0 tools/lint/test/fixtures/{ => test}/negative_raw_call.js | 0 .../lint/test/fixtures/{ => test}/negative_raw_wrong_call.js | 0 .../{ => test}/negative_resolution_throw_bad_value.js | 0 .../fixtures/{ => test}/negative_resolution_throw_missing.js | 0 tools/lint/test/fixtures/{ => test}/negative_string.js | 0 tools/lint/test/fixtures/{ => test}/negative_valid_parse.js | 0 .../test/fixtures/{ => test}/negative_valid_resolution.js | 0 .../lint/test/fixtures/{ => test}/negative_valid_runtime.js | 0 tools/lint/test/fixtures/{ => test}/valid_es5id.js | 0 tools/lint/test/fixtures/{ => test}/valid_es6id.js | 0 tools/lint/test/fixtures/{ => test}/valid_esid.js | 0 tools/lint/test/fixtures/{ => test}/valid_esid_alternate.js | 0 tools/lint/test/run.py | 5 ++--- 63 files changed, 18 insertions(+), 8 deletions(-) rename tools/lint/test/fixtures/{ => test}/esid_invalid.js (100%) rename tools/lint/test/fixtures/{ => test}/features_empty.js (100%) rename tools/lint/test/fixtures/{ => test}/features_unrecognized.js (100%) rename tools/lint/test/fixtures/{ => test}/features_valid.js (100%) rename tools/lint/test/fixtures/{ => test}/filename_forbidden_char_$.js (100%) rename tools/lint/test/fixtures/{ => test}/flags_canblock_true_and_false.js (100%) rename tools/lint/test/fixtures/{ => test}/flags_module_and_noStrict.js (100%) rename tools/lint/test/fixtures/{ => test}/flags_module_and_onlyStrict.js (100%) rename tools/lint/test/fixtures/{ => test}/flags_onlyStrict_and_noStrict.js (100%) rename tools/lint/test/fixtures/{ => test}/flags_raw_and_noStrict.js (100%) rename tools/lint/test/fixtures/{ => test}/flags_raw_and_onlyStrict.js (100%) create mode 100644 tools/lint/test/fixtures/test/frontmatter_copyright_FIXTURE.json rename tools/lint/test/fixtures/{ => test}/frontmatter_invalid_yaml.js (100%) rename tools/lint/test/fixtures/{ => test}/frontmatter_missing_desc.js (100%) rename tools/lint/test/fixtures/{ => test}/frontmatter_module_FIXTURE.js (100%) rename tools/lint/test/fixtures/{ => test}/frontmatter_module_with_meta_FIXTURE.js (100%) rename tools/lint/test/fixtures/{ => test}/frontmatter_omitted.js (100%) rename tools/lint/test/fixtures/{ => test}/frontmatter_unrecognized.js (100%) rename tools/lint/test/fixtures/{ => test}/harness_features_missing.js (100%) rename tools/lint/test/fixtures/{ => test}/harness_features_multiple_includes.js (100%) rename tools/lint/test/fixtures/{ => test}/harness_features_partial.js (100%) rename tools/lint/test/fixtures/{ => test}/harness_features_valid.js (100%) rename tools/lint/test/fixtures/{ => test}/harness_verifyconfigurableproperty_invalid.js (100%) rename tools/lint/test/fixtures/{ => test}/harness_verifyconfigurableproperty_valid.js (100%) rename tools/lint/test/fixtures/{ => test}/includes_invalid_empty.js (100%) rename tools/lint/test/fixtures/{ => test}/includes_invalid_noref.js (100%) rename tools/lint/test/fixtures/{ => test}/includes_valid_direct.js (100%) rename tools/lint/test/fixtures/{ => test}/includes_valid_indirect.js (100%) rename tools/lint/test/fixtures/{ => test}/license_alternate_1.js (100%) rename tools/lint/test/fixtures/{ => test}/license_alternate_2.js (100%) rename tools/lint/test/fixtures/{ => test}/license_alternate_3.js (100%) rename tools/lint/test/fixtures/{ => test}/license_alternate_4.js (100%) rename tools/lint/test/fixtures/{ => test}/license_alternate_5.js (100%) rename tools/lint/test/fixtures/{ => test}/license_generated.js (100%) rename tools/lint/test/fixtures/{ => test}/license_invalid_year.js (100%) rename tools/lint/test/fixtures/{ => test}/license_invalid_year_range.js (100%) rename tools/lint/test/fixtures/{ => test}/license_missing.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_invalid_phase.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_missing_phase.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_missing_type.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_no_raw_stmt.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_no_raw_wrong_stmt.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_parse_throw_bad_value.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_parse_throw_missing.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_raw_call.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_raw_wrong_call.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_resolution_throw_bad_value.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_resolution_throw_missing.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_string.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_valid_parse.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_valid_resolution.js (100%) rename tools/lint/test/fixtures/{ => test}/negative_valid_runtime.js (100%) rename tools/lint/test/fixtures/{ => test}/valid_es5id.js (100%) rename tools/lint/test/fixtures/{ => test}/valid_es6id.js (100%) rename tools/lint/test/fixtures/{ => test}/valid_esid.js (100%) rename tools/lint/test/fixtures/{ => test}/valid_esid_alternate.js (100%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a7d690e907..785d362e3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -250,9 +250,9 @@ function Test262Error(message) { } ``` -## Rules For Module `_FIXTURE.js` Files +## Rules For Module `_FIXTURE` Files -The [Module section of INTERPRETING.md](https://github.com/tc39/test262/blob/HEAD/INTERPRETING.md#modules) states that `_FIXTURE.js` files will not have have Realm modifications applied. In practice, this means that code in `_FIXTURE.js` files must abide by the following rules: +The [Module section of INTERPRETING.md](https://github.com/tc39/test262/blob/HEAD/INTERPRETING.md#modules) states that `_FIXTURE` files will not have have Realm modifications applied. In practice, this means that code in `_FIXTURE` files must abide by the following rules: - **MUST NOT** refer to, or make use of any [Test262-Defined Bindings](https://github.com/tc39/test262/blob/HEAD/INTERPRETING.md#test262-defined-bindings) in any way. - **MUST NOT** refer to, or make use of any [Host-Defined Functions](https://github.com/tc39/test262/blob/HEAD/INTERPRETING.md#host-defined-functions) in any way. diff --git a/INTERPRETING.md b/INTERPRETING.md index d907a125f5..b269bb12be 100644 --- a/INTERPRETING.md +++ b/INTERPRETING.md @@ -138,7 +138,7 @@ This must precede any additional text modifications described by test metadata. ### Modules Test262 includes tests for ECMAScript 2015 module code, denoted by the "module" -metadata flag. Files bearing a name ending in `_FIXTURE.js` **MUST NOT** be interpreted as standalone tests; they are intended to be referenced by test files. Realm modifications, including [Test262-Defined Bindings](#test262-defined-bindings) and [Host-Defined Functions](#host-defined-functions), are not applied to code executed from `_FIXTURE.js` files. See the [**Rules For Module `_FIXTURE.js` Files** section of CONTRIBUTING.md](https://github.com/tc39/test262/blob/HEAD/CONTRIBUTING.md#rules-for-module-fixturejs-files) for more information. +metadata flag. Files bearing a name which includes the sequence `_FIXTURE` **MUST NOT** be interpreted as standalone tests; they are intended to be referenced by test files. Realm modifications, including [Test262-Defined Bindings](#test262-defined-bindings) and [Host-Defined Functions](#host-defined-functions), are not applied to code executed from `_FIXTURE` files. See the [**Rules For Module `_FIXTURE` Files** section of CONTRIBUTING.md](https://github.com/tc39/test262/blob/HEAD/CONTRIBUTING.md#rules-for-module-fixturejs-files) for more information. All module specifiers used by Test262 begin with the character sequence `./`. The remaining characters should be interpreted as the name of a file within the @@ -157,6 +157,8 @@ import * as ns from './dep.js'; Implementers should attempt to resolve this module specifier by loading a file located at `test/language/import/nested/dep.js`. +Files bearing a name ending in `.json` are intended to be interpreted as JSON. + ## Test Results By default, tests signal failure by generating an uncaught exception. If diff --git a/features.txt b/features.txt index cd4c81df94..edab64c4fa 100644 --- a/features.txt +++ b/features.txt @@ -315,3 +315,7 @@ error-cause # Import Assertions # https://github.com/tc39/proposal-import-assertions/ import-assertions + +# JSON modules +# https://github.com/tc39/proposal-json-modules +json-modules diff --git a/package.json b/package.json index f0b8c36cc1..b97e2ea4da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "test262", - "version": "4.0.0", + "version": "5.0.0", "description": "Test262 tests conformance to the continually maintained draft future ECMAScript standard found at http://tc39.github.io/ecma262/ , together with any Stage 3 or later TC39 proposals.", "repository": { "type": "git", diff --git a/tools/lint/lib/checks/frontmatter.py b/tools/lint/lib/checks/frontmatter.py index 4f0a5bff31..04d247b7e5 100644 --- a/tools/lint/lib/checks/frontmatter.py +++ b/tools/lint/lib/checks/frontmatter.py @@ -12,7 +12,7 @@ class CheckFrontmatter(Check): ID = 'FRONTMATTER' def run(self, name, meta, source): - if name.endswith('_FIXTURE.js'): + if '_FIXTURE' in name: if meta is not None: return '"Fixture" files cannot specify metadata' return diff --git a/tools/lint/lib/checks/license.py b/tools/lint/lib/checks/license.py index a5a0a3d110..2dd73ee7c9 100644 --- a/tools/lint/lib/checks/license.py +++ b/tools/lint/lib/checks/license.py @@ -23,6 +23,9 @@ class CheckLicense(Check): ID = 'LICENSE' def run(self, name, meta, source): + if name.endswith('.json'): + return + if meta and 'flags' in meta and 'generated' in meta['flags']: return diff --git a/tools/lint/test/fixtures/esid_invalid.js b/tools/lint/test/fixtures/test/esid_invalid.js similarity index 100% rename from tools/lint/test/fixtures/esid_invalid.js rename to tools/lint/test/fixtures/test/esid_invalid.js diff --git a/tools/lint/test/fixtures/features_empty.js b/tools/lint/test/fixtures/test/features_empty.js similarity index 100% rename from tools/lint/test/fixtures/features_empty.js rename to tools/lint/test/fixtures/test/features_empty.js diff --git a/tools/lint/test/fixtures/features_unrecognized.js b/tools/lint/test/fixtures/test/features_unrecognized.js similarity index 100% rename from tools/lint/test/fixtures/features_unrecognized.js rename to tools/lint/test/fixtures/test/features_unrecognized.js diff --git a/tools/lint/test/fixtures/features_valid.js b/tools/lint/test/fixtures/test/features_valid.js similarity index 100% rename from tools/lint/test/fixtures/features_valid.js rename to tools/lint/test/fixtures/test/features_valid.js diff --git a/tools/lint/test/fixtures/filename_forbidden_char_$.js b/tools/lint/test/fixtures/test/filename_forbidden_char_$.js similarity index 100% rename from tools/lint/test/fixtures/filename_forbidden_char_$.js rename to tools/lint/test/fixtures/test/filename_forbidden_char_$.js diff --git a/tools/lint/test/fixtures/flags_canblock_true_and_false.js b/tools/lint/test/fixtures/test/flags_canblock_true_and_false.js similarity index 100% rename from tools/lint/test/fixtures/flags_canblock_true_and_false.js rename to tools/lint/test/fixtures/test/flags_canblock_true_and_false.js diff --git a/tools/lint/test/fixtures/flags_module_and_noStrict.js b/tools/lint/test/fixtures/test/flags_module_and_noStrict.js similarity index 100% rename from tools/lint/test/fixtures/flags_module_and_noStrict.js rename to tools/lint/test/fixtures/test/flags_module_and_noStrict.js diff --git a/tools/lint/test/fixtures/flags_module_and_onlyStrict.js b/tools/lint/test/fixtures/test/flags_module_and_onlyStrict.js similarity index 100% rename from tools/lint/test/fixtures/flags_module_and_onlyStrict.js rename to tools/lint/test/fixtures/test/flags_module_and_onlyStrict.js diff --git a/tools/lint/test/fixtures/flags_onlyStrict_and_noStrict.js b/tools/lint/test/fixtures/test/flags_onlyStrict_and_noStrict.js similarity index 100% rename from tools/lint/test/fixtures/flags_onlyStrict_and_noStrict.js rename to tools/lint/test/fixtures/test/flags_onlyStrict_and_noStrict.js diff --git a/tools/lint/test/fixtures/flags_raw_and_noStrict.js b/tools/lint/test/fixtures/test/flags_raw_and_noStrict.js similarity index 100% rename from tools/lint/test/fixtures/flags_raw_and_noStrict.js rename to tools/lint/test/fixtures/test/flags_raw_and_noStrict.js diff --git a/tools/lint/test/fixtures/flags_raw_and_onlyStrict.js b/tools/lint/test/fixtures/test/flags_raw_and_onlyStrict.js similarity index 100% rename from tools/lint/test/fixtures/flags_raw_and_onlyStrict.js rename to tools/lint/test/fixtures/test/flags_raw_and_onlyStrict.js diff --git a/tools/lint/test/fixtures/test/frontmatter_copyright_FIXTURE.json b/tools/lint/test/fixtures/test/frontmatter_copyright_FIXTURE.json new file mode 100644 index 0000000000..553b3374fe --- /dev/null +++ b/tools/lint/test/fixtures/test/frontmatter_copyright_FIXTURE.json @@ -0,0 +1,2 @@ +^ expected errors | v input +"Neither frontmatter nor copyright are required for JSON files because those would invalidate the content." diff --git a/tools/lint/test/fixtures/frontmatter_invalid_yaml.js b/tools/lint/test/fixtures/test/frontmatter_invalid_yaml.js similarity index 100% rename from tools/lint/test/fixtures/frontmatter_invalid_yaml.js rename to tools/lint/test/fixtures/test/frontmatter_invalid_yaml.js diff --git a/tools/lint/test/fixtures/frontmatter_missing_desc.js b/tools/lint/test/fixtures/test/frontmatter_missing_desc.js similarity index 100% rename from tools/lint/test/fixtures/frontmatter_missing_desc.js rename to tools/lint/test/fixtures/test/frontmatter_missing_desc.js diff --git a/tools/lint/test/fixtures/frontmatter_module_FIXTURE.js b/tools/lint/test/fixtures/test/frontmatter_module_FIXTURE.js similarity index 100% rename from tools/lint/test/fixtures/frontmatter_module_FIXTURE.js rename to tools/lint/test/fixtures/test/frontmatter_module_FIXTURE.js diff --git a/tools/lint/test/fixtures/frontmatter_module_with_meta_FIXTURE.js b/tools/lint/test/fixtures/test/frontmatter_module_with_meta_FIXTURE.js similarity index 100% rename from tools/lint/test/fixtures/frontmatter_module_with_meta_FIXTURE.js rename to tools/lint/test/fixtures/test/frontmatter_module_with_meta_FIXTURE.js diff --git a/tools/lint/test/fixtures/frontmatter_omitted.js b/tools/lint/test/fixtures/test/frontmatter_omitted.js similarity index 100% rename from tools/lint/test/fixtures/frontmatter_omitted.js rename to tools/lint/test/fixtures/test/frontmatter_omitted.js diff --git a/tools/lint/test/fixtures/frontmatter_unrecognized.js b/tools/lint/test/fixtures/test/frontmatter_unrecognized.js similarity index 100% rename from tools/lint/test/fixtures/frontmatter_unrecognized.js rename to tools/lint/test/fixtures/test/frontmatter_unrecognized.js diff --git a/tools/lint/test/fixtures/harness_features_missing.js b/tools/lint/test/fixtures/test/harness_features_missing.js similarity index 100% rename from tools/lint/test/fixtures/harness_features_missing.js rename to tools/lint/test/fixtures/test/harness_features_missing.js diff --git a/tools/lint/test/fixtures/harness_features_multiple_includes.js b/tools/lint/test/fixtures/test/harness_features_multiple_includes.js similarity index 100% rename from tools/lint/test/fixtures/harness_features_multiple_includes.js rename to tools/lint/test/fixtures/test/harness_features_multiple_includes.js diff --git a/tools/lint/test/fixtures/harness_features_partial.js b/tools/lint/test/fixtures/test/harness_features_partial.js similarity index 100% rename from tools/lint/test/fixtures/harness_features_partial.js rename to tools/lint/test/fixtures/test/harness_features_partial.js diff --git a/tools/lint/test/fixtures/harness_features_valid.js b/tools/lint/test/fixtures/test/harness_features_valid.js similarity index 100% rename from tools/lint/test/fixtures/harness_features_valid.js rename to tools/lint/test/fixtures/test/harness_features_valid.js diff --git a/tools/lint/test/fixtures/harness_verifyconfigurableproperty_invalid.js b/tools/lint/test/fixtures/test/harness_verifyconfigurableproperty_invalid.js similarity index 100% rename from tools/lint/test/fixtures/harness_verifyconfigurableproperty_invalid.js rename to tools/lint/test/fixtures/test/harness_verifyconfigurableproperty_invalid.js diff --git a/tools/lint/test/fixtures/harness_verifyconfigurableproperty_valid.js b/tools/lint/test/fixtures/test/harness_verifyconfigurableproperty_valid.js similarity index 100% rename from tools/lint/test/fixtures/harness_verifyconfigurableproperty_valid.js rename to tools/lint/test/fixtures/test/harness_verifyconfigurableproperty_valid.js diff --git a/tools/lint/test/fixtures/includes_invalid_empty.js b/tools/lint/test/fixtures/test/includes_invalid_empty.js similarity index 100% rename from tools/lint/test/fixtures/includes_invalid_empty.js rename to tools/lint/test/fixtures/test/includes_invalid_empty.js diff --git a/tools/lint/test/fixtures/includes_invalid_noref.js b/tools/lint/test/fixtures/test/includes_invalid_noref.js similarity index 100% rename from tools/lint/test/fixtures/includes_invalid_noref.js rename to tools/lint/test/fixtures/test/includes_invalid_noref.js diff --git a/tools/lint/test/fixtures/includes_valid_direct.js b/tools/lint/test/fixtures/test/includes_valid_direct.js similarity index 100% rename from tools/lint/test/fixtures/includes_valid_direct.js rename to tools/lint/test/fixtures/test/includes_valid_direct.js diff --git a/tools/lint/test/fixtures/includes_valid_indirect.js b/tools/lint/test/fixtures/test/includes_valid_indirect.js similarity index 100% rename from tools/lint/test/fixtures/includes_valid_indirect.js rename to tools/lint/test/fixtures/test/includes_valid_indirect.js diff --git a/tools/lint/test/fixtures/license_alternate_1.js b/tools/lint/test/fixtures/test/license_alternate_1.js similarity index 100% rename from tools/lint/test/fixtures/license_alternate_1.js rename to tools/lint/test/fixtures/test/license_alternate_1.js diff --git a/tools/lint/test/fixtures/license_alternate_2.js b/tools/lint/test/fixtures/test/license_alternate_2.js similarity index 100% rename from tools/lint/test/fixtures/license_alternate_2.js rename to tools/lint/test/fixtures/test/license_alternate_2.js diff --git a/tools/lint/test/fixtures/license_alternate_3.js b/tools/lint/test/fixtures/test/license_alternate_3.js similarity index 100% rename from tools/lint/test/fixtures/license_alternate_3.js rename to tools/lint/test/fixtures/test/license_alternate_3.js diff --git a/tools/lint/test/fixtures/license_alternate_4.js b/tools/lint/test/fixtures/test/license_alternate_4.js similarity index 100% rename from tools/lint/test/fixtures/license_alternate_4.js rename to tools/lint/test/fixtures/test/license_alternate_4.js diff --git a/tools/lint/test/fixtures/license_alternate_5.js b/tools/lint/test/fixtures/test/license_alternate_5.js similarity index 100% rename from tools/lint/test/fixtures/license_alternate_5.js rename to tools/lint/test/fixtures/test/license_alternate_5.js diff --git a/tools/lint/test/fixtures/license_generated.js b/tools/lint/test/fixtures/test/license_generated.js similarity index 100% rename from tools/lint/test/fixtures/license_generated.js rename to tools/lint/test/fixtures/test/license_generated.js diff --git a/tools/lint/test/fixtures/license_invalid_year.js b/tools/lint/test/fixtures/test/license_invalid_year.js similarity index 100% rename from tools/lint/test/fixtures/license_invalid_year.js rename to tools/lint/test/fixtures/test/license_invalid_year.js diff --git a/tools/lint/test/fixtures/license_invalid_year_range.js b/tools/lint/test/fixtures/test/license_invalid_year_range.js similarity index 100% rename from tools/lint/test/fixtures/license_invalid_year_range.js rename to tools/lint/test/fixtures/test/license_invalid_year_range.js diff --git a/tools/lint/test/fixtures/license_missing.js b/tools/lint/test/fixtures/test/license_missing.js similarity index 100% rename from tools/lint/test/fixtures/license_missing.js rename to tools/lint/test/fixtures/test/license_missing.js diff --git a/tools/lint/test/fixtures/negative_invalid_phase.js b/tools/lint/test/fixtures/test/negative_invalid_phase.js similarity index 100% rename from tools/lint/test/fixtures/negative_invalid_phase.js rename to tools/lint/test/fixtures/test/negative_invalid_phase.js diff --git a/tools/lint/test/fixtures/negative_missing_phase.js b/tools/lint/test/fixtures/test/negative_missing_phase.js similarity index 100% rename from tools/lint/test/fixtures/negative_missing_phase.js rename to tools/lint/test/fixtures/test/negative_missing_phase.js diff --git a/tools/lint/test/fixtures/negative_missing_type.js b/tools/lint/test/fixtures/test/negative_missing_type.js similarity index 100% rename from tools/lint/test/fixtures/negative_missing_type.js rename to tools/lint/test/fixtures/test/negative_missing_type.js diff --git a/tools/lint/test/fixtures/negative_no_raw_stmt.js b/tools/lint/test/fixtures/test/negative_no_raw_stmt.js similarity index 100% rename from tools/lint/test/fixtures/negative_no_raw_stmt.js rename to tools/lint/test/fixtures/test/negative_no_raw_stmt.js diff --git a/tools/lint/test/fixtures/negative_no_raw_wrong_stmt.js b/tools/lint/test/fixtures/test/negative_no_raw_wrong_stmt.js similarity index 100% rename from tools/lint/test/fixtures/negative_no_raw_wrong_stmt.js rename to tools/lint/test/fixtures/test/negative_no_raw_wrong_stmt.js diff --git a/tools/lint/test/fixtures/negative_parse_throw_bad_value.js b/tools/lint/test/fixtures/test/negative_parse_throw_bad_value.js similarity index 100% rename from tools/lint/test/fixtures/negative_parse_throw_bad_value.js rename to tools/lint/test/fixtures/test/negative_parse_throw_bad_value.js diff --git a/tools/lint/test/fixtures/negative_parse_throw_missing.js b/tools/lint/test/fixtures/test/negative_parse_throw_missing.js similarity index 100% rename from tools/lint/test/fixtures/negative_parse_throw_missing.js rename to tools/lint/test/fixtures/test/negative_parse_throw_missing.js diff --git a/tools/lint/test/fixtures/negative_raw_call.js b/tools/lint/test/fixtures/test/negative_raw_call.js similarity index 100% rename from tools/lint/test/fixtures/negative_raw_call.js rename to tools/lint/test/fixtures/test/negative_raw_call.js diff --git a/tools/lint/test/fixtures/negative_raw_wrong_call.js b/tools/lint/test/fixtures/test/negative_raw_wrong_call.js similarity index 100% rename from tools/lint/test/fixtures/negative_raw_wrong_call.js rename to tools/lint/test/fixtures/test/negative_raw_wrong_call.js diff --git a/tools/lint/test/fixtures/negative_resolution_throw_bad_value.js b/tools/lint/test/fixtures/test/negative_resolution_throw_bad_value.js similarity index 100% rename from tools/lint/test/fixtures/negative_resolution_throw_bad_value.js rename to tools/lint/test/fixtures/test/negative_resolution_throw_bad_value.js diff --git a/tools/lint/test/fixtures/negative_resolution_throw_missing.js b/tools/lint/test/fixtures/test/negative_resolution_throw_missing.js similarity index 100% rename from tools/lint/test/fixtures/negative_resolution_throw_missing.js rename to tools/lint/test/fixtures/test/negative_resolution_throw_missing.js diff --git a/tools/lint/test/fixtures/negative_string.js b/tools/lint/test/fixtures/test/negative_string.js similarity index 100% rename from tools/lint/test/fixtures/negative_string.js rename to tools/lint/test/fixtures/test/negative_string.js diff --git a/tools/lint/test/fixtures/negative_valid_parse.js b/tools/lint/test/fixtures/test/negative_valid_parse.js similarity index 100% rename from tools/lint/test/fixtures/negative_valid_parse.js rename to tools/lint/test/fixtures/test/negative_valid_parse.js diff --git a/tools/lint/test/fixtures/negative_valid_resolution.js b/tools/lint/test/fixtures/test/negative_valid_resolution.js similarity index 100% rename from tools/lint/test/fixtures/negative_valid_resolution.js rename to tools/lint/test/fixtures/test/negative_valid_resolution.js diff --git a/tools/lint/test/fixtures/negative_valid_runtime.js b/tools/lint/test/fixtures/test/negative_valid_runtime.js similarity index 100% rename from tools/lint/test/fixtures/negative_valid_runtime.js rename to tools/lint/test/fixtures/test/negative_valid_runtime.js diff --git a/tools/lint/test/fixtures/valid_es5id.js b/tools/lint/test/fixtures/test/valid_es5id.js similarity index 100% rename from tools/lint/test/fixtures/valid_es5id.js rename to tools/lint/test/fixtures/test/valid_es5id.js diff --git a/tools/lint/test/fixtures/valid_es6id.js b/tools/lint/test/fixtures/test/valid_es6id.js similarity index 100% rename from tools/lint/test/fixtures/valid_es6id.js rename to tools/lint/test/fixtures/test/valid_es6id.js diff --git a/tools/lint/test/fixtures/valid_esid.js b/tools/lint/test/fixtures/test/valid_esid.js similarity index 100% rename from tools/lint/test/fixtures/valid_esid.js rename to tools/lint/test/fixtures/test/valid_esid.js diff --git a/tools/lint/test/fixtures/valid_esid_alternate.js b/tools/lint/test/fixtures/test/valid_esid_alternate.js similarity index 100% rename from tools/lint/test/fixtures/valid_esid_alternate.js rename to tools/lint/test/fixtures/test/valid_esid_alternate.js diff --git a/tools/lint/test/run.py b/tools/lint/test/run.py index 6b12d91547..c59bf4d94c 100755 --- a/tools/lint/test/run.py +++ b/tools/lint/test/run.py @@ -92,11 +92,10 @@ def create_file_test(name, fspath): test.__name__ = 'test_' + file_name.split('.')[0] return test -dirname = os.path.join(os.path.abspath(testDir), 'fixtures') +dirname = os.path.join(os.path.abspath(testDir), 'fixtures', 'test') for file_name in os.listdir(dirname): full_path = os.path.join(dirname, file_name) - if (not os.path.isfile(full_path) or file_name.startswith('.') or - not file_name.endswith('.js')): + if (not os.path.isfile(full_path) or file_name.startswith('.')): continue t = create_file_test(file_name, full_path)