Skip to content

vfp-expected.mjs: goldens inherit the measuring machine's saved settings - launch VFP with -A and re-measure #34

Closed

Description

@hemstreet

I ran the golden corpus against a clean Visual FoxPro 9 install (09.00.0000.7423) and noticed that scripts/vfp-expected.mjs starts vfp9.exe without the -A switch, so the run inherits whatever SET defaults the measuring machine has saved in the registry (Tools > Options > "Set as Default"). Several checked-in goldens only reproduce with non-default settings:

  • ref_buffering.expected line 2 (.T. 5) needs SET MULTILOCKS ON. With the factory default (OFF), CURSORSETPROP("Buffering", 5) raises error 1589 at that line (measured with your own wrapper: ERROR 1589 line 6 in MAIN). With MULTILOCKS ON it prints .T. 5, matching the golden.
  • ref_backward.expected shows 3.000000000000 — twelve decimals — which needs SET DECIMALS TO 12. Measured both ways on 7423: SET DECIMALS TO 12 → 3.000000000000, the factory default (2) → 3.00.
  • ref_sql_having.expected and ref_tablestate.expected also flip between a configured machine and a -A launch.
  • My first sweep, before I spotted this, "failed" dozens of goldens purely because MY machine's saved settings leaked in the same way — the capture is honest about the product, but not portable across machines.

Suggested fix, two parts:

  1. One-line change in askVfp:
    const child = execFile(VFP, ['-A', join(dir, 'probe.prg')], { cwd: run }, () => done());
    -A tells VFP to ignore the registry settings and any config.fpw, so every machine measures from the same factory state.
  2. Where a golden depends on a non-default setting, say so in the program (SET MULTILOCKS ON as its first line), so the golden carries its own stage.

I'll send the harness change as a small PR. The golden re-measure I'd leave to you, since the project's .expected files should come from the build you target.

Happy to re-run the full corpus on my install and report what changes, if useful.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions