Commit Graph

2 Commits

Author SHA1 Message Date
Bob Nystrom
3901ab57e7 feat: add C API test infrastructure with foreign method binding support
Add a new test framework for exercising the Wren C embedding API directly from C code, including a Makefile target, test runner modifications, and the first API test case for boolean return values. The build system now compiles test sources from `test/api/` into a separate test executable, and the CLI's `createVM` and `runFile` functions accept an optional `WrenBindForeignMethodFn` callback to enable foreign method binding in tests. The test runner (`script/test.py`) is refactored to support both script and API test types, passing the test name instead of the full path for API tests. The initial `return_bool` test verifies that `wrenReturnBool` correctly returns `true` and `false` from foreign methods.
2015-05-24 16:23:30 +00:00
Bob Nystrom
76baf731db refactor: extract CLI VM creation and file execution into separate vm.c/vm.h
Move runFile() and VM configuration logic from main.c into new vm.c module,
exposing createVM() and runFile() functions. This decouples CLI script
execution from the REPL and main entry point, enabling reuse of the same
VM setup and file-running code for API tests.
2015-03-16 14:42:45 +00:00