Name | compiler-testing-lib JSON |
Version |
0.1.6
JSON |
| download |
home_page | None |
Summary | A testing library for running language/compiler tests from YAML metadata. |
upload_time | 2025-07-17 20:35:02 |
maintainer | None |
docs_url | None |
author | Your Name |
requires_python | >=3.7 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Compiler Testing Lib
A flexible, multi-language testing framework for compiler and language feature validation. Designed to run language-specific tests defined in YAML files, with support for running tests via Python, Docker, or as a CI/CD step.
## Features
- **Multi-language support:** Organize tests for Python, JavaScript, and more.
- **YAML-based test definitions:** Centralized, versioned test metadata.
- **Pluggable runners:** Run tests using Python, Node.js, or any command-line tool.
- **Docker integration:** Build and run tests in isolated containers, with support for auto-cloning test repos.
- **PyPI package:** Installable as `compiler-testing-lib`.
- **Submodule example repo:** See `compiler-testing-example` for a ready-to-use test suite.
## Directory Structure
```
compiler-testing-lib/ # Main library package
compiler_testing_lib/
__init__.py
runner.py
languages/ # Test definitions and source files (per language/version)
python/
v1.0/
test001.py
test002.py
test.yaml
setup.py
MANIFEST.in
...
compiler-testing-example/ # Example repo (as a git submodule)
images/ # Docker build and run scripts
python/
Dockerfile
run_in_container.py
run.sh
mount.sh
clean.sh
```
## Installation
### As a Python Library
```bash
pip install compiler-testing-lib
```
### For Local Development
```bash
pip install -e .
```
### Install Example Requirements
```bash
pip install -r compiler-testing-example/requirements.txt
```
## Usage
### 1. **Run Tests via Python**
```python
from compiler_testing_lib.runner import TestRunner
runner = TestRunner(language='python', version='v1.0', max_errors=3, timeout=10, file_extension='py')
result = runner.run_tests(command_template='python3 main.py')
print(result)
```
### 2. **Run Tests via Example Scripts**
```bash
python3 compiler-testing-example/test.sh # Python runner (default)
python3 compiler-testing-example/test.sh js # Node.js runner
```
### 3. **Run in Docker**
Build the image:
```bash
cd images
./mount.sh
```
Run the container (auto-clones the example repo and runs tests):
```bash
./run.sh
```
## Docker Image Details
- Installs the latest `compiler-testing-lib` from PyPI.
- Accepts `--git_username` and `--git_repository` to auto-clone a test repo.
- Runs all tests and prints results to the terminal.
## Adding/Updating Tests
- Place new test files and update `test.yaml` in the appropriate `languages/<lang>/<version>/` directory inside `compiler_testing_lib/`.
- Rebuild and upload the package to PyPI for distribution.
## Contributing
1. Fork the repo and create a feature branch.
2. Add or update tests in `compiler_testing_lib/languages/`.
3. Update `test.yaml` as needed.
4. Run tests locally or in Docker.
5. Submit a pull request.
## License
MIT
---
**For more examples, see the `compiler-testing-example` submodule.**
Raw data
{
"_id": null,
"home_page": null,
"name": "compiler-testing-lib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Your Name",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a9/40/d9f503ff9e8810cde4a1f0fa6d0c6035c4134bc2606daaef0d1550f501c6/compiler_testing_lib-0.1.6.tar.gz",
"platform": null,
"description": "# Compiler Testing Lib\n\nA flexible, multi-language testing framework for compiler and language feature validation. Designed to run language-specific tests defined in YAML files, with support for running tests via Python, Docker, or as a CI/CD step.\n\n## Features\n- **Multi-language support:** Organize tests for Python, JavaScript, and more.\n- **YAML-based test definitions:** Centralized, versioned test metadata.\n- **Pluggable runners:** Run tests using Python, Node.js, or any command-line tool.\n- **Docker integration:** Build and run tests in isolated containers, with support for auto-cloning test repos.\n- **PyPI package:** Installable as `compiler-testing-lib`.\n- **Submodule example repo:** See `compiler-testing-example` for a ready-to-use test suite.\n\n## Directory Structure\n```\ncompiler-testing-lib/ # Main library package\n compiler_testing_lib/\n __init__.py\n runner.py\n languages/ # Test definitions and source files (per language/version)\n python/\n v1.0/\n test001.py\n test002.py\n test.yaml\n setup.py\n MANIFEST.in\n ...\ncompiler-testing-example/ # Example repo (as a git submodule)\nimages/ # Docker build and run scripts\n python/\n Dockerfile\n run_in_container.py\n run.sh\n mount.sh\n clean.sh\n```\n\n## Installation\n\n### As a Python Library\n```bash\npip install compiler-testing-lib\n```\n\n### For Local Development\n```bash\npip install -e .\n```\n\n### Install Example Requirements\n```bash\npip install -r compiler-testing-example/requirements.txt\n```\n\n## Usage\n\n### 1. **Run Tests via Python**\n```python\nfrom compiler_testing_lib.runner import TestRunner\nrunner = TestRunner(language='python', version='v1.0', max_errors=3, timeout=10, file_extension='py')\nresult = runner.run_tests(command_template='python3 main.py')\nprint(result)\n```\n\n### 2. **Run Tests via Example Scripts**\n```bash\npython3 compiler-testing-example/test.sh # Python runner (default)\npython3 compiler-testing-example/test.sh js # Node.js runner\n```\n\n### 3. **Run in Docker**\nBuild the image:\n```bash\ncd images\n./mount.sh\n```\nRun the container (auto-clones the example repo and runs tests):\n```bash\n./run.sh\n```\n\n## Docker Image Details\n- Installs the latest `compiler-testing-lib` from PyPI.\n- Accepts `--git_username` and `--git_repository` to auto-clone a test repo.\n- Runs all tests and prints results to the terminal.\n\n## Adding/Updating Tests\n- Place new test files and update `test.yaml` in the appropriate `languages/<lang>/<version>/` directory inside `compiler_testing_lib/`.\n- Rebuild and upload the package to PyPI for distribution.\n\n## Contributing\n1. Fork the repo and create a feature branch.\n2. Add or update tests in `compiler_testing_lib/languages/`.\n3. Update `test.yaml` as needed.\n4. Run tests locally or in Docker.\n5. Submit a pull request.\n\n## License\nMIT\n\n---\n\n**For more examples, see the `compiler-testing-example` submodule.**\n",
"bugtrack_url": null,
"license": null,
"summary": "A testing library for running language/compiler tests from YAML metadata.",
"version": "0.1.6",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3db5451ab776d3e3ae1f04c130b048dc94ff7194d95e57b3cb8012970a75a64a",
"md5": "b6434010acfb4fed83761330015043c6",
"sha256": "da07f63d53063e855e8e8be63aa8c0a8e6f0897b24f44ce7bcd2324d2b0f67a4"
},
"downloads": -1,
"filename": "compiler_testing_lib-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b6434010acfb4fed83761330015043c6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 7186,
"upload_time": "2025-07-17T20:35:00",
"upload_time_iso_8601": "2025-07-17T20:35:00.924075Z",
"url": "https://files.pythonhosted.org/packages/3d/b5/451ab776d3e3ae1f04c130b048dc94ff7194d95e57b3cb8012970a75a64a/compiler_testing_lib-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a940d9f503ff9e8810cde4a1f0fa6d0c6035c4134bc2606daaef0d1550f501c6",
"md5": "336c698d11ac8cc2801690c44612db49",
"sha256": "af23ec910f099b585cb7c9f65e76ef344336e3fe11b6b4b8fff60bd6a48f6ca5"
},
"downloads": -1,
"filename": "compiler_testing_lib-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "336c698d11ac8cc2801690c44612db49",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6842,
"upload_time": "2025-07-17T20:35:02",
"upload_time_iso_8601": "2025-07-17T20:35:02.023466Z",
"url": "https://files.pythonhosted.org/packages/a9/40/d9f503ff9e8810cde4a1f0fa6d0c6035c4134bc2606daaef0d1550f501c6/compiler_testing_lib-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-17 20:35:02",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "compiler-testing-lib"
}