Last Updated: 2025-11-05 Status: Active
UnifyWeaver has a multi-tiered testing strategy:
Note: Some tests require additional tools:
docs/XML_PARSING_TOOLS_INSTALLATION.md)# Comprehensive test suite (recommended)
swipl examples/run_all_tests.pl
# With verbose output
VERBOSE=1 swipl examples/run_all_tests.pl
# Core compiler tests
swipl examples/tests/test_compilers.pl
# Data source tests
swipl examples/tests/test_data_sources.pl
# PowerShell tests
swipl examples/tests/test_powershell.pl
# Firewall tests
swipl examples/test_firewall_powershell.pl
Purpose: Fast, comprehensive validation of all major features
Location: examples/run_all_tests.pl (to be created)
What it tests:
Run time: < 30 seconds
Usage:
swipl examples/run_all_tests.pl
Files:
examples/test_pure_powershell.pl - Pure PowerShell mode testsexamples/test_firewall_powershell.pl - Firewall integration testsexamples/generate_test_scripts.pl - Generate actual PowerShell scriptsWhat they test:
Usage:
# Test pure PowerShell compilation
swipl examples/test_pure_powershell.pl
# Test firewall integration
swipl examples/test_firewall_powershell.pl
# Generate and manually test PowerShell scripts
swipl examples/generate_test_scripts.pl
pwsh test_output/csv_pure.ps1
pwsh test_output/json_pure.ps1
Files:
examples/data_sources_demo.pl - Comprehensive data source demostests/core/test_xml_source.pl - XML source tests (NEW)What they test:
Usage:
# Run all data source demos
swipl examples/data_sources_demo.pl
# Individual source tests
swipl examples/json_pipeline_demo.pl
swipl examples/http_pipeline_demo.pl
# XML source tests (requires xmllint/lxml/perl)
swipl -s tests/core/test_xml_source.pl -g run_tests -t halt
Files:
examples/integration_test.pl - Stream and recursive compiler testsWhat they test:
Usage:
swipl examples/integration_test.pl
Files:
examples/test_firewall_powershell.pl - Firewall policy testsWhat they test:
Usage:
swipl examples/test_firewall_powershell.pl
Files:
tests/core/test_perl_service.pl - Perl service generation tests (NEW)tests/core/test_xml_source.pl - XML source integration tests (NEW)What they test:
Usage:
# Perl service tests (always available)
swipl -s tests/core/test_perl_service.pl -g run_tests -t halt
# XML source tests (requires XML tools)
# See docs/XML_PARSING_TOOLS_INSTALLATION.md for setup
swipl -s tests/core/test_xml_source.pl -g run_tests -t halt
# Run specific XML engine test
swipl -s tests/core/test_xml_source.pl \
-g "run_tests([xml_source:xmllint_extraction_perl_splitter])" \
-t halt
Purpose: Test end-to-end workflows
File: examples/integration_test.pl
What it tests:
Usage:
KEEP_TEST_DATA=true swipl examples/integration_test.pl
Purpose: Educational, manual testing, and documentation
Files:
examples/load_demo.pl - Quick feature showcaseexamples/pipeline_demo.pl - Pipeline examplesexamples/constraints_demo.pl - Constraint examplesexamples/powershell_compilation_demo.pl - PowerShell examplesUsage:
# Interactive demo
swipl examples/load_demo.pl
# Run specific demo
swipl -g test_csv_source -t halt examples/data_sources_demo.pl
examples/
├── run_all_tests.pl # Comprehensive automated suite (TO CREATE)
├── integration_test.pl # Integration tests
├── test_firewall_powershell.pl # Firewall tests
├── test_pure_powershell.pl # Pure PowerShell tests
├── generate_test_scripts.pl # Script generation
├── data_sources_demo.pl # Data source demos
├── *_pipeline_demo.pl # Pipeline-specific demos
└── *_demo.pl # Feature demos
examples/
├── run_all_tests.pl # Main test runner
├── tests/ # Organized test suites
│ ├── test_compilers.pl # Compiler tests
│ ├── test_data_sources.pl # Data source tests
│ ├── test_powershell.pl # PowerShell tests
│ ├── test_firewall.pl # Firewall tests
│ └── test_templates.pl # Template tests
├── demos/ # Educational demos
│ ├── data_sources_demo.pl
│ ├── pipeline_demo.pl
│ └── constraints_demo.pl
└── integration/ # Integration tests
└── integration_test.pl
% examples/run_all_tests.pl structure
main :-
run_test_suite([
% Core compilers
test_stream_compiler,
test_recursive_compiler,
% Data sources
test_csv_source,
test_json_source,
test_http_source,
test_awk_source,
test_python_source,
test_xml_source, % NEW: XML engines (lxml, xmllint, xmlstarlet)
% Core modules
test_perl_service, % NEW: Perl code generation
% PowerShell
test_powershell_pure_mode,
test_powershell_baas_mode,
test_powershell_auto_mode,
% Firewall
test_firewall_permissive,
test_firewall_pure_powershell,
test_firewall_strict,
% Templates
test_template_rendering,
test_template_fallback,
% Error handling
test_error_cases
]).
run_all_tests.pl):
test_data/
├── test_users.csv # CSV test data
├── test_products.json # JSON test data
└── test_api_response.json # HTTP mock responses
test_output/ # Generated during tests (gitignored)
├── *.ps1 # Generated PowerShell scripts
├── *.sh # Generated bash scripts
└── *.log # Test logs
name: Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install SWI-Prolog
run: sudo apt-get install swi-prolog
- name: Run Tests
run: swipl examples/run_all_tests.pl
examples/run_all_tests.plexamples/tests/ directoryAuthors: John William Creighton (@s243a), Claude Code (Sonnet 4.5) License: MIT OR Apache-2.0