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.
This commit is contained in:
Bob Nystrom
2015-05-24 16:23:30 +00:00
parent 6d2bafc211
commit 3901ab57e7
10 changed files with 152 additions and 21 deletions
+1
View File
@@ -34,6 +34,7 @@ clean:
# Run the tests against the debug build of Wren.
test: debug
@ $(MAKE) -f script/wren.mk MODE=debug test
@ ./script/test.py $(suite)
# Take the contents of the scripts under builtin/ and copy them into their