| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d9adcee commit 8d8c305
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | + /* eslint-disable node-core/required-modules */ | ||
| 1 | 2 | 'use strict'; | |
| 2 | 3 | ||
| 3 | 4 | const assert = require('assert'); | |
| 4 | - const common = require('../common'); | ||
| 5 | 5 | const fixtures = require('../common/fixtures'); | |
| 6 | 6 | const fs = require('fs'); | |
| 7 | 7 | const fsPromises = fs.promises; | |
@@ -160,12 +160,49 @@ class WPTTest { | |||
| 160 | 160 | getContent() { | |
| 161 | 161 | return fs.readFileSync(this.getAbsolutePath(), 'utf8'); | |
| 162 | 162 | } | |
| 163 | + } | ||
| 164 | + | ||
| 165 | + const kIntlRequirement = { | ||
| 166 | + none: 0, | ||
| 167 | + small: 1, | ||
| 168 | + full: 2, | ||
| 169 | + // TODO(joyeecheung): we may need to deal with --with-intl=system-icu | ||
| 170 | + }; | ||
| 171 | + | ||
| 172 | + class IntlRequirement { | ||
| 173 | + constructor() { | ||
| 174 | + this.currentIntl = kIntlRequirement.none; | ||
| 175 | + if (process.config.variables.v8_enable_i18n_support === 0) { | ||
| 176 | + this.currentIntl = kIntlRequirement.none; | ||
| 177 | + return; | ||
| 178 | + } | ||
| 179 | + // i18n enabled | ||
| 180 | + if (process.config.variables.icu_small) { | ||
| 181 | + this.currentIntl = kIntlRequirement.small; | ||
| 182 | + } else { | ||
| 183 | + this.currentIntl = kIntlRequirement.full; | ||
| 184 | + } | ||
| 185 | + } | ||
| 163 | 186 | ||
| 164 | - requireIntl() { | ||
| 165 | - return this.requires.has('intl'); | ||
| 187 | + /** | ||
| 188 | + * @param {Set} requires | ||
| 189 | + * @returns {string|false} The config that the build is lacking, or false | ||
| 190 | + */ | ||
| 191 | + isLacking(requires) { | ||
| 192 | + const current = this.currentIntl; | ||
| 193 | + if (requires.has('full-icu') && current !== kIntlRequirement.full) { | ||
| 194 | + return 'full-icu'; | ||
| 195 | + } | ||
| 196 | + if (requires.has('small-icu') && current < kIntlRequirement.small) { | ||
| 197 | + return 'small-icu'; | ||
| 198 | + } | ||
| 199 | + return false; | ||
| 166 | 200 | } | |
| 167 | 201 | } | |
| 168 | 202 | ||
| 203 | + const intlRequirements = new IntlRequirement(); | ||
| 204 | + | ||
| 205 | + | ||
| 169 | 206 | class StatusLoader { | |
| 170 | 207 | constructor(path) { | |
| 171 | 208 | this.path = path; | |
@@ -498,8 +535,9 @@ class WPTRunner { | |||
| 498 | 535 | continue; | |
| 499 | 536 | } | |
| 500 | 537 | ||
| 501 | - if (!common.hasIntl && test.requireIntl()) { | ||
| 502 | - this.skip(filename, [ 'missing Intl' ]); | ||
| 538 | + const lackingIntl = intlRequirements.isLacking(test.requires); | ||
| 539 | + if (lackingIntl) { | ||
| 540 | + this.skip(filename, [ `requires ${lackingIntl}` ]); | ||
| 503 | 541 | continue; | |
| 504 | 542 | } | |
| 505 | 543 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,7 +151,7 @@ expected failures. | |||
| 151 | 151 | { | |
| 152 | 152 | "something.scope.js": { // the file name | |
| 153 | 153 | // Optional: If the requirement is not met, this test will be skipped | |
| 154 | - "requires": ["intl"], // currently only intl is supported | ||
| 154 | + "requires": ["small-icu"], // supports: "small-icu", "full-icu" | ||
| 155 | 155 | ||
| 156 | 156 | // Optional: the test will be skipped with the reason printed | |
| 157 | 157 | "skip": "explain why we cannot run a test that's supposed to pass", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,10 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "toascii.window.js": { | |
| 3 | - "requires": ["intl"], | ||
| 3 | + "requires": ["small-icu"], | ||
| 4 | 4 | "skip": "TODO: port from .window.js" | |
| 5 | 5 | }, | |
| 6 | 6 | "historical.any.js": { | |
| 7 | - "requires": ["intl"] | ||
| 7 | + "requires": ["small-icu"] | ||
| 8 | 8 | }, | |
| 9 | 9 | "urlencoded-parser.any.js": { | |
| 10 | 10 | "fail": "missing Request and Response" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments