This directory contains utility scripts for building, testing, and maintaining the VneLogging library.
Builds VneLogging on Linux using GCC or Clang.
# Basic build
./scripts/build_linux.sh -t Debug -a configure_and_build
# Select compiler and parallel jobs
./scripts/build_linux.sh -c clang -j 20 -t Release
# Interactive mode
./scripts/build_linux.sh -interactive
# Clean build
./scripts/build_linux.sh -clean -t DebugOptions:
-t, --build-type <type>- Build type: Debug, Release, RelWithDebInfo, MinSizeRel-c, --compiler <compiler>- Compiler: gcc or clang-a, --action <action>- Action: configure, build, configure_and_build, test-j, --jobs <N>- Number of parallel jobs-clean- Clean build directory before building-interactive- Interactive mode for configuration-h, --help- Show help message
Builds VneLogging on macOS using Clang or Xcode.
# Basic build
./scripts/build_macos.sh -t Debug -a configure_and_build
# Generate Xcode project
./scripts/build_macos.sh -xcode -t Release
# Interactive mode
./scripts/build_macos.sh -interactiveOptions:
-t, --build-type <type>- Build type-xcode- Generate Xcode project instead of building-a, --action <action>- Action: configure, build, configure_and_build, test-j, --jobs <N>- Number of parallel jobs-clean- Clean build directory-interactive- Interactive mode-h, --help- Show help
Native Windows build script with better error handling.
# Basic build
python scripts/build_windows.py -t Debug -a configure_and_build
# Select Visual Studio version
python scripts/build_windows.py --vs-version 2022 -t Release
# Interactive mode
python scripts/build_windows.py --interactiveOptions:
-t, --build-type <type>- Build type--vs-version <version>- Visual Studio version (2019, 2022)-a, --action <action>- Action: configure, build, configure_and_build, test-j, --jobs <N>- Number of parallel jobs--clean- Clean build directory--interactive- Interactive mode-h, --help- Show help
For Git Bash or WSL users.
./scripts/build_windows.sh -t Debug -a configure_and_build
./scripts/build_windows.sh -j 8 -t ReleaseBuilds VneLogging for Web using Emscripten.
# Basic build
./scripts/build_web.sh Debug
# Force rebuild with parallel jobs
./scripts/build_web.sh -f -j4 ReleaseOptions:
<build_type>- Build type (Debug, Release, etc.)-f, --force- Force rebuild-j, --jobs <N>- Number of parallel jobs-h, --help- Show help
Builds VneLogging for iOS (Simulator or Device).
# Basic build
./scripts/build_ios.sh -t Debug -a configure_and_build
# Build for device
./scripts/build_ios.sh -device -deployment-target 15.0
# Generate Xcode project only
./scripts/build_ios.sh -xcode-only -t ReleaseOptions:
-t, --build-type <type>- Build type-device- Build for device (default: simulator)-deployment-target <version>- iOS deployment target version-xcode-only- Generate Xcode project without building-a, --action <action>- Action: configure, build, configure_and_build, test-j, --jobs <N>- Number of parallel jobs-clean- Clean build directory-h, --help- Show help
Formats C++ source files using clang-format.
# Format all default trees: src, include, tests, examples (each if present)
python scripts/clang_formatter.py all
# Format one directory
python scripts/clang_formatter.py src
# Format single file
python scripts/clang_formatter.py --file src/vertexnova/logging/logging.cpp
# Preview changes without modifying files
python scripts/clang_formatter.py all --dry-run
# Verbose output
python scripts/clang_formatter.py all --verboseOptions:
<folder>- Directory to format, or the keywordallfor standard project folders--file <file>- Single file to format--dry-run- Preview changes without modifying files--verbose- Show verbose output-h, --help- Show help
Runs both cppcheck and clang-tidy analysis.
# Run both analyzers
python scripts/static_analyzer.py src/vnelogging
# Run only cppcheck
python scripts/static_analyzer.py src/vnelogging --cppcheck-only
# Run only clang-tidy
python scripts/static_analyzer.py src/vnelogging --clang-tidy-only
# Analyze single file
python scripts/static_analyzer.py --file src/vertexnova/logging/logging.cppOptions:
<folder>- Directory to analyze--file <file>- Single file to analyze--cppcheck-only- Run only cppcheck--clang-tidy-only- Run only clang-tidy--verbose- Show verbose output--save-raw-xml- Keep raw XML report from cppcheck--save-raw-json- Keep raw JSON report from clang-tidy-h, --help- Show help
Reports: Generated HTML reports are saved to build/cppcheck-reports/ and build/clang-tidy-reports/
Runs clang-tidy static analysis.
python scripts/clang_tidy_analyzer.py src/vnelogging
python scripts/clang_tidy_analyzer.py --file src/vertexnova/logging/logging.cpp --verboseRuns cppcheck static analysis.
python scripts/cppcheck_analyzer.py src/vnelogging
python scripts/cppcheck_analyzer.py --file src/vertexnova/logging/logging.cpp --verboseRun Google Test with filters to execute specific test cases.
# Run all tests
./scripts/run_google_test_filter.sh build/Debug/build-linux-gcc-12.0.0/bin/TestVneLogging
# Run tests matching a pattern
./scripts/run_google_test_filter.sh build/Debug/build-linux-gcc-12.0.0/bin/TestVneLogging "LogStream.*"
# List all available tests
./scripts/run_google_test_filter.sh build/Debug/build-linux-gcc-12.0.0/bin/TestVneLogging --list
# Verbose output
./scripts/run_google_test_filter.sh build/Debug/build-linux-gcc-12.0.0/bin/TestVneLogging "LogStream.*" --verboseOptions:
<test_binary>- Path to test executable (required)<filter>- Test filter pattern (optional)-l, --list- List all available tests-v, --verbose- Enable verbose output-h, --help- Show help
Filter Examples:
"LogStream.*"- Run all tests starting with "LogStream""*FileSink*"- Run all tests containing "FileSink""Test1:Test2"- Run Test1 and Test2"-*Slow*"- Run all tests except those containing "Slow"
Verifies that code coverage is enabled and working correctly.
# Check coverage status
./scripts/check_coverage.sh -d build/Debug/build-macos-clang-17.0.0
./scripts/check_coverage.sh -d build/Debug/build-linux-gcc-12.0.0Options:
-d, --build-dir <dir>- Build directory (required)-h, --help- Show help
Note: Coverage must be enabled during CMake configuration with -DENABLE_COVERAGE=ON
Generates HTML code coverage reports for macOS (LLVM) or Linux (GCC/lcov).
# Generate coverage report
./scripts/generate_coverage.sh -d build/Debug/build-macos-clang-17.0.0
# Filter to only src/vnelogging (exclude tests and third-party)
./scripts/generate_coverage.sh -d build/Debug/build-linux-gcc-12.0.0 -f
# Use existing coverage data (skip test execution)
./scripts/generate_coverage.sh -d build/Debug/build-macos-clang-17.0.0 --no-tests
# Specify test executable
./scripts/generate_coverage.sh -d build/Debug/build-linux-gcc-12.0.0 -e ./bin/TestVneLoggingOptions:
-d, --build-dir <dir>- Build directory (required)-t, --build-type <type>- Build type (default: Debug)-e, --executable <exe>- Test executable (default: auto-detect)-f, --filter-src-only- Filter to only src/vnelogging-n, --no-open- Don't open report in browser--no-tests- Don't run tests (use existing coverage data)-h, --help- Show help
Report Location: build/<build_dir>/coverage_report/index.html
Generates API documentation using Doxygen and validates documentation.
# Generate all documentation
./scripts/generate-docs.sh
# Generate only API documentation
./scripts/generate-docs.sh --api-only
# Validate existing documentation (links, code examples)
./scripts/generate-docs.sh --validateOptions:
--api-only- Generate only API documentation--validate- Only validate existing documentation-h, --help- Show help
Requirements:
- Doxygen (for API documentation)
- markdown-link-check (for link validation)
Output: Documentation is generated in docs/api/generated/
- CMake 3.16 or higher
- C++20 compatible compiler (GCC 10+, Clang 12+, MSVC 2019+)
- clang-format - Code formatting
- clang-tidy - Static analysis
- cppcheck - Additional static analysis
Installation:
# Ubuntu/Debian
sudo apt install clang-format clang-tidy cppcheck
# macOS
brew install llvm cppcheck- lcov (Linux) - Code coverage for GCC
- llvm-cov (macOS) - Code coverage for Clang (included with Xcode)
Installation:
# Ubuntu/Debian
sudo apt install lcov
# macOS (included with Xcode Command Line Tools)
xcode-select --install- doxygen - API documentation generation
- markdown-link-check - Link validation
Installation:
# Ubuntu/Debian
sudo apt install doxygen
npm install -g markdown-link-check
# macOS
brew install doxygen
npm install -g markdown-link-check# Build Debug version with tests
./scripts/build_linux.sh -t Debug -a configure_and_build
# Run tests
cd build/Debug/build-linux-gcc-12.0.0
ctest --output-on-failure# Format code
python scripts/clang_formatter.py all
# Run static analysis
python scripts/static_analyzer.py src/vnelogging# Build with coverage enabled
./scripts/build_linux.sh -t Debug -a configure
cd build/Debug/build-linux-gcc-12.0.0
cmake . -DENABLE_COVERAGE=ON
cmake --build . -j8
# Generate coverage report
./scripts/generate_coverage.sh -d build/Debug/build-linux-gcc-12.0.0 -f# Generate API documentation
./scripts/generate-docs.sh --api-only