{"id":20559829,"url":"https://github.com/cxw42/test-onlysome","last_synced_at":"2026-05-29T08:32:08.295Z","repository":{"id":56838912,"uuid":"158763940","full_name":"cxw42/Test-OnlySome","owner":"cxw42","description":"Run only some of the tests specified in a Perl test file.","archived":false,"fork":false,"pushed_at":"2020-02-15T02:53:30.000Z","size":125,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T19:02:11.866Z","etag":null,"topics":["perl","perl5","perl5-module","skip-tests","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/Test::OnlySome","language":"Perl","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/cxw42.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-23T00:59:04.000Z","updated_at":"2020-02-15T02:52:46.000Z","dependencies_parsed_at":"2022-08-28T23:22:05.250Z","dependency_job_id":null,"html_url":"https://github.com/cxw42/Test-OnlySome","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FTest-OnlySome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FTest-OnlySome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FTest-OnlySome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxw42%2FTest-OnlySome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cxw42","download_url":"https://codeload.github.com/cxw42/Test-OnlySome/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242167946,"owners_count":20082970,"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":["perl","perl5","perl5-module","skip-tests","testing","testing-tools"],"created_at":"2024-11-16T03:52:20.376Z","updated_at":"2026-05-29T08:32:08.270Z","avatar_url":"https://github.com/cxw42.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nTest::OnlySome - Skip individual tests in a \\*.t file\n\n# INSTALLATION\n\nEasiest: install `cpanminus` if you don't have it - see\n[https://metacpan.org/pod/App::cpanminus#INSTALLATION](https://metacpan.org/pod/App::cpanminus#INSTALLATION).  Then run\n`cpanm Test::OnlySome`.\n\nManually: clone or untar into a working directory.  Then, in that directory,\n\n    perl Makefile.PL\n    make\n    make test\n\n... and if all the tests pass,\n\n    make install\n\nIf some of the tests fail, please check the issues and file a new one if\nno one else has reported the problem yet.\n\n# SYNOPSIS\n\nSuppose you are testing a `long_running_function()`.  If it succeeded last\ntime, you don't want to take the time to test it again.  In your test file\n(e.g., `t/01.t`):\n\n    use Test::More tests =\u003e 2;\n    use Test::OnlySome::RerunFailed;    # rerun only failed tests\n    os ok(long_running_function());     # \"os\" marks tests that might be skipped\n    os ok(0, 'fails');\n\nAt the command line, supposing the function passes the test:\n\n    $ osprove -lv\n    ...\n    ok 1 - passes\n    not ok 2 - fails\n    ...\n    Result: FAIL\n\nThis creates `.onlysome.yml`, which holds the test results from `t/01.t`.\nThen, re-run:\n\n    $ osprove -lv\n    ...\n    ok 1 # skip Test::OnlySome: you asked me to skip this\n    not ok 2 - fails\n    ...\n\nSince test 1 passed the first time, it was skipped the second time.\n\nYou don't have to use [Test::OnlySome::RerunFailed](https://metacpan.org/pod/Test::OnlySome::RerunFailed).  You can directly\nuse `Test::OnlySome`, and you can decide in some other way which tests\nyou want to skip.\n\nThe argument to [\"os\"](#os) can be a statement or block, and it doesn't have to\nbe a [Test::More](https://metacpan.org/pod/Test::More) test.  You can wrap long-running tests in functions,\nand apply [\"os\"](#os) to those functions.\n\nPlease note that [\"os\"](#os) can take a `test_count` argument, e.g., if there\nare multiple tests in a block.  The whole block will be skipped if and only\nif all the tests in that block are skipped.  Otherwise, the whole block\nwill be rerun.  The moral?  Use a `test_count` of 1 for all tests run under\n[Test::OnlySome::RerunFailed](https://metacpan.org/pod/Test::OnlySome::RerunFailed) and you won't be surprised.\n\n# MARKING TESTS\n\nYou can pick which tests to skip using implicit or explicit configuration.\nExplicit configuration uses a hashref:\n\n    my $opts = { skip =\u003e { 2=\u003etrue } };\n\n    os $opts ok(1, 'This will run');    # Single statement OK\n\n    os $opts {                          # Block also OK\n        ok(0, 'This will be skipped');  # Skipped since it's test 2\n    };\n\nImplicit configuration uses a hashref in the package variable `$TEST_ONLYSOME`,\nwhich Test::OnlySome creates in your package when you `use` it:\n\n    $TEST_ONLYSOME-\u003e{skip} = { 2=\u003etrue };\n    os ok(1, 'Test 1');                     # This one runs\n    os ok(0, 'Test 2 - should be skipped'); # Skipped since it's test 2\n\n# EXPORTS\n\n## skip\\_these\n\nA convenience function to fill in `$hashref_options-\u003e{skip}`.\n\n    skip_these $hashref_options, 1, 2;\n        # Skip tests 1 and 2\n    skip_these 1, 2;\n        # If you are using implicit configuration\n\n## skip\\_next\n\nAnother convenience function: Mark the next test to be skipped.  Example:\n\n    skip_next;\n    os ok(0, 'This one will be skipped');\n\n## import\n\nThe `import` sub defines the keywords so that they will be exported (!).\nThis is per [Keyword::Declare](https://metacpan.org/pod/Keyword::Declare).\n\n## os\n\nKeyword `os` marks a statement that should be excuted **o**nly **s**ome of\nthe time.  Example:\n\n    os 'main::debug' $hrOpts  ok 1,'Something';\n        # Run \"ok 1,'Something'\" if hashref $hrOpts indicates.\n        # Save debug information into $main::debug.\n\nSyntax:\n\n    os ['debug::variable::name'] [$hashref_options] [test_count] \u003cstatement | block\u003e\n\n- `$debug::variable::name` will be assigned at compilation time.  If specified,\nthe given package variable will be filled in with the [Keyword::Declare](https://metacpan.org/pod/Keyword::Declare)\nparse of the os invocation.\n- `$hashref_options` will be accessed at runtime.  If it is not given,\n[\"$TEST\\_ONLYSOME\"](#test_onlysome) will be used instead.\n- `test_count` must be a numeric literal, if present.  If it is given,\nit will be used instead of the number of tests specified in\n`$hashref_options-\u003e{n}`.\n\n### Cautions\n\n- The given statement or block will be run in its own lexical scope,\nnot in the caller's scope.\n- If you use `test_count\u003e1`, the whole block will be skipped only if\nevery test in the block is marked to be skipped.  So, for example,\n\n        os 2 { ok(1); ok(0); }\n\n    will still run the `ok(1)` even if it was marked to be skipped if\n    the `ok(0)` was not marked to be skipped.\n\nI recommend that, when using [Test::OnlySome::RerunFailed](https://metacpan.org/pod/Test::OnlySome::RerunFailed), you always use\n`test_count == 1`.\n\n## unimport\n\nRemoves the [\"os\"](#os) keyword definition.\n\n# BUGS\n\nPlease report any bugs or feature requests on GitHub, at\n[https://github.com/cxw42/Test-OnlySome/issues](https://github.com/cxw42/Test-OnlySome/issues).\n\n# SUPPORT\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Test::OnlySome\n\nYou can also look for information at:\n\n- The GitHub repository\n\n    [https://github.com/cxw42/Test-OnlySome](https://github.com/cxw42/Test-OnlySome)\n\n- AnnoCPAN: Annotated CPAN documentation\n\n    [http://annocpan.org/dist/Test-OnlySome](http://annocpan.org/dist/Test-OnlySome)\n\n- CPAN Ratings\n\n    [https://cpanratings.perl.org/d/Test-OnlySome](https://cpanratings.perl.org/d/Test-OnlySome)\n\n- Search CPAN\n\n    [https://metacpan.org/release/Test-OnlySome](https://metacpan.org/release/Test-OnlySome)\n\n- RT: CPAN's request tracker\n\n    [https://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-OnlySome](https://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-OnlySome)\n\nThis module is versioned with [semantic versioning](https://semver.org),\nbut in the backward-compatible Perl format.  So version `0.001003` is\nsemantic version `0.1.3`.\n\n# LICENSE AND COPYRIGHT\n\nCopyright 2018 Christopher White.\n\nThis program is distributed under the MIT (X11) License:\n[http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxw42%2Ftest-onlysome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcxw42%2Ftest-onlysome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxw42%2Ftest-onlysome/lists"}