This directory contains comprehensive test suites for all KAI programming languages: Pi, Rho, Tau, and Hlsl.
Tests for the Pi stack-based language:
- Basic Operations: Arithmetic, stack manipulation, data types
- Advanced Features: Functions, continuations, control flow
- Language Integration: Pi-to-Rho interoperability
- Performance Tests: Stack operations and memory usage
- Script Examples: Real-world Pi programs
Tests for the Rho infix language:
- Syntax Validation: C-like syntax parsing and execution
- Control Structures: If/else, loops, functions
- Language Features: Variables, scoping, recursion
- Cross-Language: Rho-to-Pi compilation verification
- Advanced Constructs: Closures, generators, pattern matching
Tests for the Tau Interface Definition Language:
- Code Generation: Proxy and stub generation
- Network Interfaces: Remote object definitions
- Type System: Complex type definitions and validation
- Namespace Support: Hierarchical organization
- Integration Tests: Generated code compilation
Tests for HLSL (High Level Shading Language) support:
- Shader Compilation: HLSL to intermediate representation
- Graphics Integration: GPU computation support
- Syntax Parsing: HLSL-specific language constructs
Shared testing utilities and base classes for all language tests:
- Language setup and teardown
- Common assertion helpers
- Cross-language execution support
make test
ctest -R Languagectest -R TestPi # Pi language tests
ctest -R TestRho # Rho language tests
ctest -R TestTau # Tau IDL tests
ctest -R TestHlsl # HLSL testsctest -R TestRho -V # Shows detailed test output- Lexical analysis and parsing
- Expression evaluation
- Variable assignment and scoping
- Function definition and calling
- Control flow (if/else, loops)
- Exception handling
- Memory management
- Garbage collection integration
- Pi ↔ Rho interoperability
- Language switching in console
- Mixed-language script execution
- Type compatibility across languages
- Large program execution
- Memory usage validation
- Stack overflow protection
- Error recovery mechanisms
Located in TestPi/Scripts/:
- Arithmetic operations and stack manipulation
- Function definitions and recursion
- Array and string operations
- Advanced control flow
Located in TestRho/Scripts/:
- C-like syntax demonstrations
- Object-oriented features
- Functional programming constructs
- Error handling patterns
Located in TestTau/Scripts/:
- Interface definitions
- Network service descriptions
- Code generation templates
- Distributed object interfaces
- Pi Language Tutorial
- Rho Language Tutorial
- Tau Language Tutorial
- Language Guide
- Common Language System
When adding new language tests:
- Follow the existing test structure in each language directory
- Add both positive and negative test cases
- Include example scripts demonstrating the feature
- Update the appropriate README.md file
- Ensure tests pass on all supported platforms