Testing
Running Tests
From the project root:
# Run all testspython test_all.py
# Or use the test runner directlypython tests/run_tests.pyTest Runner Options
python tests/run_tests.py [options]
Options: --verbose, -v Show detailed output --quiet, -q Suppress failure output --skip-lang LANG Skip a language (can be repeated) --only-generate Generate code only, skip compile and test --only-compile Stop after compilation, don't run tests --check-tools Check tool availability only --no-clean Skip cleaning generated files (faster iteration) --profile NAME Only test specific profile(s) --no-parallel Disable parallel compilation --no-color Disable colored outputExamples:
# Skip TypeScript testspython tests/run_tests.py --skip-lang ts
# Only check if compilers are installedpython tests/run_tests.py --check-tools
# Generate code without running testspython tests/run_tests.py --only-generate
# Faster iteration (skip cleaning)python tests/run_tests.py --no-cleanTest Prerequisites
Python 3.8+ with:
pip install proto-schema-parserC tests: GCC
# Ubuntu/Debiansudo apt install gcc
# macOSxcode-select --installC++ tests: G++ with C++20 support
# Ubuntu/Debiansudo apt install g++
# macOSxcode-select --installTypeScript/JavaScript tests: Node.js + npm
# Ubuntu/Debiansudo apt install nodejs npm
# macOSbrew install node
# Then install dependenciescd tests/ts && npm installC# tests: .NET SDK 8.0+
# Ubuntu/Debiansudo apt install dotnet-sdk-8.0
# macOSbrew install dotnet-sdkTest Types
Basic Types Test
Validates serialization of primitive types (integers, floats, booleans, strings).
Array Operations Test
Validates array serialization (fixed arrays, bounded arrays, nested arrays).
Cross-Platform Compatibility
Tests interoperability between languages. Produces a compatibility matrix showing which language pairs can exchange data.
Adding a New Test
- Add test to
tests/test_suites.json - Create test files in
tests/<lang>/ - Follow test output format:
- Print
[TEST START] <Language> <Test Name> - Print
[TEST END] <Language> <Test Name>: PASSorFAIL - Exit with code 0 on success, 1 on failure
- Print
CI Integration
GitHub Actions runs tests on every push to main and every pull request. Artifacts are available for download for 5 days after each run.