# LDASTools CMake Test Suite

This directory contains comprehensive tests for the cx_boost_* macros and other CMake functionality in the ldastools_cmake package.

## Test Components

### 1. Direct CMake Tests (`test_cx_boost_macros.cmake`)
- Direct testing of cx_boost_* macro functionality
- Tests basic boost detection, component detection, and error handling
- Run with: `cmake -P test_cx_boost_macros.cmake`

### 2. Environment Testing (`test_cx_boost_environments.py`)
- Multi-environment validation script with enhanced cross-platform portability
- Tests boost detection across different installation scenarios
- Run with: `python3 test_cx_boost_environments.py`

### 3. Cross-Platform Validation (`test_cx_boost_validation.py`)
- Python-based cross-platform testing
- Platform-specific detection and comprehensive reporting
- Run with: `python3 test_cx_boost_validation.py`

### 4. Master Test Suite (`run_cx_boost_tests.py`)
- Comprehensive test runner with enhanced cross-platform portability
- Runs all test components in sequence with detailed reporting
- Run with: `python3 run_cx_boost_tests.py`

### 5. Integration Tests (`integration/`)
- Real project context testing
- Contains CMakeLists.txt and boost_test_simple.cpp
- Tests actual compilation and linking with boost libraries

## Running Tests

### Individual Tests
```bash
# Run CMake macro tests
cmake -DCMAKE_MODULE_PATH=../Modules -P test_cx_boost_macros.cmake

# Run environment tests
python3 test_cx_boost_environments.py

# Run Python validation
python3 test_cx_boost_validation.py

# Run integration test
cd integration && mkdir build && cd build
cmake -DCMAKE_MODULE_PATH=../../Modules ..
make boost_test_simple && ./boost_test_simple
```

### Complete Test Suite
```bash
# From the test directory - Enhanced cross-platform version
python3 run_cx_boost_tests.py

# Or from the main directory - Legacy version
./run_cx_boost_tests.sh
```

### CMake Test Integration
```bash
# From ldastools_cmake directory
mkdir build && cd build
cmake -DBUILD_TESTING=ON ..
make test
```

## Test Coverage

- **Platform Detection**: Linux, macOS, Windows, Conda environments
- **Version Requirements**: Minimum version validation
- **Component Detection**: filesystem, system, thread, chrono components
- **Environment Variations**: Standard, conda, custom, versioned installations
- **Integration Validation**: Real compilation and runtime testing

## Success Criteria

- ✅ Boost detection successful across available installations
- ✅ Version requirements properly validated
- ✅ Components detected and linkable
- ✅ Environment-specific detection working
- ✅ Integration with real projects successful

## Files Overview

```
test/
├── CMakeLists.txt                        # Test suite configuration
├── README.md                             # This file
├── test_cx_boost_macros.cmake            # Direct CMake testing
├── test_cx_boost_environments.py         # Environment testing (Python)
├── test_cx_boost_environments.sh         # Environment testing (legacy shell)
├── test_cx_boost_validation.py           # Cross-platform validation
├── run_cx_boost_tests.py                 # Master test suite (Python)
└── integration/                          # Integration tests
    ├── CMakeLists.txt                    # Integration test project
    └── boost_test_simple.cpp             # Boost functionality test
```

This test suite validates the fixes implemented for pipeline boost detection issues and ensures cross-platform compatibility of the cx_boost_* macros. The Python-based test scripts provide enhanced portability across Windows, macOS, and Linux platforms compared to the original shell scripts.