{"id":18361118,"url":"https://github.com/progrhyme/shove","last_synced_at":"2025-04-06T14:31:37.530Z","repository":{"id":55650629,"uuid":"56505846","full_name":"progrhyme/shove","owner":"progrhyme","description":"Prove-like Test Tool for Shell Scripts","archived":false,"fork":false,"pushed_at":"2020-12-15T10:24:17.000Z","size":172,"stargazers_count":34,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T01:41:43.696Z","etag":null,"topics":["shell-script","testing"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/progrhyme.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-04-18T12:27:08.000Z","updated_at":"2024-06-26T06:22:09.000Z","dependencies_parsed_at":"2022-08-15T05:31:23.025Z","dependency_job_id":null,"html_url":"https://github.com/progrhyme/shove","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrhyme%2Fshove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrhyme%2Fshove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrhyme%2Fshove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/progrhyme%2Fshove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/progrhyme","download_url":"https://codeload.github.com/progrhyme/shove/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247495916,"owners_count":20948125,"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":["shell-script","testing"],"created_at":"2024-11-05T22:31:54.044Z","updated_at":"2025-04-06T14:31:32.516Z","avatar_url":"https://github.com/progrhyme.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/progrhyme/shove.svg?branch=master)](https://travis-ci.org/progrhyme/shove)\n# shove\n\nA test tool for shell scripts with [TAP](https://testanything.org/) outputs.\n\nThe name **\"shove\"** comes from _\"shell\"_ and\n_\"[prove](http://perldoc.perl.org/prove.html)\"_ of Perl.\n\n### Table of Contents\n\n* [Screenshots](#screenshots)\n* [Supported Shells](#supported-shells)\n* [Install](#install)\n* [Usage](#usage)\n  * [Options](#options)\n* [How to write test codes](#how-to-write-test-codes)\n  * [Basics](#basics)\n  * [Grouping](#grouping)\n* [Authors](#authors)\n* [License](#license)\n\n# Screenshots\n\nPass:\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/progrhyme/shove/resource/image/screenshot-pass_01.png\" alt=\"shove-screenshot-pass_01\"\u003e\n\u003c/div\u003e\n\nFail:\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/progrhyme/shove/resource/image/screenshot-fail_01.png\" alt=\"shove-screenshot-fail_01\"\u003e\n\u003c/div\u003e\n\n# Supported Shells\n\n- _sh, bash, dash, ksh, zsh_\n\n_ash_ is not tested, but hopefully supposed to work with **shove**.  \n\nNo plan to support _(t)csh_ or _fish_ because they are not POSIX compatible.\n\n# Install\n\nJust clone this repository or get tarballs from [releases](https://github.com/progrhyme/shove/releases) page.\n\n```\n# example snippet to install `shove`\nmkdir ~/src\ngit clone https://github.com/progrhyme/shove.git ~/src/shove\nalias shove=\"$HOME/src/shove/bin/shove\"\nshove -V\n```\n\nYou can make a symlink of `bin/shove` in your favorite path;\ni.e. `/usr/local/bin/` or `$HOME/bin/` or any path.  \nOr you can make an alias command like the snippet above.\n\nNOTE:  \nDo not change the directory structure because `bin/shove` assumes\nits libraries exists in `../lib/` directory.\n\n# Usage\n\n```sh\nshove TARGETS [OPTIONS]\nshove t/foo.t\nshove t/foo.t t/bar.t -s /bin/bash -v\nshove -r t/ -v\n\n# help\nshove -h|--help\n\n# version\nshove -V|--version\n```\n\n## Options\n\n* `-s|--shell SHELL` : SHELL to execute tests. Default is `$SHELL`.\n* `-v|--verbose` : verbose output.\n* `-r|--recursive DIRECTORY` : Search test script files with extension `.t`\nunder the directory\n\n# How to write test codes\n\nMany test functions get hints from\n[Test::More](http://perldoc.perl.org/Test/More.html) of Perl.\n\nThere are some example test codes in [example](example) directory.\n\n## Basics\n\n```sh\nt_diag \"Test for your shell scripts\"  # Log message visible on the test\nt_pass                                # Always Pass\nt_fail                                # Always Fail\nt_ok        $exp  \"exp is true\"       # [   $exp ]\nt_ng        $exp  \"exp is false\"      # [ ! $exp ]\nt_present   $str  \"str is present\"    # [ -n \"$str\" ]\nt_blank     $str  \"str is blank\"      # [ -z \"$str\" ]\nt_exist     $path \"path exists\"       # [ -e \"$path\" ]\nt_file      $path \"path is file\"      # [ -f \"$path\" ]\nt_directory $path \"path is directory\" # [ -d \"$path\" ]\nt_symlink   $path \"path is symlink\"   # [ -L \"$path\" ]\nt_is        $a $b \"a is b\"            # [ \"$a\"  = \"$b\" ]\nt_isnt      $a $b \"a isn't b\"         # [ \"$a\" != \"$b\" ]\nt_eq        $x $y \"x == y\"            # [ $x -eq $y ]\nt_ne        $x $y \"x != y\"            # [ $x -ne $y ]\nt_gt        $x $y \"x \u003e  y\"            # [ $x -gt $y ]\nt_ge        $x $y \"x \u003e= y\"            # [ $x -ge $y ]\nt_lt        $x $y \"x \u003c  y\"            # [ $x -lt $y ]\nt_le        $x $y \"x \u003c= y\"            # [ $x -le $y ]\nt_success   $cmd  \"cmd succeeds\"      # $cmd; [ $? -eq 0 ]\nt_error     $cmd  \"cmd fails\"         # $cmd; [ $? -ne 0 ]\n```\n\n## Grouping\n\nThis feature works like `subtest` of\n[Test::More](http://perldoc.perl.org/Test/More.html).\n\nNew special syntax is introduced in v0.8.1:\n\n```sh\nt_ok $ok\n\nt::group \"level1 group\" ({\n  t_diag \"Comment for level1 tests\"\n  t_ok $lv1_ok\n\n  t::group \"level2 group\" ({\n    t_diag \"Comment for level2 tests\"\n    t_ok $lv2_ok\n    t_is $lv2_a $lv2_b\n  })\n})\n```\n\nThese codes are the same as following codes:\n\n```sh\nt_ok $ok\n(\n  t_substart \"level1 group\"\n  t_diag \"Comment for level1 tests\"\n  t_ok $lv1_ok\n  (\n    t_substart \"level2 group\"\n    t_diag \"Comment for level2 tests\"\n    t_ok $lv2_ok\n    t_is $lv2_a $lv2_b\n    t_subclose\n  )\n  t_subend \"level2 group\"\n  t_subclose\n)\nt_subend \"level1 group\"\n```\n\nTests in group are run in subshell.\nSo you can run them in different context from main tests context.\n\nIf you want test groups A and B not affect to each other, you have to put them in\ndifferent groups.\n\n**CAUTION:**\n\n- **The old grouping syntax `T_SUB (( ... ))` will be unsupported in the future\nrelease.**\n\n# Authors\n\nIKEDA Kiyoshi \u003cprogrhyme@gmail.com\u003e\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016-2020 IKEDA Kiyoshi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogrhyme%2Fshove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogrhyme%2Fshove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogrhyme%2Fshove/lists"}