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 --skip-lang LANG Skip a language (c, cpp, py, ts, js, csharp, gql) --only-generate Generate code only, skip tests --check-tools Check tool availability only --clean Clean generated and compiled filesExamples:
# 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-generateTest Prerequisites
Python 3.8+ with:
pip install proto-schema-parserC tests: GCC
# Ubuntu/Debiansudo apt install gcc
# macOSxcode-select --installC++ tests: G++ with C++14 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.