Skip to content

Comments

cli: add compiler command and update e2e tests#16

Merged
strimo378 merged 1 commit intomainfrom
codex/find-cli-utility-in-repo
Jan 10, 2026
Merged

cli: add compiler command and update e2e tests#16
strimo378 merged 1 commit intomainfrom
codex/find-cli-utility-in-repo

Conversation

@strimo378
Copy link
Contributor

Motivation

  • Provide a command-line entrypoint to compile ONNX models to C so the compiler can be used as a CLI tool.
  • Make end-to-end tests exercise the public CLI instead of calling compiler internals to better verify real usage.
  • Allow emitting a JSON testbench from the generated C to validate correctness in integration tests.

Description

  • Add src/onnx2c/cli.py implementing onnx2c compile with options --template-dir, --model-name, and --emit-testbench and a main() function that returns an exit code.
  • Add src/onnx2c/__main__.py to enable python -m onnx2c invocation.
  • Update end-to-end tests in tests/test_endtoend_ops.py and tests/test_endtoend_features.py to invoke the CLI via python -m onnx2c compile ..., set PYTHONPATH so the local src is loadable, and consume the generated C/testbench outputs.
  • Document CLI usage and testbench invocation in README.md with example python -m onnx2c compile path/to/model.onnx build/model.c commands.

Testing

  • Ran pytest -q tests/test_endtoend_ops.py tests/test_endtoend_features.py which completed successfully.
  • The test run reported 6 passed (all modified end-to-end tests passed).
  • The tests compile the generated C with the system C compiler and execute the emitted JSON testbench to validate outputs.
  • No additional automated test failures were observed during the rollout.

Codex Task

@strimo378 strimo378 merged commit c182938 into main Jan 10, 2026
0 of 2 checks passed
@strimo378 strimo378 deleted the codex/find-cli-utility-in-repo branch January 10, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant