Testing
Test Suite Overview
Section titled “Test Suite Overview”| Suite | Count | Framework | Coverage |
|---|---|---|---|
| Unit tests | 786 | GoogleTest | Parser, executor, dirwalker |
| Property tests | 124 | RapidCheck | Fuzzing, invariants |
| Compatibility tests | 52 | GoogleTest | Apache behavior matching |
| Confconv tests | 55 | GoogleTest | Config converter |
| Total | 1,036 |
Running Tests
Section titled “Running Tests”# All testsctest --test-dir build --output-on-failure -j$(nproc)
# Specific suitectest --test-dir build -R "unit_tests" --output-on-failurectest --test-dir build -R "property_tests" --output-on-failurectest --test-dir build -R "compat_tests" --output-on-failurectest --test-dir build -R "confconv_tests" --output-on-failureConsistency Check
Section titled “Consistency Check”Validates all 83 directive types are implemented across parser, printer, executor, dirwalker, free, and generator:
bash tests/check_consistency.shFuzzing
Section titled “Fuzzing”# Build parser fuzzer with libFuzzerclang -g -O1 -fsanitize=fuzzer,address -I include \ -DHTACCESS_UNIT_TEST \ tests/fuzz/fuzz_parser.cpp \ src/htaccess_parser.c src/htaccess_directive.c src/htaccess_expires.c \ -lstdc++ -lm -o fuzz_parser
# Run for 5 minutesmkdir -p fuzz_corpus && cp tests/fuzz/corpus/* fuzz_corpus/timeout 300 ./fuzz_parser fuzz_corpus/ -max_len=4096 -timeout=5End-to-End Tests
Section titled “End-to-End Tests”# Docker-based OLS directive testsdocker build -t ols-e2e -f tests/e2e/Dockerfile .docker run -d --name ols-e2e -p 8088:8088 ols-e2ebash tests/e2e/test_directives.sh
# Integration tests (WordPress, Laravel, Nextcloud, Drupal)docker compose -f integration-tests/docker-compose.yml up -d --buildbash integration-tests/apps/wordpress/verify.shCI Pipeline
Section titled “CI Pipeline”- PR gate (ci.yml): build, unit/property/compat tests, ASan/UBSan, Apache comparison, OLS E2E
- Manual release gates: runtime image builds, heavy apps-matrix, and DO VPS validation are explicit workflows only
- Release (release.yml): x86_64 platform builds, RPM packaging, and release asset uploads