compiler-testing-lib


Namecompiler-testing-lib JSON
Version 0.1.12 PyPI version JSON
download
home_pageNone
SummaryA testing library for running language/compiler tests from YAML metadata.
upload_time2025-09-13 16:04:26
maintainerNone
docs_urlNone
authorYour Name
requires_python>=3.7
licenseNone
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/75/a9/4a9d67c63ff4990e7e4426c17187c81f5fe7d0abc710ab3022d558795a0d/compiler_testing_lib-0.1.12.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.12",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "61f976714432dcdc8fe7a240b16f6f89285dcc66483dc58c1d9eaa8494879716",
                "md5": "deea6c7cbf554c56778f5c82fba1d895",
                "sha256": "3cc1978fbfe7039c5ded265bd8496a79196a5b6679ef43ad1bc8a3072e9a9260"
            },
            "downloads": -1,
            "filename": "compiler_testing_lib-0.1.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "deea6c7cbf554c56778f5c82fba1d895",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 103985,
            "upload_time": "2025-09-13T16:04:24",
            "upload_time_iso_8601": "2025-09-13T16:04:24.114283Z",
            "url": "https://files.pythonhosted.org/packages/61/f9/76714432dcdc8fe7a240b16f6f89285dcc66483dc58c1d9eaa8494879716/compiler_testing_lib-0.1.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "75a94a9d67c63ff4990e7e4426c17187c81f5fe7d0abc710ab3022d558795a0d",
                "md5": "9a2fcb71129a729c3a2af0900e4f1bd1",
                "sha256": "a406e464c35ea629845f0db2c061be765774f5322ab9a62b9793fb21e0ad4fc6"
            },
            "downloads": -1,
            "filename": "compiler_testing_lib-0.1.12.tar.gz",
            "has_sig": false,
            "md5_digest": "9a2fcb71129a729c3a2af0900e4f1bd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 28405,
            "upload_time": "2025-09-13T16:04:26",
            "upload_time_iso_8601": "2025-09-13T16:04:26.381566Z",
            "url": "https://files.pythonhosted.org/packages/75/a9/4a9d67c63ff4990e7e4426c17187c81f5fe7d0abc710ab3022d558795a0d/compiler_testing_lib-0.1.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-13 16:04:26",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "compiler-testing-lib"
}
        
Elapsed time: 1.59498s