This document provides a single source of truth for validating changes. The removed README_TESTING.md, TESTING_GUIDE.md, QUICK_TEST*.md, and TEST_SUITE_AUDIT_REPORT.md have been condensed here.
# Install dependencies
cd cmd/llvm-obfuscator
pip install -r requirements.txt
# Run unit tests
pytest
# Run CLI smoke test
python -m cmd.llvm_obfuscator.cli.obfuscate compile tests/test_simple.c \
--output build/test \
--level 2 --string-encryption --report-formats jsonRecommended pylint/mypy invocations are defined in pyproject.toml; run them before posting a PR when you touch Python files.
cd mlir-obs
./build.sh # configure + build libMLIRObfuscation
./test.sh # exercises string/symbol passes on sample MLIRFor Polygeist/ClangIR experiments, follow docs/PIPELINES.md and capture results in the PR summary (the old SETUP_POLYGEIST.md has been retired).
Use the CLI to compile the demo programs in cmd/llvm-obfuscator/tests/ and inspect the reports/ output to ensure metrics remain consistent.
python -m cmd.llvm_obfuscator.cli.obfuscate compile tests/test_obfuscator.c \
--output build/obf_demo --level 3 \
--enable-symbol-obfuscation --string-encryption --report-formats json,md- Build two binaries (baseline vs obfuscated).
- Run
bash phoronix/scripts/run_obfuscation_test_suite.sh baseline obf results/to generate the full security analysis. - Optional: run
bash phoronix/scripts/run_pts_tests.sh --automaticto capture performance deltas.
Attach the resulting Markdown summary when validating large pass changes.
core/jotai_benchmark.py orchestrates the public Jotai suite. The benchmark repo is cached under ~/.cache/llvm-obfuscator/jotai-benchmarks.
python -m cmd.llvm_obfuscator.cli.obfuscate benchmark jotai \
--output build/jotai_ci --level 2 --string-encryption --skip-compilation-errorsThe command reports pass/fail counts plus functional mismatches. Use this when modifying control-flow transforms.
When touching scripts in binary_obfuscation_pipeline/:
- Use
binary_obfuscation_pipeline/windows_build/compile_windows_binary.pyto build a simple PE binary. - Run the headless Ghidra lifter service (Docker compose) and export a CFG.
- Execute
mcsema_impl/lifter/run_lift.shand.../convert_ir_version.shto regenerate LLVM 22 bitcode. - Invoke
mcsema_impl/ollvm_stage/run_ollvm.shwith the minimalpasses_config.jsonto ensure the obfuscated bitcode is emitted.
Document any constraints in the PR so downstream users know how to reproduce the environment.
pytestgreen.mlir-obs/test.shgreen.- CLI smoke test for Linux/macOS.
- At least one Phoronix security analysis (
run_obfuscation_test_suite.sh). - Optional performance validation via Phoronix Test Suite (for pass-heavy releases).
- Updated documentation if new flags/passes were added.
Keep this list in sync when adding new tooling or automation.