{"id":16358284,"url":"https://github.com/hgruniaux/cmd_test_runner","last_synced_at":"2025-12-23T23:30:14.097Z","repository":{"id":159175206,"uuid":"634491078","full_name":"hgruniaux/cmd_test_runner","owner":"hgruniaux","description":"A command-line program test runner implemented in Python.","archived":false,"fork":false,"pushed_at":"2023-04-30T16:37:36.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T13:26:38.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/hgruniaux.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":"2023-04-30T09:51:00.000Z","updated_at":"2023-04-30T09:54:29.000Z","dependencies_parsed_at":"2023-05-26T13:15:17.446Z","dependency_job_id":null,"html_url":"https://github.com/hgruniaux/cmd_test_runner","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"5d504ba915236b9efbb58b7dde01b1fecf6005cb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgruniaux%2Fcmd_test_runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgruniaux%2Fcmd_test_runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgruniaux%2Fcmd_test_runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hgruniaux%2Fcmd_test_runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hgruniaux","download_url":"https://codeload.github.com/hgruniaux/cmd_test_runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239707995,"owners_count":19684156,"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-10-11T02:05:15.456Z","updated_at":"2025-12-23T23:30:14.044Z","avatar_url":"https://github.com/hgruniaux.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cmd_test_runner\n\nA command-line program test runner implemented in Python.\n\n# Documentation\n\n## Command-line arguments for test_runner.py\n\n### Output of `python test_runner.py --help`:\n```\nusage: test_runner.py [-h] [--list] [--filter FILTER] [--threads THREADS] [--shuffle] [--brief] [--color {yes,no,auto}] [--update] [--var VAR VALUE] [dirs ...]\n\nTest runner.\n\npositional arguments:\n  dirs                  all directories to lookup for tests\n\noptions:\n  -h, --help            show this help message and exit\n  --list                list the names of all tests instead of running them\n  --filter FILTER       run only the tests whose name matches the given regular expression\n  --threads THREADS     maximum number of threads to use for running tests, -1 means none, 0 means all availables cpus (default: 0)\n  --shuffle             randomize tests' orders\n  --brief               only print test failures\n  --color {yes,no,auto}\n                        enable/disable colored output (default: auto)\n  --update              run tests and update the expected results according\n  --var VAR VALUE       declare a variable to be expanded in test files using the '$VAR' format\n```\n\n### Details\n\n- `--filter` allow you to select a subset of discovered tests to run, update or list. It takes as an argument a regular expression with the Python `re` module syntax.\n\nExample, if `test_runner --list` returns \n```\nfoo.bar.0\nfoo.bar.1\nfoo.baz.0\nfoo.baz.2\n```\n`test_runner --list --filter foo\\.ba[rz]\\.0` will return\n```\nfoo.bar.0\nfoo.baz.0\n```\n\n## Test file syntax\n\nAll test files must use the `.test` extension to be discovered by the test runner.\n\n### Example\n\n```\n; CMD $exe --version\n; EXITCODE 0\n; STDOUT\nmy_program version 1.2.3\n\n; STDERR\n\n```\n\nThis test will execute the program `$exe` with the argument `--version`. The variable `$exe` will be expanded to `my_program` if the option `--var exe my_program` is passed when calling test_runner.py.\n\nThe test will pass if and only if:\n- The return code of the program is `0`\n- The standard output is a valid text and it is equals to `my_program version 1.2.3↲`.\n- The standard error output is empty.\n\n### Fields\n\n- `CMD`: the program to execute with the given arguments. Shell syntax is not supported however the command is split into arguments using Python `shlex.split()`. The program is executed using Python `subprocess.run(shlex.split(cmd), ...)`.\n- `EXITCODE`: the expected return code from the command. This field is optional and by default `EXITCODE` is `0`.\n- `STDOUT`: the expected standard output from the command. This field is optional and by default the standard output is **not checked**.\n- `STDERR`: the expected standard error output from the command. This field is optional and by default the standard error output is **not checked**.\n\nAll these fields support variables using the Python `string.Template` syntax (i.e. `$variable_name`). The variables are registered using the command line option `--var VAR_NAME VAR_VALUE`.\n\n# License\n\nThis project is licensed under the MIT license.\n\nThe file [diff_match_patch.py]() is licensed under the Apache License, Version 2.0 (the \"License\"), and comes from [https://github.com/google/diff-match-patch]().\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhgruniaux%2Fcmd_test_runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhgruniaux%2Fcmd_test_runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhgruniaux%2Fcmd_test_runner/lists"}