I Built C++ Test Impact Analysis With Zero Runtime Dependencies
Описание и применение
diff2test — это CLI‑утилита, которая, используя только метаданные, созданные CMake, CTest и компилятором, определяет, какие тесты CTest необходимо запустить после изменения файлов, уменьшая время CI без добавления зависимостей.
Задача
Running the full C++ test suite after every change is expensive; need to run only affected tests without adding runtime dependencies.
Результат
diff2test reduces test execution time by selecting only impacted tests while remaining zero‑dependency at runtime.
Рабочий процесс
- Collect changed file paths via git diff or stdin
- Provide a list of compiler .d files via --dep-list
- Read CMake File API JSON for targets and sources
- Read CTest JSON for test definitions
- Build reverse dependency graph from targets to tests
- Propagate impact from changed files to affected tests
- Validate evidence; if missing, exit with FULL_SUITE_SELECTED or FULL_SUITE_REQUIRED
- Output selected test names or exit code 0 for subset
Доказательства
If something important is missing or suspicious, the optimization disappears.
The program would not produce its own evidence. It would consume evidence.
The successful narrow case is: SUBSET_SELECTED exit 0
- Дата записи: 2026-09-05T17:45:22.753Z