Merge branch 'master' into fix/issue-549
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m40s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m19s
Project CI / Backend tests (pull_request) Successful in 4m40s
Project CI / Native shell tests (pull_request) Successful in 5m42s
Project CI / Frontend tests (pull_request) Successful in 2m25s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 11m30s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 10m8s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m2s
Project CI / Repository checks (pull_request) Successful in 2m47s

This commit is contained in:
2026-10-01 19:44:25 +08:00
4 changed files with 22 additions and 1 deletions
@@ -156,7 +156,8 @@ function resolveTestExecutable() {
kind: options.targetKind,
name: options.binName,
});
cargoArguments.push('--no-run', '--message-format=json');
// 保留 stdout 的 artifact JSON,并由 Cargo 将编译诊断输出到继承的 stderr。
cargoArguments.push('--no-run', '--message-format=json-render-diagnostics');
console.log(`[rust-shards] cargo ${cargoArguments.join(' ')}`);
const child = spawn('cargo', cargoArguments, {
@@ -62,6 +62,18 @@ fn failing_case() {
assert.match(result.output, /1 passed; 1 failed/);
});
test('compile failure retains the diagnostic code, source location and cause', (t) => {
const result = runFixture(
t,
'#[test]\nfn compile_failure() { let _: u32 = "not a number"; }\n',
);
assert.equal(result.status, 1, result.output);
assert.match(result.output, /error\[E0308\]/);
assert.match(result.output, /src[\\/]lib\.rs:2:/);
assert.match(result.output, /mismatched types/);
assert.match(result.output, /expected `u32`, found `&str`/);
});
test('successful shard keeps its compact summary', (t) => {
const result = runFixture(t, '#[test]\nfn passing_case() {}\n');
assert.equal(result.status, 0, result.output);