lat/tests
Hanlu Li 7b638be386 build: remove Meson deprecation warnings
Generate both pkgconfig machine-file keys for compatibility, replace deprecated root-directory APIs, use boolean option values, and drop the no-op gui_app argument.

Validated on LoongArch with build64.sh -c, build32.sh -c, and build-release.sh; all completed without compiler or Meson warning matches.

Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
2026-08-07 11:56:21 +08:00
..
integration LATX, fix: track IPC namespace joined with setns 2026-08-03 10:40:30 +08:00
latx LATX: guide users when guest runtimes fail to load 2026-08-05 07:33:25 +08:00
runtime LATX: guide users when guest runtimes fail to load 2026-08-05 07:33:25 +08:00
unit linux-user: allow ELF loader errors to be returned 2026-08-05 07:33:25 +08:00
README.md tests: order syscall headers before LATX tests 2026-07-31 15:09:21 +08:00
meson.build build: remove Meson deprecation warnings 2026-08-07 11:56:21 +08:00

README.md

LAT Meson tests

LAT tests are registered with Meson and are configured only when --enable-tests is passed to configure.

Choose a test suite

  • lat-pr-fast: deterministic, self-contained regression tests that need no network access, elevated privileges, namespaces, or other special host setup. These tests must be fast enough to run on every pull request.
  • latx-integration: tests that depend on kernel features, namespaces, external programs, special host setup, or substantially longer execution time. These tests are not part of the fast pull-request gate.

Do not add a test-specific GitHub Actions step or target. Register the test in the appropriate suite; the workflow selects the suite automatically.

Register a test

Put ordinary unit tests in tests/unit/meson.build and environment-dependent tests in tests/integration/meson.build. A test that must use target-specific build objects may be registered in the top-level meson.build, guarded by get_option('tests').enabled().

For example:

test_program = executable(
  'test-example',
  files('test-example.c'),
  dependencies: glib,
)

test(
  'example',
  test_program,
  suite: 'lat-pr-fast',
  timeout: 30,
)

Use suite: 'latx-integration' instead when the test needs special host facilities.

If the test includes QEMU headers that refer to generated QAPI headers, add genh to the executable sources so Meson records the generator dependency:

test_program = executable(
  'test-example',
  files('test-example.c') + genh,
)

If those headers also include TCG trace helpers, add tcg_trace_genh as well. Tests that include generated Linux-user syscall headers must also add the target's syscall_nr_generated sources.

Run the suites

Configure the build with --enable-tests, then run:

python3 -B meson/meson.py test \
  -C build64-tests \
  --suite lat-pr-fast \
  --print-errorlogs

To run the integration suite, replace lat-pr-fast with latx-integration.

Before submitting a new test target, verify both of these:

  1. A normal product build without --enable-tests does not build the test.
  2. A build configured with --enable-tests builds and runs the selected suite.