cp-jen


Namecp-jen JSON
Version 2024.0.0 PyPI version JSON
download
home_pageNone
SummaryConfigurable test case generator for competitive programming.
upload_time2024-04-08 02:48:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseNone
keywords jen cp-jen competitive programming test generator codeforces atcoder
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 📚 About 

Jen is a configurable test case generator for competitive programming.
The format of the test cases is specified in a TOML configuration file. 

# 🔌 Installation

Python version >=3.11 is required to install the python library. Install with:

`pip install cp-jen`

This will create a `jen` script in your python `bin` folder.
To call this script from anyware, ensure the python `bin` folder is in your PATH.

# 💼 Usage

Calling `jen` with a configuration file creates a test case and saves it in the current directory.

`jen config.toml`

To stress test your program, run `jen` with two additional arguments:

`jen config.toml ./tst ./ref`

Jen will continuously generate test cases and pipe them to the test and reference program's standard input.
The outputs from both programs are compared until a test case that generates different outputs is found.

# ⚙️  Configuration

The configuration is a TOML file. Examples of input configurations for past problems are in the examples folder.

## Example Configuration
As an example, we look at test cases for Atcoder contest [ABC346, problem D](https://atcoder.jp/contests/abc346/tasks/abc346_d).

```toml
in = """
N
S
{C}"""

[N]
type = 'int'
min = 2
max = 20

[S]
type = 'str'
allowed = ['0','1']
min = 'N'
max = 'N'

[C]
type = 'int'
min = 1
max = 1000000000

[1]
delimiter = ' '
count = 'N' 
```

Each test case will have an integer N, followed by a string of zeros and ones of size N, and finally N integers between 1 and 1,000,000,000 separated by spaces.

## jen.toml Specifications 

A variable called "in" is required. It is a string defining the input variables.

*in* rules:
- Any latin script letter is considered a variable (case sensitive).
- braces {} define a group. Groups are repeating sections of input.
- The first group is called '1'. The second group is '2', ... etc.
- group [1.1] is the first group within group 1.
- Any other character is kept as-is when generating inputs.

Each variable has a type. The type of a variable can be inferred from its name
or set explicitly in the variable configurations.
Each type has allowed properties and default values for those properties, listed below.

*Types*
- **int**:
    - default names: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,u,v,w)
    - min: 0
    - max: 1000

- **string**:
    - default names: (s,t)
    - min: 0
    - max: 1000

- **float**:
    - default names: (x,y,z)
    - min: 0.0
    - max: 1000.0

- **group**:
    - count: 'n'
    - delimiter: " "


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cp-jen",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "jen, cp-jen, Competitive Programming, Test Generator, Codeforces, Atcoder",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/1c/c6/90f640bc604c4fa7d4e450321a035cfc565f7689a4973323f6b07fb8bcb1/cp_jen-2024.0.0.tar.gz",
    "platform": null,
    "description": "# \ud83d\udcda About \n\nJen is a configurable test case generator for competitive programming.\nThe format of the test cases is specified in a TOML configuration file. \n\n# \ud83d\udd0c Installation\n\nPython version >=3.11 is required to install the python library. Install with:\n\n`pip install cp-jen`\n\nThis will create a `jen` script in your python `bin` folder.\nTo call this script from anyware, ensure the python `bin` folder is in your PATH.\n\n# \ud83d\udcbc Usage\n\nCalling `jen` with a configuration file creates a test case and saves it in the current directory.\n\n`jen config.toml`\n\nTo stress test your program, run `jen` with two additional arguments:\n\n`jen config.toml ./tst ./ref`\n\nJen will continuously generate test cases and pipe them to the test and reference program's standard input.\nThe outputs from both programs are compared until a test case that generates different outputs is found.\n\n# \u2699\ufe0f  Configuration\n\nThe configuration is a TOML file. Examples of input configurations for past problems are in the examples folder.\n\n## Example Configuration\nAs an example, we look at test cases for Atcoder contest [ABC346, problem D](https://atcoder.jp/contests/abc346/tasks/abc346_d).\n\n```toml\nin = \"\"\"\nN\nS\n{C}\"\"\"\n\n[N]\ntype = 'int'\nmin = 2\nmax = 20\n\n[S]\ntype = 'str'\nallowed = ['0','1']\nmin = 'N'\nmax = 'N'\n\n[C]\ntype = 'int'\nmin = 1\nmax = 1000000000\n\n[1]\ndelimiter = ' '\ncount = 'N' \n```\n\nEach test case will have an integer N, followed by a string of zeros and ones of size N, and finally N integers between 1 and 1,000,000,000 separated by spaces.\n\n## jen.toml Specifications \n\nA variable called \"in\" is required. It is a string defining the input variables.\n\n*in* rules:\n- Any latin script letter is considered a variable (case sensitive).\n- braces {} define a group. Groups are repeating sections of input.\n- The first group is called '1'. The second group is '2', ... etc.\n- group [1.1] is the first group within group 1.\n- Any other character is kept as-is when generating inputs.\n\nEach variable has a type. The type of a variable can be inferred from its name\nor set explicitly in the variable configurations.\nEach type has allowed properties and default values for those properties, listed below.\n\n*Types*\n- **int**:\n    - default names: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,u,v,w)\n    - min: 0\n    - max: 1000\n\n- **string**:\n    - default names: (s,t)\n    - min: 0\n    - max: 1000\n\n- **float**:\n    - default names: (x,y,z)\n    - min: 0.0\n    - max: 1000.0\n\n- **group**:\n    - count: 'n'\n    - delimiter: \" \"\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Configurable test case generator for competitive programming.",
    "version": "2024.0.0",
    "project_urls": {
        "Home": "https://github.com/FaresBadrCA/cp-jen"
    },
    "split_keywords": [
        "jen",
        " cp-jen",
        " competitive programming",
        " test generator",
        " codeforces",
        " atcoder"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "41295fb1c51f0c9a33ee2fc4ea5ea8b888b32b0770c60f65b185999585f248c1",
                "md5": "b8020e9be80991a662e29aa8ea09ad37",
                "sha256": "44fbc073a41c2bb223e84f6c208b4036d078e095bb97237b0cc0e9625ce3d93e"
            },
            "downloads": -1,
            "filename": "cp_jen-2024.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b8020e9be80991a662e29aa8ea09ad37",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.11",
            "size": 5563,
            "upload_time": "2024-04-08T02:47:58",
            "upload_time_iso_8601": "2024-04-08T02:47:58.512360Z",
            "url": "https://files.pythonhosted.org/packages/41/29/5fb1c51f0c9a33ee2fc4ea5ea8b888b32b0770c60f65b185999585f248c1/cp_jen-2024.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1cc690f640bc604c4fa7d4e450321a035cfc565f7689a4973323f6b07fb8bcb1",
                "md5": "a2358df85936f5145f5fdb2cabc4a231",
                "sha256": "e14c852de4f54776466cad060d179668899b2f104916e8f128071014af552b79"
            },
            "downloads": -1,
            "filename": "cp_jen-2024.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a2358df85936f5145f5fdb2cabc4a231",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 4826,
            "upload_time": "2024-04-08T02:48:09",
            "upload_time_iso_8601": "2024-04-08T02:48:09.819463Z",
            "url": "https://files.pythonhosted.org/packages/1c/c6/90f640bc604c4fa7d4e450321a035cfc565f7689a4973323f6b07fb8bcb1/cp_jen-2024.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-08 02:48:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FaresBadrCA",
    "github_project": "cp-jen",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cp-jen"
}
        
Elapsed time: 0.79557s