Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

17
test/test426/README.md Normal file
View File

@ -0,0 +1,17 @@
# test426 (Source Map Tests)
The tests here are drivers for running the [Source Map Tests][]. This test
suite ensures that the Node.js source map implementation conforms to the
[Source Map Specification][] ([ECMA426][]).
The [`test/fixtures/test426`](../fixtures/test426/) contains a copy of the set of
[Source Map Tests][] suite. The last updated hash is:
* <https://github.com/tc39/source-map-tests/commit/cbed127c46330ff4b52525e73b9356e2ad3d6369>
See the json files in [the `status` folder](./status) for prerequisites,
expected failures, and support status for specific tests.
[ECMA426]: https://tc39.es/ecma426/
[Source Map Specification]: https://github.com/tc39/ecma426
[Source Map Tests]: https://github.com/tc39/source-map-tests

View File

@ -0,0 +1,14 @@
{
"sourceRootResolution": {
"testActions": {
"skip": "sourceRoot is not supported"
}
},
"mappingSemanticsSingleFieldSegment": {
"testActions": {
"1": {
"skip": "Might be incorrect test"
}
}
}
}

View File

@ -0,0 +1,58 @@
import '../common/index.mjs';
import * as fixtures from '../common/fixtures.mjs';
import assert from 'node:assert';
import test from 'node:test';
import { SourceMap } from 'node:module';
import { readFileSync } from 'node:fs';
const specJson = fixtures.readSync('test426/source-map-spec-tests.json', 'utf8');
const spec = JSON.parse(specJson);
const kStatus = JSON.parse(readFileSync(new URL('./status/source-map-spec-tests.json', import.meta.url), 'utf8'));
const kActionRunner = {
checkMapping,
};
spec.tests.forEach((testSpec) => {
const sourceMapJson = fixtures.readSync(['test426/resources', testSpec.sourceMapFile], 'utf8');
const sourceMapPayload = JSON.parse(sourceMapJson);
test(testSpec.name, async (t) => {
let sourceMap;
try {
sourceMap = new SourceMap(sourceMapPayload);
} catch {
// Be lenient with invalid source maps. Some source maps are invalid spec-wise,
// let's try the best to parse them. Maybe a strict parsing mode can be introduced
// for future-proof source map format.
assert.ok(!testSpec.sourceMapIsValid);
return;
}
assert.ok(sourceMap);
const subtests = (testSpec.testActions ?? []).map((action, idx) => {
const testRunner = kActionRunner[action.actionType];
const testName = `action#${idx} - ${action.actionType}`;
if (testRunner == null) {
return t.test(testName, {
todo: true,
});
}
const skip = kStatus[testSpec.name]?.testActions?.skip || kStatus[testSpec.name]?.testActions?.[idx]?.skip;
return t.test(testName, {
skip,
}, testRunner.bind(null, sourceMap, action));
});
await Promise.all(subtests);
});
});
function checkMapping(sourceMap, action) {
const result = sourceMap.findEntry(action.generatedLine, action.generatedColumn);
assert.strictEqual(result.originalSource, action.originalSource);
assert.strictEqual(result.originalLine, action.originalLine);
assert.strictEqual(result.originalColumn, action.originalColumn);
}

6
test/test426/testcfg.py Normal file
View File

@ -0,0 +1,6 @@
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import testpy
def GetConfiguration(context, root):
return testpy.ParallelTestConfiguration(context, root, 'test426')