fold/tests/integration/meson.build
trvon 76bc00f635
test(fanout): build the failure worker before the recovery tests
fold:subprocess_fanout reads FOLD_TEST_FANOUT_FAILURE_WORKER, but the
worker target is build_by_default: false and the test declared
`depends: []`, so a plain `meson test -C build/release` ran the two
recovery cases against a binary that was never built and failed both
(`REQUIRE(std::filesystem::exists(helper))`). The test now depends on
the worker, and the suite is green from a fresh build.
2026-09-24 20:00:17 -06:00

277 lines
8 KiB
Meson

test_scan_e2e = executable(
'test_scan_e2e',
'test_scan_e2e.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
test('scan_e2e', test_scan_e2e,
env: { 'FOLD_FIXTURES_DIR': join_paths(meson.current_source_dir(), '..', 'fixtures') },
workdir: meson.current_source_dir(),
)
test_mcp_stdio = executable(
'test_mcp_stdio',
'test_mcp_stdio.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
test('mcp_stdio', test_mcp_stdio,
env: { 'FOLD_FIXTURES_DIR': join_paths(meson.current_source_dir(), '..', 'fixtures') },
# The default MCP policy restricts filesystem access to cwd. Run from the
# project root so fixture and temporary test paths are explicitly in scope.
workdir: meson.project_source_root(),
)
fanout_failure_worker = executable(
'fanout_failure_worker',
'fanout_failure_worker.cpp',
dependencies: [fold_core_dep],
install: false,
build_by_default: false,
)
test_subprocess_fanout = executable(
'test_subprocess_fanout',
'test_subprocess_fanout.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
# fold target lives one subdir down; the test depends on it so meson builds
# it first, then we point FOLD_WORKER_BINARY at the produced binary so the
# fan-out can spawn it.
fold_bin = meson.project_build_root() / 'src' / 'cli' / 'fold'
test('subprocess_fanout', test_subprocess_fanout,
# fold lives in src/cli and is referenced via path. The failure worker is
# build_by_default: false, so without this dependency `meson test` ran the
# recovery cases against a helper that was never built and failed them.
depends: [fanout_failure_worker],
env: {
'FOLD_FIXTURES_DIR': join_paths(meson.current_source_dir(), '..', 'fixtures'),
'FOLD_WORKER_BINARY': fold_bin,
'FOLD_TEST_FANOUT_FAILURE_WORKER': fanout_failure_worker.full_path(),
},
workdir: meson.current_source_dir(),
)
test_cross_tu_security = executable(
'test_cross_tu_security',
'test_cross_tu_security.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('cross_tu_security', test_cross_tu_security)
test_incremental_project_graph = executable(
'test_incremental_project_graph',
'test_incremental_project_graph.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('incremental_project_graph', test_incremental_project_graph)
# SAST security-detector end-to-end over the committed source fixtures.
test_sast_security_e2e = executable(
'test_sast_security_e2e',
'test_sast_security_e2e.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('sast_security_e2e', test_sast_security_e2e,
env: { 'FOLD_SECURITY_FIXTURES': join_paths(meson.current_source_dir(), '..', 'fixtures', 'security') },
workdir: meson.current_source_dir(),
timeout: 120,
)
# ROP gadget discovery on real ELF fixtures — only meaningful with the Capstone
# overlapping sweep, so gate on the capstone backend (else the r2 /R fallback
# misses the clean pops this test asserts).
if capstone_dep.found()
test_binary_rop = executable(
'test_binary_rop',
'test_binary_rop.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
test('binary_rop', test_binary_rop,
env: { 'FOLD_BINARY_FIXTURES': join_paths(meson.current_source_dir(), '..', 'fixtures', 'binary') },
workdir: meson.current_source_dir(),
timeout: 120,
)
endif
test_confirm_cli = executable(
'test_confirm_cli',
'test_confirm_cli.cpp',
dependencies: [catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('confirm_cli', test_confirm_cli,
env: {
'FOLD_BINARY': fold_bin,
},
workdir: meson.current_source_dir(),
)
test_cli_paths = executable(
'test_cli_paths',
'test_cli_paths.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('cli_paths', test_cli_paths,
env: {
'FOLD_BINARY': fold_bin,
'FOLD_SKILL_SOURCE': meson.project_source_root() / 'skills' / 'fold-sast' / 'SKILL.md',
},
workdir: meson.current_source_dir(),
)
test(
'embedded_skill_mirror',
find_program('python3'),
args: [
meson.project_source_root() / 'scripts' / 'generate_embedded_skill.py',
'--input', meson.project_source_root() / 'skills' / 'fold-sast' / 'SKILL.md',
'--output', meson.project_source_root() / 'include' / 'fold' / 'cli' / 'embedded_skill.hpp',
'--check',
],
)
test_binary_backend = executable(
'test_binary_backend',
'test_binary_backend.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('binary_backend', test_binary_backend,
env: {
'FOLD_BINARY': fold_bin,
},
workdir: meson.current_source_dir(),
timeout: 120,
)
test_rust_frontend = executable(
'test_rust_frontend',
'test_rust_frontend.cpp',
dependencies: [catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('rust_frontend', test_rust_frontend,
env: {
'FOLD_BINARY': fold_bin,
'FOLD_FIXTURES_DIR': join_paths(meson.current_source_dir(), '..', 'fixtures'),
'FOLD_RUST_BIN': join_paths(meson.project_source_root(), 'tools', 'fold-rust', 'target', 'release', 'fold-rust'),
},
workdir: meson.current_source_dir(),
timeout: 120,
)
if get_option('rust-frontend')
test(
'rust_toolchain_skew',
find_program('python3'),
args: [
meson.project_source_root() / 'scripts' / 'check_rust_toolchain_skew.py',
'--fold-rust', meson.project_source_root() / 'tools' / 'fold-rust' / 'target' / 'release' / 'fold-rust',
'--output', meson.project_build_root() / 'meson-logs' / 'rust-toolchain-skew.json',
],
timeout: 180,
)
endif
if get_option('swift-frontend')
test_swift_frontend = executable(
'test_swift_frontend',
'test_swift_frontend.cpp',
dependencies: [catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('swift_frontend', test_swift_frontend,
env: {
'FOLD_BINARY': fold_bin,
'FOLD_SWIFT_BIN': join_paths(meson.project_build_root(), 'tools', 'fold-swift', 'fold-swift'),
},
workdir: meson.current_source_dir(),
timeout: 120,
)
endif
if get_option('build-lsp-server')
test_lsp_framed = executable(
'test_lsp_framed',
'test_lsp_framed.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
test('lsp_framed', test_lsp_framed,
env: { 'FOLD_FIXTURES_DIR': join_paths(meson.current_source_dir(), '..', 'fixtures') },
workdir: meson.current_source_dir(),
)
test_lsp_code_action = executable(
'test_lsp_code_action',
'test_lsp_code_action.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
test('lsp_code_action', test_lsp_code_action,
env: { 'FOLD_FIXTURES_DIR': join_paths(meson.current_source_dir(), '..', 'fixtures') },
workdir: meson.current_source_dir(),
)
endif
test_phi_merge = executable(
'test_phi_merge',
'test_phi_merge.cpp',
dependencies: [fold_core_dep, catch2_dep],
install: false,
build_by_default: false,
)
test('phi_merge', test_phi_merge)
test_yams_integration = executable(
'test_yams_integration',
'test_yams_integration.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('yams_integration', test_yams_integration)
test_fuzz_prep = executable(
'test_fuzz_prep',
'test_fuzz_prep.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('fuzz_prep', test_fuzz_prep,
env: {
'FOLD_RUST_BIN': join_paths(meson.project_source_root(), 'tools', 'fold-rust', 'target', 'release', 'fold-rust'),
},
timeout: 60,
)
test_fuzz_run = executable(
'test_fuzz_run',
'test_fuzz_run.cpp',
dependencies: [fold_core_dep, catch2_dep, json_dep],
install: false,
build_by_default: false,
)
test('fuzz_run', test_fuzz_run, timeout: 120)