{"id":20106264,"url":"https://github.com/himkt/ac-random-test","last_synced_at":"2025-03-02T17:47:41.140Z","repository":{"id":236912849,"uuid":"793320138","full_name":"himkt/ac-random-test","owner":"himkt","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-03T03:01:58.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T05:09:02.641Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/himkt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-29T01:53:24.000Z","updated_at":"2025-01-03T03:02:01.000Z","dependencies_parsed_at":"2024-04-29T08:25:04.284Z","dependency_job_id":"74f24ade-9356-4512-85d2-f7c31918cda9","html_url":"https://github.com/himkt/ac-random-test","commit_stats":null,"previous_names":["himkt/ac-random-test"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fac-random-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fac-random-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fac-random-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/himkt%2Fac-random-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/himkt","download_url":"https://codeload.github.com/himkt/ac-random-test/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241549089,"owners_count":19980475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T17:49:38.528Z","updated_at":"2025-03-02T17:47:41.113Z","avatar_url":"https://github.com/himkt.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## AC Random Test\n\nCLI to run a program with randomly generated inputs (a.k.a. stress test), designed for programming contest (like AtCoder).\n\n### Install\n\nUse homebrew.\n\n```\nbrew tap himkt/tap\nbrew install himkt/tap/ac-random-test\n```\n\nYou can also download a binary from [GitHub Release](https://github.com/himkt/ac-random-test/releases).\n\n### Basic usage\n\n#### 1. Generating input randomly\n\n`ac-random-test` assumes `gen.py` (executable) exists on the current directory.\n`gen.py` should be executable like following:\n\n##### `file gen.py`\n\n```bash\ngen.py: Python script text executable, ASCII text\n```\n\n\u003e [!IMPORTANT]\n\u003e Make sure `gen.py` is executable.\n\n##### `cat gen.py`\n\n```python\n#!/usr/bin/python3\nimport random\nn = random.randint(1, 5)\na = [str(random.randint(0, 10)) for _ in range(n)]\nwith open(\"in.txt\", \"w\") as f:\n    print(n, file=f)\n    print(\" \".join(a), file=f)\n```\n\n\u003e [!IMPORTANT]\n\u003e Don't forget to provide a shebang.\n\n#### 2. Running a program\n\n`ac-random-test` runs `./a.out` if you provide `a.out` and `./{argv0}` as `--run-cmd`.\n`{argv0}` will be replaced with a name you give as a name (in this example, `a.out`).\n`ac-random-test` also runs `./a.out_lazy` and check results are the same, in other words,\nyou need to prepare two programs: one is a submission program and the another is a\nslow-but-correct program.\n\n```bash\nac-random-test a.out --run-cmd './{argv0}'\n```\n\nIf you want to run `ac-random-test` without a lazy program, specify `--without-lazy`.\n\n```bash\nac-random-test a.out \\\n    --run-cmd './{argv0}' \\\n    --without-lazy\n```\n\nYou may want to run a program written in other languages. No worries, please specify `--run-lazy-cmd`!\n\n```bash\nac-random-test a.out \\\n    --run-cmd './{argv0}' \\\n    --run-lazy-cmd 'python3 slow_ac_code.py'\n```\n\n### 3. Setting time limit\n\nIn programing contest, your program must finish to run in a given time limit.\nTo find an input that makes your program slow, you can specify `--max-ms` to limit an execution time.\nFor example, if you provide `--max-ms 50`, `ac-random-test` fails if your program don't finished within 50ms.\n\n```bash\nac-random-test a.out \\\n    --run-cmd './{argv0}' \\\n    --max-ms 50\n```\n\nOf course, `--max-ms` works with `--without-lazy`!\n\n```bash\nac-random-test a.out \\\n    --run-cmd './{argv0}' \\\n    --max-ms 50 \\\n    --without-lazy\n```\n\n### 4. Using custom input generating scripts\n\n`ac-random-test` assumes `gen.py` is created in the current directory by default.\nYou can use a custom script by specifying `--gen-input-cmd`.\n\n```bash\nac-random-test a.out \\\n    --run-cmd './{argv0}' \\\n    --gen-input-cmd \"python3 $HOME/Desktop/gen.py\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Fac-random-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhimkt%2Fac-random-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhimkt%2Fac-random-test/lists"}