Skip to content

DevEx: phpc build smoke in ExamplesCompileTest (unified CLI path) #282

@PurHur

Description

@PurHur

Problem

Contributors and docs steer users to ./phpc build, but test/unit/ExamplesCompileTest.php only shells out to bin/compile.php for AOT lint. Wrapper regressions in bin/phpc.php (argv forwarding, env, -o handling) are invisible to the examples CI gate.

test/aot/ExampleWebAotTest.php compiles via bin/compile.php as well — not via phpc build.

Goal

Add at least one examples test that runs ./phpc build -o <tmp> examples/002-StaticWeb/example.php and executes the binary (same assertion as #247 / ExampleWebAotTest::testStaticWebExampleFile).

Keep existing bin/compile.php -l paths for speed; this is an additional smoke, not a full replacement.

Scope

  • testPhpcBuildSmoke002StaticWeb() in ExamplesCompileTest or shared trait with ExampleWebAotTest
  • @group llvm — skip when toolchain missing
  • Assert stdout contains Hello World and exit 0
  • Runs in script/ci-local.sh LLVM stage

Acceptance criteria

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  vendor/bin/phpunit --group llvm --filter 'ExamplesCompileTest.*PhpcBuild'

Verification (local only)

Do not require GitHub Actions.

Dependencies

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions