Add comprehensive test infrastructure and fix dependency management for sample code validation #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a robust test infrastructure to validate that sample .llm code compiles and executes correctly, while fixing critical dependency management issues that prevented tests from running.
Problem
The repository lacked comprehensive tests to ensure that:
Additionally, heavy ML dependencies (PyTorch, FAISS) were blocking test execution even when using
--no-default-features, making it impossible to validate basic functionality in environments without these external system libraries.Solution
🧪 Comprehensive Test Suite
Added three levels of testing:
Sample Code Tests (
tests/sample_code_tests.rs)CLI Integration Tests (
tests/cli_integration_tests.rs)llmi(interpreter) works with example filesllmc(compiler) can compile examples to binariesrun_example.shscript functionalityEnd-to-End Tests (
tests/end_to_end_tests.rs)🔧 Dependency Management Fix
rust-bert,tokenizers,rust_tokenizers→ moved to optionalnlpfeaturendarray,faiss→ moved to optionalvectorsfeature📊 Results
🚀 Usage
📚 Documentation
docs/testing.mdtest_demo.sh) showcasing functionalityImpact
This test infrastructure provides:
The LLM.lang project now has production-ready testing that validates the entire pipeline from source code to executable programs, ensuring users can trust that provided examples will work correctly.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.