Skip to content

Apply declared execution contracts when running standard-library examples #994

Closed

Description

@LunaStev

Problem

run_std_examples parses shared wave-test metadata but only uses its socket capability. It always runs the compiler with no declared stdin/environment fixture, accepts only exit 0, and never validates declared stdout/stderr. This can falsely pass broken examples or fail correct examples with a documented nonzero exit.

Starting points: run_std_examples, existing shared contracts. #354 added corpus-checker tests while keeping production behavior; it did not implement these runtime contracts.

Reproduction

At 540728c2eb6cc12f5c69c3fb3fdb96e07ba059a4, execute the real runner with ROOT redirected to a disposable example tree and a fake compiler process. A source containing:

// wave-test: expected-exit=7
fun main() -> i32 { return 7; }

and a compiler returning 7 for the run command is recorded as [RUN FAIL] ... exit status 7, not a pass. This was executed in an isolated Python harness on Linux; no real home or repository examples were modified. A second executed fixture declares stdout-file=expected.txt containing EXPECTED\n, while the fake compiler prints WRONG\n and exits 0. The runner records that as [RUN PASS] with no failures. Source inspection shows no standard_input, test_environment or validate_output call on this path.

Scope

Reuse the shared metadata helpers for supported std example runs: expected exit, stdin, environment and stdout/stderr fixtures. Validate unsupported mode/runner combinations explicitly instead of silently ignoring them. Include any borrowed fixtures in report-path input protection. Keep explicit compiler/std selection, deterministic discovery, timeout cleanup and capability-skip reporting.

Completion criteria

  • A declared expected exit is enforced, including a matching nonzero result.
  • A mismatching declared stdout/stderr fixture fails even when the program exits 0; fixture stdin/environment actually reach execution.
  • Malformed metadata/fixtures produce per-example failure evidence, not traceback or silent omission; report destinations cannot overwrite borrowed fixtures.
  • Focused fake-process unit tests run without LLVM on supported host platforms.

Activity

  1. added
    bug
    help wanted
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions