# phpefc test driver

Meson/Shell test driver for PHP inputs stored under `../tests`.

`../tests` should contain PHP test cases only. Do not put runtime-library C tests there.

Current E2E check:

1. `php2ast -> ast2php` round-trips `tests/hallowelt.php`, ignoring only final file-end line breaks.
2. `php2ast -> phpir -> valair -> vala -> valac -> binary` builds and runs.
3. The generated binary prints `Hallo Welt1a!`.

## Debug source-line regression

The throw/segfault regression also checks the debug source-line path. `phpefc-valair2vala` emits a Vala source file with an embedded `PHPEFC-C-SOURCE-LINES` JSON comment. Downstream test suites can feed Valac-generated C plus that Vala file into `phpefc-c-add-source-lines` to rewrite C `#line` markers to original PHP source locations.

Do not assert that PHP and Vala line numbers are equal. Tests should assert that explicit mapping metadata exists and points from actual generated Vala lines to original PHP file/line locations.
