Code Monkey home page Code Monkey logo

gommando's Introduction

gommando

Run any command and run hooks when the output (stdout, stderr or stdboth) matches.

Great for E2E testing of command line tools! Allows you to start scanning for strings like "error" only after something else has been seen. See E2E testing samples samples at samples/.

For basic usage see examples/input/main.go which outputs:

$ go run examples/input/main.go
Enter your name:
  ^-- now it asks my name
      writing it (robot)
hello robot
  ^-- now it greeted me hello robot

  exited with 0

See examples/ping/main.go outputs:

$ go run examples/ping/main.go
PING google.com (172.217.20.46): 56 data bytes
  found 'google', I'll never say this again because I'm after .Once, but I'll trigger the next...
  ... .Then and I'll trigger the next .Once which will start to match now:
64 bytes from 172.217.20.46: seq=0 ttl=37 time=19.362 ms
  found 'ttl' and I'll never say this again because I'm after .Once
  found 'seq=' seen and I continue to say this because I'm after .Every
64 bytes from 172.217.20.46: seq=1 ttl=37 time=26.139 ms
  found 'seq=' seen and I continue to say this because I'm after .Every
64 bytes from 172.217.20.46: seq=2 ttl=37 time=19.728 ms
  found 'seq=' seen and I continue to say this because I'm after .Every
64 bytes from 172.217.20.46: seq=3 ttl=37 time=18.014 ms
  3 pings sent, exiting
  ping exited
  found 'seq=' seen and I continue to say this because I'm after .Every

More examples

See examples/

gommando's People

Contributors

matti avatar

Stargazers

Akihiro Suda avatar Christian Korneck avatar

Watchers

James Cloos avatar Akihiro Suda avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.